is_admin_bar_showing

Definition:
function is_admin_bar_showing() {}

Determine whether the admin bar should be showing.

Return values

returns:Whether the admin bar should be showing.

Defined filters

  • show_admin_bar
    apply_filters( 'show_admin_bar', $show_admin_bar )

Source code

function is_admin_bar_showing() {

	global $show_admin_bar, $pagenow;



	// For all these types of requests, we never want an admin bar.

	if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )

		return false;



	// Integrated into the admin.

	if ( is_admin() )

		return true;



	if ( ! isset( $show_admin_bar ) ) {

		if ( ! is_user_logged_in() || 'wp-login.php' == $pagenow ) {

			$show_admin_bar = false;

		} else {

			$show_admin_bar = _get_admin_bar_pref();

		}

	}



	$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );



	return $show_admin_bar;

}

9859

iis7_supports_permalinks

Definition:
function iis7_supports_permalinks() {}

Check if IIS 7 supports pretty permalinks.

Defined filters

  • iis7_supports_permalinks
    apply_filters('iis7_supports_permalinks', $supports_permalinks)

Source code

function iis7_supports_permalinks() {

	global $is_iis7;



	$supports_permalinks = false;

	if ( $is_iis7 ) {

		/* First we check if the DOMDocument class exists. If it does not exist,

		 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,

		 * hence we just bail out and tell user that pretty permalinks cannot be used.

		 * This is not a big issue because PHP 4.X is going to be deprecated and for IIS it

		 * is recommended to use PHP 5.X NTS.

		 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When

		 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.

		 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs

		 * via ISAPI then pretty permalinks will not work.

		 */

		$supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );

	}



	return apply_filters('iis7_supports_permalinks', $supports_permalinks);

}

9812

has_term

Definition:
function has_term( $term = '', $taxonomy = '', $post = null ) {}

Check if the current post has any of given terms.
The given terms are checked against the post’s terms’ term_ids, names and slugs. Terms given as integers will only be checked against the post’s terms’ term_ids. If no terms are given, determines if post has any terms.

Parameters

  • string|int|array $term: Optional. The term name/term_id/slug or array of them to check for.
  • string $taxonomy: Taxonomy name
  • int|object $post: Optional. Post to check instead of the current post.

Return values

returns:True if the current post has any of the given tags (or any tag, if no tag specified).

Source code

function has_term( $term = '', $taxonomy = '', $post = null ) {

	$post = get_post($post);



	if ( !$post )

		return false;



	$r = is_object_in_term( $post->ID, $taxonomy, $term );

	if ( is_wp_error( $r ) )

		return false;



	return $r;

}

9794

has_post_format

Definition:
function has_post_format( $format, $post = null ) {}

Check if a post has a particular format

Parameters

  • string $format: The format to check for
  • object|id $post: The post to check. If not supplied, defaults to the current post if used in the loop.

Return values

returns:True if the post has the format, false otherwise.

Source code

function has_post_format( $format, $post = null ) {

	return has_term('post-format-' . sanitize_key($format), 'post_format', $post);

}

9790

has_category

Definition:
function has_category( $category = '', $post = null ) {}

Check if the current post has any of given category.

Parameters

  • string|int|array $tag: Optional. The category name/term_id/slug or array of them to check for.
  • int|object $post: Optional. Post to check instead of the current post.
  • $category

Return values

returns:True if the current post has any of the given categories (or any category, if no category specified).

Source code

function has_category( $category = '', $post = null ) {

	return has_term( $category, 'category', $post );

}

9784