Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_nav_menu_meta_box_object ›

Seit3.0.0
Veraltetn/v
_wp_nav_menu_meta_box_object ( $object = null )
Zugriff:
  • private
Parameter:
  • (object) $object The post type or taxonomy meta-object.
    Erforderlich: Nein
    Standard: null
Gibt zurück:
  • (object) The post type of taxonomy object.
Definiert in:
Codex:

Adds custom arguments to some of the meta box object types.



Quellcode

function _wp_nav_menu_meta_box_object( $object = null ) {
	if ( isset( $object->name ) ) {

		if ( 'page' == $object->name ) {
			$object->_default_query = array(
				'orderby'     => 'menu_order title',
				'post_status' => 'publish',
			);

			// Posts should show only published items.
		} elseif ( 'post' == $object->name ) {
			$object->_default_query = array(
				'post_status' => 'publish',
			);

			// Categories should be in reverse chronological order.
		} elseif ( 'category' == $object->name ) {
			$object->_default_query = array(
				'orderby' => 'id',
				'order'   => 'DESC',
			);

			// Custom post types should show only published items.
		} else {
			$object->_default_query = array(
				'post_status' => 'publish',
			);
		}
	}

	return $object;
}