sanitize_bookmark

Definition:
function sanitize_bookmark($bookmark, $context = 'display') {}

Sanitizes all bookmark fields

Parameters

  • object|array $bookmark: Bookmark row
  • string $context: Optional, default is ‘display’. How to filter the fields

Return values

returns:Same type as $bookmark but with fields sanitized.

Source code

function sanitize_bookmark($bookmark, $context = 'display') {

	$fields = array('link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category',

		'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated',

		'link_rel', 'link_notes', 'link_rss', );



	if ( is_object($bookmark) ) {

		$do_object = true;

		$link_id = $bookmark->link_id;

	} else {

		$do_object = false;

		$link_id = $bookmark['link_id'];

	}



	foreach ( $fields as $field ) {

		if ( $do_object ) {

			if ( isset($bookmark->$field) )

				$bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $link_id, $context);

		} else {

			if ( isset($bookmark[$field]) )

				$bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $link_id, $context);

		}

	}



	return $bookmark;

}

2759

safecss_filter_attr

Definition:
function safecss_filter_attr( $css, $deprecated = '' ) {}

Inline CSS filter

Parameters

  • $css
  • $deprecated

Defined filters

  • safe_style_css
    apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',

    'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',

    'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left',

    'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color',

    'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top',

    'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side',

    'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style',

    'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom',

    'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom',

    'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align',

    'width' )

Source code

function safecss_filter_attr( $css, $deprecated = '' ) {

	if ( !empty( $deprecated ) )

		_deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented



	$css = wp_kses_no_null($css);

	$css = str_replace(array("\n","\r","\t"), '', $css);



	if ( preg_match( '%[\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments

		return '';



	$css_array = explode( ';', trim( $css ) );

	$allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',

	'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',

	'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left',

	'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color',

	'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top',

	'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side',

	'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style',

	'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom',

	'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom',

	'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align',

	'width' ) );



	if ( empty($allowed_attr) )

		return $css;



	$css = '';

	foreach ( $css_array as $css_item ) {

		if ( $css_item == '' )

			continue;

		$css_item = trim( $css_item );

		$found = false;

		if ( strpos( $css_item, ':' ) === false ) {

			$found = true;

		} else {

			$parts = split( ':', $css_item );

			if ( in_array( trim( $parts[0] ), $allowed_attr ) )

				$found = true;

		}

		if ( $found ) {

			if( $css != '' )

				$css .= ';';

			$css .= $css_item;

		}

	}



	return $css;

}

2757

rss_enclosure

Definition:
function rss_enclosure() {}

Display the rss enclosure for the current post.
Uses the global $post to check whether the post requires a password and if the user has the password for the post. If not then it will return before displaying.

Defined filters

  • rss_enclosure
    apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])

Source code

function rss_enclosure() {

	if ( post_password_required() )

		return;



	foreach ( (array) get_post_custom() as $key => $val) {

		if ($key == 'enclosure') {

			foreach ( (array) $val as $enc ) {

				$enclosure = explode("\n", $enc);



				//only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'

				$t = preg_split('/[ \t]/', trim($enclosure[2]) );

				$type = $t[0];



				echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n");

			}

		}

	}

}

2755

rsd_link

Definition:
function rsd_link() {}

Display the link to the Really Simple Discovery service endpoint.

Source code

function rsd_link() {

	echo '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . get_bloginfo('wpurl') . "/xmlrpc.php?rsd\" />\n";

}

2753

rich_edit_exists

Definition:
function rich_edit_exists() {}

Determine if TinyMCE is available.
Checks to see if the user has deleted the tinymce files to slim down there WordPress install.

Return values

returns:Whether TinyMCE exists.

Source code

function rich_edit_exists() {

	global $wp_rich_edit_exists;

	if ( !isset($wp_rich_edit_exists) )

		$wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js');

	return $wp_rich_edit_exists;

}

2751