stripslashes_deep

Definition:
function stripslashes_deep($value) {}

Navigates through an array and removes slashes from the values.
If an array is passed, the array_map() function causes a callback to pass the value back to the function. The slashes from this value will removed.

Parameters

  • array|string $value: The array or string to be stripped.

Return values

returns:Stripped array (or string in the callback).

Source code

function stripslashes_deep($value) {

	if ( is_array($value) ) {

		$value = array_map('stripslashes_deep', $value);

	} elseif ( is_object($value) ) {

		$vars = get_object_vars( $value );

		foreach ($vars as $key=>$data) {

			$value->{$key} = stripslashes_deep( $data );

		}

	} else {

		$value = stripslashes($value);

	}



	return $value;

}

2919

stream_preview_image

Definition:
function stream_preview_image($post_id) {}

Parameters

  • $post_id

Defined filters

  • admin_memory_limit
    apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT )

Source code

function stream_preview_image($post_id) {

	$post = get_post($post_id);

	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );

	$img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );



	if ( !is_resource($img) )

		return false;



	$changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;

	if ( $changes )

		$img = image_edit_apply_changes($img, $changes);



	// scale the image

	$w = imagesx($img);

	$h = imagesy($img);

	$ratio = _image_get_preview_ratio($w, $h);

	$w2 = $w * $ratio;

	$h2 = $h * $ratio;



	$preview = wp_imagecreatetruecolor($w2, $h2);

	imagecopyresampled( $preview, $img, 0, 0, 0, 0, $w2, $h2, $w, $h );

	wp_stream_image($preview, $post->post_mime_type, $post_id);



	imagedestroy($preview);

	imagedestroy($img);

	return true;

}

2917

stick_post

Definition:
function stick_post($post_id) {}

Make a post sticky.
Sticky posts should be displayed at the top of the front page.

Parameters

  • int $post_id: Post ID.

Source code

function stick_post($post_id) {

	$stickies = get_option('sticky_posts');



	if ( !is_array($stickies) )

		$stickies = array($post_id);



	if ( ! in_array($post_id, $stickies) )

		$stickies[] = $post_id;



	update_option('sticky_posts', $stickies);

}

2915

sticky_class

Definition:
function sticky_class( $post_id = null ) {}

Display "sticky" CSS class, if a post is sticky.

Parameters

  • int $post_id: An optional post ID.

Source code

function sticky_class( $post_id = null ) {

	if ( !is_sticky($post_id) )

		return;



	echo " sticky";

}

2913

status_header

Definition:
function status_header( $header ) {}

Set HTTP status header.

Parameters

  • int $header: HTTP status code

Defined filters

  • status_header
    apply_filters( 'status_header', $status_header, $header, $text, $protocol )

Source code

function status_header( $header ) {

	$text = get_status_header_desc( $header );



	if ( empty( $text ) )

		return false;



	$protocol = $_SERVER["SERVER_PROTOCOL"];

	if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )

		$protocol = 'HTTP/1.0';

	$status_header = "$protocol $header $text";

	if ( function_exists( 'apply_filters' ) )

		$status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol );



	return @header( $status_header, true, $header );

}

2911