WordPress.org

Make WordPress Core

Changeset 12651


Ignore:
Timestamp:
01/07/2010 07:55:48 PM (8 years ago)
Author:
ryan
Message:

Revert extra bits that snuck in with [12650]

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12650 r12651  
    100100if ( is_object_in_taxonomy($post_type, 'category') )
    101101    add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', $post_type, 'side', 'core');
    102 if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports($post_type, 'post-thumbnails') )
     102if ( current_theme_supports( 'post-thumbnails', $post_type ) )
    103103    add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', $post_type, 'side', 'low');
    104 if ( post_type_supports($post_type, 'excerpts') )
    105     add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $post_type, 'normal', 'core');
    106 if ( post_type_supports($post_type, 'trackbacks') )
    107     add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', $post_type, 'normal', 'core');
    108 if ( post_type_supports($post_type, 'custom-fields') )
    109     add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core');
     104add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $post_type, 'normal', 'core');
     105add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', $post_type, 'normal', 'core');
     106add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core');
    110107do_action('dbx_post_advanced');
    111 if ( post_type_supports($post_type, 'comments') )
    112     add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core');
    113 
    114 if ( ('publish' == $post->post_status || 'private' == $post->post_status) && post_type_supports($post_type, 'comments') )
     108add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core');
     109
     110if ( 'publish' == $post->post_status || 'private' == $post->post_status )
    115111    add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', $post_type, 'normal', 'core');
    116112
  • trunk/wp-admin/edit-page-form.php

    r12650 r12651  
    7676require_once('includes/meta-boxes.php');
    7777
    78 $post_type = 'page';
    79 
    8078add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core');
    81 
    82 if ( post_type_supports($post_type, 'page-attributes') )
    83     add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', $post_type, 'side', 'core');
    84 if ( post_type_supports($post_type, 'custom-fields') )
    85     add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core');
    86 if ( post_type_supports($post_type, 'comments') )
    87     add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core');
    88 add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core');
    89 if ( current_theme_supports( 'post-thumbnails', 'page' ) && post_type_supports($post_type, 'post-thumbnails') )
    90     add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', $post_type, 'side', 'low');
     79add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
     80add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
     81add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
     82add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
     83if ( current_theme_supports( 'post-thumbnails', 'page' ) )
     84    add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
    9185
    9286$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
     
    9488    $authors[] = $post->post_author;
    9589if ( $authors && count( $authors ) > 1 )
    96     add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', $post_type, 'normal', 'core');
     90    add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core');
    9791
    9892if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
    99     add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', $post_type, 'normal', 'core');
     93    add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core');
    10094
    101 do_action('do_meta_boxes', $post_type, 'normal', $post);
    102 do_action('do_meta_boxes', $post_type, 'advanced', $post);
    103 do_action('do_meta_boxes', $post_type, 'side', $post);
     95do_action('do_meta_boxes', 'page', 'normal', $post);
     96do_action('do_meta_boxes', 'page', 'advanced', $post);
     97do_action('do_meta_boxes', 'page', 'side', $post);
    10498
    10599require_once('admin-header.php');
     
    135129<?php
    136130do_action('submitpage_box');
    137 $side_meta_boxes = do_meta_boxes($post_type, 'side', $post); ?>
     131$side_meta_boxes = do_meta_boxes('page', 'side', $post); ?>
    138132</div>
    139133
     
    185179
    186180<?php
    187 do_meta_boxes($post_type, 'normal', $post);
     181do_meta_boxes('page', 'normal', $post);
    188182do_action('edit_page_form');
    189 do_meta_boxes($post_type, 'advanced', $post);
     183do_meta_boxes('page', 'advanced', $post);
    190184?>
    191185
  • trunk/wp-includes/post.php

    r12650 r12651  
    2020    register_post_type( 'attachment', array('label' => __('Media'), 'exclude_from_search' => false, '_builtin' => true, '_edit_link' => 'media.php?attachment_id=%d', 'capability_type' => 'post', 'hierarchical' => false) );
    2121    register_post_type( 'revision', array('label' => __('Revisions'),'exclude_from_search' => true, '_builtin' => true, '_edit_link' => 'revision.php?revision=%d', 'capability_type' => 'post', 'hierarchical' => false) );
    22     add_post_type_support('post', array('post-thumbnails', 'excerpts', 'trackbacks', 'custom-fields', 'comments') );
    23     add_post_type_support('page', array('post-thumbnails', 'page-attributes', 'custom-fields', 'comments') );
    2422}
    2523add_action( 'init', 'create_initial_post_types', 0 ); // highest priority
     
    562560
    563561    return $args;
    564 }
    565 
    566 /**
    567  * Register support of certain features for a post type.
    568  *
    569  * @since 3.0
    570  * @param string $post_type The post type for which to add the feature
    571  * @param string|array $feature the feature being added, can be an array of feature strings or a single string
    572  */
    573 function add_post_type_support( $post_type, $feature ) {
    574     global $_wp_post_type_features;
    575 
    576     $features = (array) $feature;
    577     foreach ($features as $feature) {
    578         if ( func_num_args() == 2 )
    579             $_wp_post_type_features[$post_type][$feature] = true;
    580         else
    581             $_wp_post_type_features[$post_type][$feature] = array_slice( func_get_args(), 2 );
    582     }
    583 }
    584 
    585 /**
    586  * Checks a post type's support for a given feature
    587  *
    588  * @since 3.0
    589  * @param string $post_type The post type being checked
    590  * @param string $feature the feature being checked
    591  * @return boolean
    592  */
    593 
    594 function post_type_supports( $post_type, $feature ) {
    595     global $_wp_post_type_features;
    596 
    597     if ( !isset( $_wp_post_type_features[$post_type][$feature] ) )
    598         return false;
    599 
    600     // If no args passed then no extra checks need be performed
    601     if ( func_num_args() <= 2 )
    602         return true;
    603 
    604     // @todo Allow pluggable arg checking
    605     //$args = array_slice( func_get_args(), 2 );
    606 
    607     return true;
    608562}
    609563
Note: See TracChangeset for help on using the changeset viewer.