Custom Fields
Re-Envisioned
Support MB Frontend Submission Enable Edit For admin while on Front end read only metabox

This topic contains 2 replies, has 2 voices, and was last updated by  baraanajjar@gmail.com 4 months ago.

  • Creator
    Topic
  • #13726
    Resolved
    baraanajjar@gmail.com
    Participant

    Hi Support
    i have form on front end as

    array(
                    'id' => 'your_phone',
                    'type' => 'text',
                    'required'   => true,
                    'readonly'  => true,
                    'name' => esc_html__( 'Your Phone' ),
                    'std' => $profile->user_info->user_phone_number,
                    'class' => 'col-md-6',
                    'placeholder' => esc_html__( 'Your Phone' ),
                ),

    i want this field to be edited by admin on backend while on frontend form should be readonly
    i am using frontend form plugin.
    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #13745

    Anh Tran
    Keymaster

    You can modify the readonly attribute with the value like this:

    'readonly' => ! is_admin(),

    So, on the admin, it’s true, on the front end – false.

    #13758

    Thanks for the tip. It is solved

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

You must be logged in to reply to this topic.