is_archived

Definition:
function is_archived( $id ) {}

Check if a particular blog is archived.

Parameters

  • int $id: The blog id

Return values

returns:Whether the blog is archived or not

Source code

function is_archived( $id ) {

	return get_blog_status($id, 'archived');

}

2089

is_archive

Definition:
function is_archive() {}

Is the query for an archive page?
Month, Year, Category, Author, Post Type archive…

Source code

	function is_archive() {

		return (bool) $this->is_archive;

	}

2087

is_admin

Definition:
function is_admin() {}

Whether the current request is for a network or blog admin page
Does not inform on whether the user is an admin! Use capability checks to tell if the user should be accessing a section or not.

Return values

returns:True if inside WordPress administration pages.

Source code

function is_admin() {

	if ( defined( 'WP_ADMIN' ) )

		return WP_ADMIN;

	return false;

}

2085

is_active_widget

Definition:
function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {}

Whether widget is displayed on the front-end.
Either $callback or $id_base can be used $id_base is the first argument when extending WP_Widget class Without the optional $widget_id parameter, returns the ID of the first sidebar in which the first instance of the widget with the given callback or $id_base is found. With the $widget_id parameter, returns the ID of the sidebar where the widget with that callback/$id_base AND that ID is found.

Parameters

  • string $callback: Optional, Widget callback to check.
  • int $widget_id: Optional, but needed for checking. Widget ID.
  • string $id_base: Optional, the base ID of a widget created by extending WP_Widget.
  • bool $skip_inactive: Optional, whether to check in ‘wp_inactive_widgets’.

Return values

returns:false if widget is not active or id of sidebar in which the widget is active.

Source code

function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {

	global $wp_registered_widgets;



	$sidebars_widgets = wp_get_sidebars_widgets();



	if ( is_array($sidebars_widgets) ) {

		foreach ( $sidebars_widgets as $sidebar => $widgets ) {

			if ( $skip_inactive && 'wp_inactive_widgets' == $sidebar )

				continue;



			if ( is_array($widgets) ) {

				foreach ( $widgets as $widget ) {

					if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && _get_widget_id_base($widget) == $id_base ) ) {

						if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )

							return $sidebar;

					}

				}

			}

		}

	}

	return false;

}

2083

is_active_sidebar

Definition:
function is_active_sidebar( $index ) {}

Whether a sidebar is in use.

Parameters

  • mixed $index: Sidebar name, id or number to check.

Return values

returns:true if the sidebar is in use, false otherwise.

Source code

function is_active_sidebar( $index ) {

	$index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);

	$sidebars_widgets = wp_get_sidebars_widgets();

	if ( !empty($sidebars_widgets[$index]) )

		return true;



	return false;

}

2081