Support » Plugin: Co-Authors Plus » [Plugin: Co-Authors Plus] Restrict to certain content types

  • Resolved HarroH

    (@harroh)


    Hi Guys,

    First of all, awesome plugin. Been using it a lot in websites. However, I’m going to use it for another website now that requires some modifications.

    What I’m looking for it to restrict the plugin to only show at certain content types. I now see the box in every content type, but I want to restrict it to one or two custom content types I already have. Is there an easy way to do this or to give me some direction on where to start?

    Thanks in advance.

    http://wordpress.org/extend/plugins/co-authors-plus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Hand Built

    There’s not an easy way to do this right now, unfortunately 🙁 I’ve filed an issue to make it easier.

    Until then, you can probably use something like this:

    add_action( 'add_meta_boxes', 'capx_remove_metabox_for_post_type', 5 );
    function capx_remove_metabox_for_post_type() {
    	global $coauthors_plus;
    	if ( in_array( get_post_type(), array( 'page' ) ) ) {
    		remove_action( 'add_meta_boxes', array( $coauthors_plus, 'add_coauthors_box' ) );
    		remove_action( 'add_meta_boxes', array( $coauthors_plus, 'remove_authors_box' ) );
    	}
    }

    I haven’t tested it fully though.

    Hi Daniel,

    It would be very nice if the check would be before actually adding the box, so hopefully next version perhaps ;).

    But this did the trick for now, thanks! Keep up the good work.

    Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Co-Authors Plus] Restrict to certain content types’ is closed to new replies.