Custom Fields
Re-Envisioned
Support General Can I create shortcode?

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 year, 10 months ago.

  • Creator
    Topic
  • #7843

    nfyp145
    Participant

    Hi

    Is it possible to create reusable shortcodes with Meta Box plugin?

    For Ex: – I create “button” meta box for post.

    
                /* Button
                ---------------------------------------- */
    
                array(
                    'id'     => 'button',
                    'tab'    => 'button',
                    'type'   => 'group',
                    'fields' => array(
                        array(
                            'id'   => 'icon',
                            'name' => 'Icon',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'label',
                            'name' => 'Label',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'position',
                            'name' => 'Position',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'target',
                            'name' => 'Target',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'url',
                            'name' => 'URL',
                            'type' => 'url',
                        ),
                    ),
                ),
    

    And I want to reuse that “button” meta box more than one time with different values on particular post. As a shortcode.

    Can it be achieved with Meta Box?

    Thanks always and looking forward.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #7878

    Anh Tran
    Keymaster

    Hi,

    Please correct me if I’m wrong. I understand that you want to use Meta Box like a shortcode generator, so when users click on a “trigger button”, it shows a form to enter those info for a button. Then clicking on “Insert” button will inserts a shortcode to the post content?

    If that’s correct, then I’m afraid to say it’s not supported at the moment. The purpose of the shortcode is presenting the data, while the purpose of Meta Box is saving the data. Although they might share the same form, but the goals are different.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.