Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

nellone on "[Plugin: Page Links To] Remove Meta Box for Author user roles"

$
0
0

I'm trying to remove the plugin metabox for author user roles from edit.php page... i can do it for all other metaboxes but page-links-to.

this is the code

if ( current_user_can('author') )
{

	function my_remove_meta_boxes()
	{
		remove_meta_box('postexcerpt', 'post', 'normal');
		remove_meta_box('trackbacksdiv', 'post', 'normal');
		remove_meta_box('postcustom', 'post', 'normal');
		remove_meta_box('revisionsdiv', 'post', 'normal');
		remove_meta_box('commentstatusdiv', 'post', 'normal');
		remove_meta_box('commentsdiv', 'post', 'normal');
		remove_meta_box('slugdiv', 'post', 'normal');
		remove_meta_box('tagsdiv-post_tag', 'post', 'side');
		remove_meta_box('categorydiv', 'post', 'side');
		remove_meta_box('postimagediv', 'post', 'side');

		remove_meta_box('page-links-to', 'post', 'normal');

	}
	add_action( 'do_meta_boxes', 'my_remove_meta_boxes' );

in plugin's source code i found this:

function do_meta_boxes( $page, $context ) {
		// Plugins that use custom post types can use this filter to hide the PLT UI in their post type.
		$plt_post_types = apply_filters( 'page-links-to-post-types', array_keys( get_post_types( array('show_ui' => true ) ) ) );

		if ( in_array( $page, $plt_post_types ) && 'advanced' === $context )
			add_meta_box( 'page-links-to', 'Page Links To', array( $this, 'meta_box' ), $page, 'advanced', 'low' );
	}

but i cannot anyway to detect a working hook to remove the metabox.

thanks for help!

http://wordpress.org/extend/plugins/page-links-to/


Viewing all articles
Browse latest Browse all 26892

Trending Articles