wp_style_is

Definition:
function wp_style_is( $handle, $list = 'queue' ) {}

Check whether style has been added to WordPress Styles.
The values for list defaults to ‘queue’, which is the same as wp_enqueue_style().

Parameters

  • string $handle: Name of the stylesheet.
  • string $list: Values are ‘registered’, ‘done’, ‘queue’ and ‘to_do’.

Return values

returns:True on success, false on failure.

Source code

function wp_style_is( $handle, $list = 'queue' ) {

	global $wp_styles;

	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {

		if ( ! did_action( 'init' ) )

			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),

				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		$wp_styles = new WP_Styles();

	}



	$query = $wp_styles->query( $handle, $list );



	if ( is_object( $query ) )

		return true;



	return $query;

}

4149

wp_strip_all_tags

Definition:
function wp_strip_all_tags($string, $remove_breaks = false) {}

Properly strip all HTML tags including script and style

Parameters

  • string $string: String containing HTML tags
  • bool $remove_breaks: optional Whether to remove left over line breaks and white space chars

Return values

returns:The processed string.

Source code

function wp_strip_all_tags($string, $remove_breaks = false) {

	$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );

	$string = strip_tags($string);



	if ( $remove_breaks )

		$string = preg_replace('/[\r\n\t ]+/', ' ', $string);



	return trim($string);

}

4147

wp_stream_image

Definition:
function wp_stream_image($image, $mime_type, $post_id) {}

Parameters

  • $image
  • $mime_type
  • $post_id

Defined filters

  • image_save_pre
    apply_filters('image_save_pre', $image, $post_id)

Source code

function wp_stream_image($image, $mime_type, $post_id) {

	$image = apply_filters('image_save_pre', $image, $post_id);



	switch ( $mime_type ) {

		case 'image/jpeg':

			header('Content-Type: image/jpeg');

			return imagejpeg($image, null, 90);

		case 'image/png':

			header('Content-Type: image/png');

			return imagepng($image);

		case 'image/gif':

			header('Content-Type: image/gif');

			return imagegif($image);

		default:

			return false;

	}

}

4145

wp_ssl_constants

Definition:
function wp_ssl_constants( ) {}

Defines cookie related WordPress constants

Source code

function wp_ssl_constants( ) {

	/**

	 * @since 2.6.0

	 */

	if ( !defined('FORCE_SSL_ADMIN') )

		define('FORCE_SSL_ADMIN', false);

	force_ssl_admin(FORCE_SSL_ADMIN);



	/**

	 * @since 2.6.0

	 */

	if ( !defined('FORCE_SSL_LOGIN') )

		define('FORCE_SSL_LOGIN', false);

	force_ssl_login(FORCE_SSL_LOGIN);

}

4143

wp_sprintf_l

Definition:
function wp_sprintf_l($pattern, $args) {}

Localize list items before the rest of the content.
The ‘%l’ must be at the first characters can then contain the rest of the content. The list items will have ‘, ‘, ‘, and’, and ‘ and ‘ added depending on the amount of list items in the $args parameter.

Parameters

  • string $pattern: Content containing ‘%l’ at the beginning.
  • array $args: List items to prepend to the content and replace ‘%l’.

Return values

returns:Localized list items and rest of the content.

Defined filters

  • wp_sprintf_l
    apply_filters('wp_sprintf_l', array(

    /* translators: used between list items, there is a space after the comma */

    'between' => __(', ')

Source code

function wp_sprintf_l($pattern, $args) {

	// Not a match

	if ( substr($pattern, 0, 2) != '%l' )

		return $pattern;



	// Nothing to work with

	if ( empty($args) )

		return '';



	// Translate and filter the delimiter set (avoid ampersands and entities here)

	$l = apply_filters('wp_sprintf_l', array(

		/* translators: used between list items, there is a space after the comma */

		'between'          => __(', '),

		/* translators: used between list items, there is a space after the and */

		'between_last_two' => __(', and '),

		/* translators: used between only two list items, there is a space after the and */

		'between_only_two' => __(' and '),

		));



	$args = (array) $args;

	$result = array_shift($args);

	if ( count($args) == 1 )

		$result .= $l['between_only_two'] . array_shift($args);

	// Loop when more than two args

	$i = count($args);

	while ( $i ) {

		$arg = array_shift($args);

		$i--;

		if ( 0 == $i )

			$result .= $l['between_last_two'] . $arg;

		else

			$result .= $l['between'] . $arg;

	}

	return $result . substr($pattern, 2);

}

4141