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-form-advanced.php

    r22072 r22291  
    275275<div class="wrap">
    276276<?php screen_icon(); ?>
    277 <h2><?php echo esc_html( $title ); ?><?php if ( isset( $post_new_file ) ) : ?> <a href="<?php echo esc_url( $post_new_file ) ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a><?php endif; ?></h2>
     277<h2><?php
     278echo esc_html( $title );
     279if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
     280    echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
     281?></h2>
    278282<?php if ( $notice ) : ?>
    279283<div id="notice" class="error"><p><?php echo $notice ?></p></div>
Note: See TracChangeset for help on using the changeset viewer.