User Role Editor
[resolved] Only allow MP3 uploads to Sermons (6 posts)

  1. Trishah
    Posted 2 years ago #

    I'm usually not this dense, but I'm having difficulty understanding how to use your plugin to create a role that can only upload MP3 files to this Sermon Manager plugin: http://wordpress.org/extend/plugins/sermon-manager-for-wordpress/

    I've read a number of support tickets and read several posts on your website and I'm still not getting it. I was hoping I could just add a function to my child theme and not have to make changes to their plugin which will most likely get overwritten with each update.


  2. Vladimir Garagulya
    Plugin Author

    Posted 2 years ago #

    As Sermon Manager plugin doesn't use any special capability to permit/prohibit attachment media types, URE plugin can not help you in this case.
    But You may use this code to limit upload by MP3 files only:

    add_filter( 'wpfc_meta_boxes', 'modified_sermon_metaboxes', 9999 );
    // Define the metabox and field configurations.
    function modified_sermon_metaboxes( array $meta_boxes ) {
      unset($meta_boxes[1]['fields'][1]);  // switch off video
      unset($meta_boxes[1]['fields'][2]);  // switch off PDF
      return $meta_boxes;

    In order this code work for you create folder wp-content/mu-plugins
    "mu" - means "must use"
    create any php file there, e.g. sermon.php and place code above into it.

  3. Trishah
    Posted 2 years ago #

    Very interesting. I see how that would work.

    Unfortunately, your suggestion is not going to work in the current situation. At this point limiting to MP3's is less important then limiting to the Sermons Manager.

    Would you be so kind as to show me how to create a user account that would only be able to access the Sermons Manager admin pages and no others?

  4. Trishah
    Posted 2 years ago #

    I'm sorry to have to ask again... I just can't figure out how to set up your plugin to make one role only about to access the Sermons Manager plugin. http://wordpress.org/extend/plugins/sermon-manager-for-wordpress/

    I've looked through your website and can't put it all together so it works. Can you give me some guidance please?

  5. Vladimir Garagulya
    Plugin Author

    Posted 2 years ago #

    It is impossible to achieve without modifying plugin code.
    Sermon Manager creates custom post type with Sermons, which needs capability 'edit_posts'. "Setting" menu item is added to the same 'Sermons' menu with 'manage_options' capability.

    // Add menu page
    function wpfc_add_options_page() {
    	$page = add_submenu_page('edit.php?post_type=wpfc_sermon', __('Sermon Manager Settings', 'sermon-manager'), __('Settings', 'sermon-manager'), 'manage_options', __FILE__, 'wpfc_sermon_options_render_form');
    	add_action( 'admin_print_styles-' . $page, 'wpfc_sermon_admin_styles' );

    If you change 'manage_options' to the custom created role, you still can not open 'Settings' page, as plugin calls it via 'edit.php' which requires that user has 'edit_posts' capability.
    Thus it is necessary to fully rewrite this part of plugin to divide work with Sermons posts and Settings page.

  6. Trishah
    Posted 2 years ago #

    Ah... than that makes sense why I was having problems trying to get it to work. I appreciate you taking the time to explain this to me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Role Editor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic