Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Removing “Restrict This Content” Meta Box in Restrict Content Pro

Posted on March 8, 2012 by Pippin in Action and Filter Hooks, Intermediate, Quick Tips, Tutorials, WordPress Admin / Dashboard 1 Comment
Home» Tutorials » Action and Filter Hooks » Removing “Restrict This Content” Meta Box in Restrict Content Pro
Tweet
Love It - 0
This entry is part 3 of 8 in the Customizing Restrict Content Pro Series
← Add Custom User Meta Fields to Restrict Content Pro RegistrationRestrict Content Pro – Campaign Monitor →
  • Mail Chimp for Restrict Content Pro
  • Add Custom User Meta Fields to Restrict Content Pro Registration
  • Removing “Restrict This Content” Meta Box in Restrict Content Pro
  • Restrict Content Pro – Campaign Monitor
  • Restrict Content Pro – Graphs
  • Restrict Content Pro – Stripe Payment Gateway
  • Hide wp-login.php with Restrict Content Pro
  • Add a Agree to Our Terms of Use Field to Restrict Content Pro

When using Restrict Content Pro, the “Restrict this Content” meta box is automatically loaded on all registered post types, but sometimes you want to remove it from certain post types. The plugin includes a simple filter that you can use to specify which post types the meta box should not be added displayed on.

For example, to remove the meta box from the “books” post type, use this:

1
2
3
4
5
6
7
8
function pippin_exclude_post_types_from_rcp($post_types) {
 
	// we do NOT want the meta box displayed on the "books" post type
	$post_types[] = 'books';
 
	return $post_types;
}
add_filter('rcp_metabox_excluded_post_types', 'pippin_exclude_post_types_from_rcp');

An array of post types is passed to the filter with the $post_types variable. All we need to do is add the name of our post type to the array, and then return the modified array.

You can set as many post types as you want to be excluded. To remove the meta box from both “books” and “page”, use this:

1
2
3
4
5
6
7
8
9
function pippin_exclude_post_types_from_rcp($post_types) {
 
	// we do NOT want the meta box displayed on the "books" or "pages" post type
	$post_types[] = 'books';
	$post_types[] = 'page';
 
	return $post_types;
}
add_filter('rcp_metabox_excluded_post_types', 'pippin_exclude_post_types_from_rcp');

It’s that simple.


Related Items
  • Restrict Content Pro – Premium Content Plugin
Tweet Follow @pippinsplugins
add_filter, meta box, restrict content pro

One comment on “Removing “Restrict This Content” Meta Box in Restrict Content Pro”

  1. Will says:
    November 26, 2012 at 10:36 pm

    Thanks. Easy peasy. Nice level of control to have.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

  • Restrict Content Pro – Member Discounts for Easy Digital Downloads
  • Restrict Content Pro – bbPress Extension
  • Restrict Content Pro – Wysija Add On
  • Restrict Content Pro – CSV User Import
  • WP Push Releases Restrict Content Pro Extension

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes

Latest Tutorials

  • Storing Session Data in WordPress without $_SESSION (19)

    The term Session in web development refers to...

  • Test Your Plugins with RTL (1)

    Right-To-Left languages are those that...

  • Submitting Your First Pull Request to a WordPress Plugin on Github (5)

    Github is an extremely popular tool for managing WordPress plugins, and one...

Enter your email to receive automated updates when new posts are published

WP Core Contributions

  • [24316]

View the ticket on Trac.

WP Codex Contributions

  • Function: shortcode exists
  • Function: has shortcode
  • Function: shortcode exists
  • Function: shortcode exists
  • Function: has shortcode

View all 41 changes in the Codex.

Latest Tweets

  • Could not fetch Twitter RSS feed.

Topics

contextual help featured register_setting shortcodes attachments add_options_page Tom McFarlin get_user_meta hook add_shortcode meta box Sugar Event Calendar wp_enqueue_script forms short codes plugin do_action login Related posts authors mail chimp attachment image recent posts post types apply_filters comments short code bbpress taxonomies custom post type Ajax gallery images Stripe taxonomy jquery widgets users add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2013 Pippin's Plugins