get_option() does unserialize and don’t remove \

The get_option function is necessary for you using maybe_unserialize. update_option() function maybe_serialize passed. // store data time use maybe_unserialize. $data = maybe_serialize( $data ); // get/display time user maybe_unserialize $data = maybe_unserialize( $data ); Please check it with above example code

Unable to delete option

You’re almost there… If you send the request to admin-post.php, then only your callback will print the response. And since your callback doesn’t print anything, then you’re getting blank screen. Most of the time what you want to do is to perform a redirect inside such callback: public function kh_update_media_seo() { delete_option(‘myoption’); wp_redirect( admin_url(‘admin.php?page=mycustomoptionspage’) ); … Read more

update_option returns false in AJAX, how to debug?

I found out that my settings where filtered by validation function registered by register_setting. Somehow I thought that it would only affect settings that where going through wordpress’s own settings fields and not a custom AJAX function (the way I have it setup). To the point of the question: I used php exit to debug … Read more

redirect to https://my-site/wp-admin/ instead of https://my-site/wordpress/wp-admin/ after options updating

The solution was : not use the index.php to include the folder /wordpress/ not use wordpress/.htaccess use only .htaccess to point to subfolder <IfModule mod_rewrite.c> RewriteEngine On #https RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} ^(www.)?my-site.com$ #point to subfolder RewriteCond %{REQUEST_URI} !^/wordpress/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /wordpress/$1 RewriteCond %{HTTP_HOST} … Read more

Plugins Settings page not updating

I don’t know why this happened, but it seems that register_setting shouldn’t be in the callback of add_settings_field // no actual code // this worked add_settings_field(‘id’,’title’, /*callback*/ function($arguments) {echo $htmlcode;}), ‘page’, ‘section’); register_setting(‘option_group’, ‘option_name’); I hope this helps

How to set different color in a select box due to selection with css

You can achieve this by adding an onchange event to your select tag. Try the code below: HTML: <select id=”derselect” onchange=”this.className=this.options[this.selectedIndex].className” class=”green”>   <option class=”green”>Test 1   <option class=”red”>Test 2 </select> And your CSS: .green { color:green} .red {color:red} 🙂

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