Skip to content

Issues with the "organiser" metabox #106

@stephenharris

Description

@stephenharris

Some users (all except admin / original author?) view an event (with all the appropriate levels) - the "organiser" metabox does not appear. This is because incorrect arguments are used in the add_meta_box() function. Consequently although WordPress thinks the metabox is added (see Screen Options), it is not.

On a related note permission checks should be used to ensure its own visible to users with the appropriate permissions.

The fix is to replace (line 26 event-organiser/event-organiser-edit.php )

 function _eventorganiser_author_meta_box_title() {
      remove_meta_box( 'authordiv', 'event', 'core' );
      add_meta_box( 'authordiv',  __( 'Organiser', 'eventorganiser' ), 'post_author_meta_box', 'event', 'core', 'high' );
 }

with

 function _eventorganiser_author_meta_box_title() {
      $post_type_object = get_post_type_object( 'event' );
      if ( post_type_supports('event', 'author') ) {
           if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ){
                remove_meta_box( 'authordiv', 'event', 'core' );
                add_meta_box( 'authordiv',  __( 'Organiser', 'eventorganiser' ), 'post_author_meta_box', 'event', 'normal', 'core' );
           }
      }   
 }

This fix will be included in the next update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions