Make WordPress Core


Ignore:
Timestamp:
10/24/2012 10:15:43 PM (13 years ago)
Author:
ryan
Message:

Use the create_posts capability in more places.

In get_post_type_capabilities(), make sure create_posts reflects customizations to the edit_posts capability when create_posts is not specifically set.

File:
1 edited

Legend:

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

    r21597 r22291  
    222222<div class="wrap">
    223223<?php screen_icon(); ?>
    224 <h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
     224<h2><?php
     225echo esc_html( $post_type_object->labels->name );
     226if ( current_user_can( $post_type_object->cap->create_posts ) )
     227    echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    225228if ( ! empty( $_REQUEST['s'] ) )
    226     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
    227 </h2>
     229    printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
     230?></h2>
    228231
    229232<?php if ( isset( $_REQUEST['locked'] ) || isset( $_REQUEST['updated'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.