is_object_in_taxonomy

Definition:
function is_object_in_taxonomy($object_type, $taxonomy) {}

Determine if the given object type is associated with the given taxonomy.

Parameters

  • string $object_type: Object type string
  • string $taxonomy: Single taxonomy name

Return values

returns:True if object is associated with the taxonomy, otherwise false.

Source code

function is_object_in_taxonomy($object_type, $taxonomy) {

	$taxonomies = get_object_taxonomies($object_type);



	if ( empty($taxonomies) )

		return false;



	if ( in_array($taxonomy, $taxonomies) )

		return true;



	return false;

}

2149

is_new_day

Definition:
function is_new_day() {}

Whether today is a new day.

Return values

returns:1 when new day, 0 if not a new day.

Source code

function is_new_day() {

	global $currentday, $previousday;

	if ( $currentday != $previousday )

		return 1;

	else

		return 0;

}

2147

is_network_only_plugin

Definition:
function is_network_only_plugin( $plugin ) {}

Checks for "Network: true" in the plugin header to see if this should be activated only as a network wide plugin. The plugin would also work when Multisite is not enabled.
Checks for "Site Wide Only: true" for backwards compatibility.

Parameters

  • string $plugin: Plugin to check

Return values

returns:True if plugin is network only, false otherwise.

Source code

function is_network_only_plugin( $plugin ) {

	$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );

	if ( $plugin_data )

		return $plugin_data['Network'];

	return false;

}

2145

is_nav_menu_item

Definition:
function is_nav_menu_item( $menu_item_id = 0 ) {}

Determine whether the given ID is a nav menu item.

Parameters

  • int $menu_item_id: The ID of the potential nav menu item.

Return values

returns:Whether the given ID is that of a nav menu item.

Source code

function is_nav_menu_item( $menu_item_id = 0 ) {

	return ( ! is_wp_error( $menu_item_id ) && ( 'nav_menu_item' == get_post_type( $menu_item_id ) ) );

}

2143

is_nav_menu

Definition:
function is_nav_menu( $menu ) {}

Check if the given ID is a navigation menu.
Returns true if it is; false otherwise.

Parameters

  • int|string $menu: The menu to check (id, slug, or name)

Return values

returns:Whether the menu exists.

Source code

function is_nav_menu( $menu ) {

	if ( ! $menu )

		return false;



	$menu_obj = wp_get_nav_menu_object( $menu );



	if (

		$menu_obj &&

		! is_wp_error( $menu_obj ) &&

		! empty( $menu_obj->taxonomy ) &&

		'nav_menu' == $menu_obj->taxonomy

	)

		return true;



	return false;

}

2141