Plugin setting page – update_option problem

Your chunk of code if (isset($_POST[‘submit’])) { would process all the form submissions (even other forms which is not your settings page) which is why you are lossing your data. Even though this is not good way to create option page. But If you do something like if(is_admin() && isset($_POST[‘submit’]) && isset($_POST[‘ffita_gads_capub’])){…. could solve your … Read more

WP options plugin setting not saving the selected checkboxes

Your code just outputs empty checkboxes. You have to check each box’s value and then set checked=”checked” if it’s true. <td><input type=”checkbox” placeholder=”Meta Key” name=”map_option_3″ <?php // check whether map_option_3 was saved if(isset(get_option(‘map_option_3’))) { ?>checked=”checked”<?php } ?> />Name<br> <input type=”checkbox” id=”cb_name” name=”map_option_4″ <?php // check whether map_option_4 was saved if(isset(get_option(‘map_option_4’))) { ?>checked=”checked”<?php } ?> />Price<br><input … Read more

How to add the option to choose between sizes for featured image within post editor?

<?php // First, enable thumbnails if they are not enabled yet add_theme_support( ‘post-thumbnails’ ); /* * Add image dimensions * * name * width * height * crop or resize (true or false) * * 99999 means very big number */ add_image_size( ‘featured-portrait’ , 200 , 99999, false ); add_image_size( ‘featured-landscape’ , 99999, 200 , … Read more

How to update option field in database on clicking the publish button in customizer

When ‘publish’ is clicked in customizer, the option ‘theme_mods_THEMENAMED’ is updated. An function/action could be added See https://developer.wordpress.org/reference/functions/add_action/ on the wordpress actions add_option_(option_name) and update_option_(option_name) See https://codex.wordpress.org/Plugin_API/Action_Reference#Administrative_Actions. The new function could then save what ever option you want to update.

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