Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the "organiser" metabox #106

Closed
stephenharris opened this issue Jul 12, 2013 · 0 comments
Closed

Issues with the "organiser" metabox #106

stephenharris opened this issue Jul 12, 2013 · 0 comments

Comments

@stephenharris
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant