Problem with checkbox in Settings API

I managed to figure this out. It was because on the template page where I output the form I had forgotten to include the settings_fields function, so it was not saving the setting. I added the following code below to that page and then it worked: <?php settings_fields(‘prev-next-setting’); ?>

how to compare update_option() after it saves to database?

Looking at the full code in the updated question, it seems that you’re just checking if the option has been changed; so for that purpose, you could simply do so, where <option name> is the option name like my_option: add_action( ‘update_option_<option name>’, function(){ // you shouldn’t echo, but this is just for testing echo ‘option … Read more

Move website from root to sub

If anyone is struggling to do such a thing, here’s a simple way ; Using the WP Dashboard, make a new page “subdir” and set is as whatever you want (for me it was a blank-page for my “under construction” page”. Then go to your theme settings and set this freshly made webpage as the … Read more

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