Making WordPress.org

Changeset 7608


Ignore:
Timestamp:
08/13/2018 01:41:42 PM (8 years ago)
Author:
vedjain
Message:

WordCamp: Remove duplicate add_meta_box calls from Meetup admin. Also, use common permissions for both WordCamp and Meetup.

Event_Admin class already loads logs and private note meta boxes for both WordCamp and Meetup.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php

    r7607 r7608  
    2020     */
    2121    public function __construct() {
     22
    2223        add_action( 'add_meta_boxes', array( $this, 'metabox' ) );
    2324
     
    151152        }
    152153
     154        if ( ! current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
     155            return;
     156        }
     157
    153158        add_meta_box(
    154159            'wcpt_log',
     
    167172    public function add_note_metabox() {
    168173        if ( ! current_user_can( $this->get_edit_capability() ) ) {
     174            return;
     175        }
     176
     177        if ( ! current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
    169178            return;
    170179        }
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-admin.php

    r7607 r7608  
    186186                'advanced'
    187187            );
    188 
    189             if ( current_user_can( 'wcpt_wrangle_meetups' ) ) {
    190                 add_meta_box(
    191                     'wcpt_meetup_notes',
    192                     __( 'Add Private Note', 'wcpt' ),
    193                     array( $this, 'wcpt_notes_metabox' ),
    194                     Meetup_Application::POST_TYPE,
    195                     'advanced'
    196                 );
    197 
    198                 add_meta_box(
    199                     'wcpt_meetup_logs',
    200                     __( 'Logs', 'wcpt' ),
    201                     array( $this, 'wcpt_logs_metabox' ),
    202                     Meetup_Application::POST_TYPE,
    203                     'advanced'
    204                 );
    205 
    206             }
    207188        }
    208189
Note: See TracChangeset for help on using the changeset viewer.