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

Problem with display data from get_option

You inserting the value of the get_option(‘go_to_top_or_bottom’);as a property in the $this->options so when you actual try to print it like this print_r($this->options[‘turn_on’]);you get the index error because this is a property!!! Correct way will be $this->options[‘turn_on’]=get_option(‘go_to_top_or_bottom’); Update I see that the $options is a private meaning you cannot access it outside of the class. … Read more

Custom Plugin Options Won’t Update

Did you confirm it was the transient values causing the options to not update? Here’s the WordPress function to clear transient values: https://codex.wordpress.org/Function_Reference/delete_transient An example: <?php // Create a simple function to delete our transient function edit_term_delete_transient() { delete_transient( ‘the_transient_name_to_delete’ ); } // Add the function to the edit_term hook so it runs when categories/tags … Read more

how to save wp_editor html content in options table

echo ‘<form action=”” class=”booked-settings-form” method=”post”>’; $default_content=”<p>Mail formate</p>”; $editor_id = ‘customerCleanerMail’; $option_name=”customerCleanerMail”; $default_content=html_entity_decode($default_content); $default_content=stripslashes($default_content); wp_editor( $default_content, $editor_id,array(‘textarea_name’ => $option_name,’media_buttons’ => false,’editor_height’ => 350,’teeny’ => true) ); submit_button(‘Save’, ‘primary’); echo ‘</form>’; if(isset($_POST[‘customerCleanerMail’]) ){ $var2=htmlentities(wpautop($_POST[‘customerCleanerMail’])); $fff=update_option(‘customerCleanerMail’, $var2); } In form section i used wp_editor with his options, wp_editor work like html editor but when you store these data … Read more

not getting API setting saved confirmation message after update on option page

You need the settings_errors(); function somewhere on your settings page: function display_acme_options_page() { settings_errors(); echo ‘<h2>Acme Options</h2>’; echo ‘<form method=”post” action=”options.php”>’; do_settings_sections( ‘acme-options-page’ ); settings_fields( ‘acme-settings’ ); submit_button(); echo ‘</form>’; }

Function to incorporate an option in each Page

It sounds like you need custom meta boxes. You could either create your own plugin to add them or use a plugin like Advanced Custom Fields. You would add two meta boxes to each post type where you want to be able to select these options, one to select the image, and another to set … Read more

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