Support » Plugin: Jetpack by » removing post_submitbox_misc_actions action

  • Resolved Kirk Wight



    I need to remove the Publicize section from the Publish meta box on the Post Edit page. It appears its being added by hooking on to post_submitbox_misc_actions; but it’s being done with an array and object by reference, and I just can’t figure out what the magic is to remove it by remove_action, eg. remove_action( 'post_submitbox_misc_actions', $publicize_ui->post_page_metabox );

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor designsimply



    So you want to keep Publicize on but disable the per post settings for it? Just out of curiosity, why would you want to do that? I seems like an important part of how Publicize works to me.

    I’m trying to remove Publicize from the submit box only for one custom role, while keeping it for regular users.

    We have members of our organization that are allowed to edit their own five locked-down posts (that make up a detailed profile). THe whole Publicize thing is just causing confusion, and since we’re not supporting it with our members in any way, I just want to remove it (preferably through post_submitbox_misc_actions).

    Any ideas?

    Plugin Author Beau Lebens



    Adding the following into my theme’s functions.php seems to do the trick (since Publicize actually creates a global that you can use to reference UI elements):

    add_action( 'admin_head-post-new.php', function() {
            global $publicize_ui;
            remove_action( 'post_submitbox_misc_actions', array( $publicize_ui, 'post_page_metabox' ) );
    } );

    Note this is using an enclosure, but you can do the same creating a separate function.

    Weird; I was sure I tried that combination with globalizing $publicize_ui, but apparently not 🙂

    I just hooked off of admin_head-post.php instead so that it kicks in for the edit page, and I’m good. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘removing post_submitbox_misc_actions action’ is closed to new replies.