Support

Account

Home Forums ACF PRO Is it possible to add an ACF field to an existing metabox Reply To: Is it possible to add an ACF field to an existing metabox

  • Is this possible today (Feb 2020)?

    This below code adds markup inside “submitdiv”. The div that holds Status, Visibility, Published on and Publish/Update button. I would like to add an ACF Checkbox field under those settings. Is this possible with some function, action or filter combination?

    add_action( 'post_submitbox_misc_actions', 'wpse_45720_submitdiv_extra' );
    //add_action( 'post_submitbox_start', 'wpse_45720_submitdiv_extra' );
    
    function wpse_45720_submitdiv_extra()
    {
        //print '<pre>' . current_filter() . '</pre>';
        echo '<div class="misc-pub-section misc-something" id="something">';
        echo '<p>Headline</p>';
        //ACF CHECKBOX FIELD HERE
        echo '<p>Some note under the ACF</p>';
        echo '</div>';
    }
    //reference: https://wordpress.stackexchange.com/a/45722

    If it’s not possbile then perhaps just show the checked selections (with get_field) and inform the user that in order to change the selections scroll to the field group titled “Your checkboxes”.