• Resolved yst14

    (@yst14)


    Hi,

    I have setup a custom field where my users can enter html and I have a list of shortcodes they can use too. I have noticed however that when using shortcodes within the custom field they are displayed as plain text rather than the shortcode output. Is there a way to make these shortcodes functional?

    Thanks ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Usually generated outputs with shortcodes are displayed in the front end. You are saying you want to display them in the field value. In that case, you can use the validation callbacks to parse the submitted form data. In the callback function, convert the shortcode into your desired output. For an example of form validation, please see here.

    Thread Starter yst14

    (@yst14)

    Hi,

    I don’t want to show the shortcode output in the field.

    Take this as an example:
    User goes to settings page
    Enters HTML in to the ACE custom field
    Also enters a shortcode ‘[test_name]’
    User saves custom field
    User look at front end of website
    HTML output is correct
    Shortcode is showing as plain text

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    So you want to display shortcode outputs in the front-end. In that case, Admin Page Framework is irrelevant. Just use the do_shortcode() WordPress built-in function.

    
    $raw_output = 'your raw output here.';
    echo do_shortcode( $raw_output );
    
    Plugin Author miunosoft

    (@miunosoft)

    Closing the topic due to inactivity.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode within ACE custom field’ is closed to new replies.