_wp_nav_menu_meta_box_object

The timeline below displays how wordpress function _wp_nav_menu_meta_box_object has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Adds custom arguments to some of the meta box object types.
 *
 * @since 3.0.0
 *
 * @access private
 *
 * @param object $data_object The post type or taxonomy meta-object.
 * @return object The post type or taxonomy object.
 */
function _wp_nav_menu_meta_box_object($data_object = null)
{
    if (isset($data_object->name)) {
        if ('page' === $data_object->name) {
            $data_object->_default_query = array('orderby' => 'menu_order title', 'post_status' => 'publish');
            // Posts should show only published items.
        } elseif ('post' === $data_object->name) {
            $data_object->_default_query = array('post_status' => 'publish');
            // Categories should be in reverse chronological order.
        } elseif ('category' === $data_object->name) {
            $data_object->_default_query = array('orderby' => 'id', 'order' => 'DESC');
            // Custom post types should show only published items.
        } else {
            $data_object->_default_query = array('post_status' => 'publish');
        }
    }
    return $data_object;
}

WordPress Version: 5.5

/**
 * Adds custom arguments to some of the meta box object types.
 *
 * @since 3.0.0
 *
 * @access private
 *
 * @param object $object The post type or taxonomy meta-object.
 * @return object The post type or taxonomy object.
 */
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;
}

WordPress Version: 5.4

/**
 * Adds custom arguments to some of the meta box object types.
 *
 * @since 3.0.0
 *
 * @access private
 *
 * @param object $object The post type or taxonomy meta-object.
 * @return object The post type or taxonomy object.
 */
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;
}

WordPress Version: 4.0

/**
 * Adds custom arguments to some of the meta box object types.
 *
 * @since 3.0.0
 *
 * @access private
 *
 * @param object $object The post type or taxonomy meta-object.
 * @return object The post type of taxonomy object.
 */
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;
}

WordPress Version: 3.7

/**
 * Adds custom arguments to some of the meta box object types.
 *
 * @since 3.0.0
 *
 * @access private
 *
 * @param object $object The post type or taxonomy meta-object.
 * @return object The post type of taxonomy object.
 */
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');
            // cats 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;
}