WP Page Options Array

After much experimentation I resolved my own question and this answer might help somebody. function mmm_select_field( ) { $options = get_option( ‘mmm_settings’ ); $buttons = array( ‘Bold’ => ‘bold’, ‘Italic’ => ‘italic’, ‘Underline’ => ‘underline’, ‘Superscript’ => ‘superscript’, ‘Align Left’ => ‘alignleft’, ‘Align Center’ => ‘aligncenter’, ‘Align Right’ => ‘alignright’, ‘Bullet List’ => ‘bulletlist’, ‘Number … Read more

custom wp_editor does not save the content in plugin settings

Might be possible that your wp_editor is broken! According to codex you can not use numeric editor ID may only contain lowercase letters and underscores…hyphens will cause editor to not display properly Call wp_editor in this way wp_editor( $nga_textarea_field_1_invalid, ‘nga_textarea_field_one’ ); textarea_name is not required because by default it is already wp_editor ID. I am … Read more

General Settings: display custom plugin field after Site Address field

Figured it out by using the following jQuery function. The #protocol_relative is the field I am inserting and #home-description is the field I am inserting it after: add_action( ‘admin_footer’, ‘insert_field’ ); function insert_field() { # Insert the settings field after the ‘Site Address (URL)’ ?> <script type=”text/javascript”> jQuery( ‘#protocol_relative’ ).closest( ‘tr’ ).insertAfter( jQuery( ‘#home-description’ ).closest( … Read more

Using WP Color Picker in Repeatable Fields

It’s hard to know for sure, since you don’t include the markup you’re output for the metabox nor the JS you’re using to clone. But, the following simplified setup seems to work for me: metabox markup <label for=”my_field”> My Color Picker Field </label> <input name=”my_field” id=’my_field’ type=”text” class=”my-colorpicker” /> <a href=”#” class=”clone-it”>Add Another Color Picker</a> … Read more

How to save plugin custom settings page fields

Something was wrong with the naming, I had to change the field names, and it works ok. From your code sample, this: add_settings_field( ‘frontend-font’, // id attribute of tag __(‘بارگذاری فونت برای بخش اصلی سایت’, ‘persianfont’), // Title as lable for field function(){ var_dump(get_option( ‘persianfont’ )); //$check_frontend_font = is_null(get_option( ‘persianfont’ )[‘frontend-font’]) ? ‘true’ : get_option( … Read more

Update WP option by plugin

That option is special in that WordPress has code to intercept your call for security reasons: https://codex.wordpress.org/Function_Reference/update_option_new_admin_email This function intercepts changes to the administrator’s email address. It keeps the address from being updated and instead sends the user a confirmation email, with a link to confirm the change. What you’re trying to do could be … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)