Custom Fields
Re-Envisioned
Support MB Frontend Submission How can I configure the WYSYGYG editor options in MB Frontend Submission?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #30525
    Fede
    Participant

    I can't edit the text above (there were mixed references). This is the other code I have tried:

    https://pastebin.com/F4QWtfWm

    #30534
    Fede
    Participant

    This is the code I am using and it does not work to customize the editor for the fake content field:

    public function ks_editor_trabajo_realizado($meta_boxes)
        {
            $post_id = filter_input(INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT);
            $post_content = get_post_field('post_content', $post_id);
    
            $meta_boxes[] = [
                'title'      => 'Descripción del trabajo',
                'post_types' => 'trabajo-realizado',
                'fields'     => [
                    [
                        'type' => 'wysiwyg',
                        'id'   => 'content',
                        'name' => 'Descripción',
                        'std'  => $post_content,
                        'save_field' => false,
                        'options' => [
                            'textarea_rows'   => 3,
                            'media_buttons'    => false,
                            'teeny' => false,
                            'quicktags' => false,
                            'tinymce' => [
                                'media_buttons'    => false,
                            ]
                        ]
                    ],
                ],
            ];
    
            return $meta_boxes;
        }

    Any help please?

    #30546
    Long Nguyen
    Moderator

    Hi,

    FYI, the settings under tinymce are applied to the Visual tab. The settings under quicktags are applied to the Text or HTML tab.

    'fields'     => [
        [
            'type' => 'wysiwyg',
            'id'   => 'content123',
            'name' => 'Descripción',
            'save_field' => false,
            'options' => [
                'textarea_rows'   => 3,
                'media_buttons'    => false,
                'teeny' => false,
                'quicktags' => [
                    'buttons' => 'strong,em,u,link,ul,ol,li',
                ],
                'tinymce' => [
                    'toolbar1' => 'bold,italic',
                ]
            ]
        ],
    ],

    See my screenshots
    https://share.getcloudapp.com/Wnu0kybY
    https://share.getcloudapp.com/Qwu52L0G

    Read more on the documentation
    https://codex.wordpress.org/TinyMCE
    https://codex.wordpress.org/Quicktags_API

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.