Make WordPress Core


Ignore:
Timestamp:
07/17/2014 09:13:53 AM (11 years ago)
Author:
DrewAPicture
Message:

Fix syntax for single- and multi-line comments in wp-admin-directory files.

See #28931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/nav-menu.php

    r28500 r29206  
    517517        if ( $post_type ) {
    518518            $id = $post_type->name;
    519             // give pages a higher priority
     519            // Give pages a higher priority.
    520520            $priority = ( 'page' == $post_type->name ? 'core' : 'default' );
    521521            add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );
     
    616616    $post_type_name = $post_type['args']->name;
    617617
    618     // paginate browsing for large numbers of post objects
     618    // Paginate browsing for large numbers of post objects.
    619619    $per_page = 50;
    620620    $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
     
    763763                $args['walker'] = $walker;
    764764
    765                 // if we're dealing with pages, let's put a checkbox for the front page at the top of the list
     765                /*
     766                 * If we're dealing with pages, let's put a checkbox for the front
     767                 * page at the top of the list.
     768                 */
    766769                if ( 'page' == $post_type_name ) {
    767770                    $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
     
    855858    $taxonomy_name = $taxonomy['args']->name;
    856859
    857     // paginate browsing for large numbers of objects
     860    // Paginate browsing for large numbers of objects.
    858861    $per_page = 50;
    859862    $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
     
    10461049    if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {
    10471050
    1048         // Loop through all the menu items' POST values
     1051        // Loop through all the menu items' POST values.
    10491052        foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
    10501053            if (
    1051                 empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked
     1054                // Checkbox is not checked.
     1055                empty( $_item_object_data['menu-item-object-id'] ) &&
    10521056                (
    1053                     ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set
    1054                     in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default
     1057                    // And item type either isn't set.
     1058                    ! isset( $_item_object_data['menu-item-type'] ) ||
     1059                    // Or URL is the default.
     1060                    in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) ||
    10551061                    ! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page)
    1056                     ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists
     1062                    // Or it *is* a custom menu item that already exists.
     1063                    ! empty( $_item_object_data['menu-item-db-id'] )
    10571064                )
    10581065            ) {
    1059                 continue; // then this potential menu item is not getting added to this menu
     1066                // Then this potential menu item is not getting added to this menu.
     1067                continue;
    10601068            }
    10611069
    1062             // if this possible menu item doesn't actually have a menu database ID yet
     1070            // If this possible menu item doesn't actually have a menu database ID yet.
    10631071            if (
    10641072                empty( $_item_object_data['menu-item-db-id'] ) ||
     
    11131121            );
    11141122
    1115         // posts should show only published items
     1123        // Posts should show only published items.
    11161124        } elseif ( 'post' == $object->name ) {
    11171125            $object->_default_query = array(
     
    11191127            );
    11201128
    1121         // cats should be in reverse chronological order
     1129        // Categories should be in reverse chronological order.
    11221130        } elseif ( 'category' == $object->name ) {
    11231131            $object->_default_query = array(
     
    11261134            );
    11271135
    1128         // custom post types should show only published items
     1136        // Custom post types should show only published items.
    11291137        } else {
    11301138            $object->_default_query = array(
     
    12271235    $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
    12281236
    1229     // delete orphaned draft menu items
     1237    // Delete orphaned draft menu items.
    12301238    $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) );
    12311239
Note: See TracChangeset for help on using the changeset viewer.