Support

Account

Forum Replies Created

  • Thank you John,

    I have simplified my code to the one below. However, upon form submit the WordPress site crashes. Is there anything wrong with this code?

    <?php
        acf_form_head();
        get_header();
    ?>
    
    <div id="content">
        <div class="wrap">
            <form id='post' class='acf-form' action='' method='post'>
    
                <?php
                    $field_groups = array('group_596925d98777d');
                    acf_form([
                        'field_groups'  => $field_groups,
                        'post_id'       => 'new_post',
                        'new_post'      => array(
                            'post_category' => 'academy',
                            'post_status'   => 'draft',
                            'post_title'    => $post_id,
                         ),                  
                        'post_content'  => false,
                        'form'          => false,
                        'submit_value'  => __("Submit post", 'acf'),
                        'updated_message' => __("Thank you!", 'acf'),
                        'html_updated_message' => '<div id="message" class="updated" style="display:block;"><p>%s</p></div>'
                    ]);
                ?>
    
            </form>
    
        </div>
    </div>
    
    <?php get_footer();
  • I’ve tried the code below. But this just returns the Full toolbar without the desired extra dropdown menu.

    add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars'  );
    
    function my_toolbars( $toolbars ) {
    	$style_formats = array(  
    		array(
    			'title' => 'My style',
    			'block' => 'span',
    			'classes' => 'mystyle',
    			'wrapper' => true,
    		),
    	);
    
    	$toolbars['My toolbar'] = $toolbars['Full'];
    	$toolbars['My toolbar'][1]['styleselect'] = json_encode( $style_formats );
    
    	return $toolbars;
    }
  • Ah, I see, yeah. So it replaces the Full toolbar instead of expand it with an extra button.
    Is there also a way to create a new toolbar that equals the Full toolbar + the extra dropdown menu? Or do you have to repeat all the Full menu options for this as part of the new toolbar?

Viewing 3 posts - 1 through 3 (of 3 total)