Custom Fields
Re-Envisioned
Support MB Settings Page Reset default values

This topic contains 5 replies, has 3 voices, and was last updated by  Ale 4 months, 1 week ago.

  • Creator
    Topic
  • #12545
    Resolved
    Ale
    Participant

    I’m wondering whether is possible to reset any field that has been changed to its default value.

    So what I’m looking for is a way to reset the field “text-with-default” to it’s default value: The default text.

    $meta_boxes[] = array(
    
        'id' => 'some_meta',
        'title' => 'Some meta',
        'settings_pages' => 'the-page',
            'fields' => array(
            array(
                'name'    => 'Something',
                'id'    => "something",
                'type'  => 'text',
                'std' => 'The default text.'
            )
        )
    )

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #12548

    Farheen
    Moderator

    Hello Ale,

    I am unable to understand your problem. Can you please clarify a bit more.

    Thanks.

    #12549

    Ale
    Participant

    Hello Farheen,

    Sure no problem. A text field can be set with a default value using:

    'std' => 'The default text.'

    If I actually change the text field with anything other, I have no way to go back to the original default value, is there a way to add a button that resets the original default value?

    Thanks.

    #13345

    Ale
    Participant

    Any new reply on this? Thanks.

    #13358

    Anh Tran
    Keymaster

    Hi Ale, currently there’s no way to reset to default value 🙁 I guess this can be done via custom attribute (to store the default value) and some JS.

    #13361

    Ale
    Participant

    Thanks Anh for your reply, I will try what you suggest.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.