WordPress.org

Making WordPress.org


Ignore:
Timestamp:
11/27/2017 11:56:25 PM (6 months ago)
Author:
coreymckrill
Message:

WordCamp Post Type: Change capability type for the post Type

Instead of the default edit_posts etc., this sets the capability
type for WCPT to wordcamp, so the caps become edit_wordcamps etc.
This allows for more granular permissions for content editing and
supports the new WordCamp Wrangler subrole.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/views/wordcamp/metabox-status.php

    r2877 r6183  
    1 <?php defined( 'WPINC' ) or die(); ?>
     1<?php
     2defined( 'WPINC' ) || die();
     3
     4$wcpt = get_post_type_object( WCPT_POST_TYPE_ID );
     5?>
    26
    37<div id="submitpost" class="wcb submitbox">
     
    812                    WordCamp Status:
    913
    10                     <?php if ( current_user_can( 'manage_network' ) ) : ?>
     14                    <?php if ( current_user_can( $wcpt->cap->edit_posts ) ) : ?>
    1115
    1216                        <span id="post-status-display">
     
    4852    <div id="major-publishing-actions">
    4953        <div id="delete-action">
    50             <?php if ( current_user_can( 'delete_post', $post->ID ) ) : ?>
     54            <?php if ( current_user_can( $wcpt->cap->delete_post, $post->ID ) ) : ?>
    5155                <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>">
    5256                    <?php _e( 'Delete', 'wordcamporg' ); ?>
Note: See TracChangeset for help on using the changeset viewer.