How to display status messages in admin panel
How to display status messages in admin panel
How to display status messages in admin panel
I needed something like array($this, ‘field_callback’) instead of just the string ‘field_callback’ inside the add_settings_xxx functions. I am still seeking an explanation for this solution if you can enlighten me. Why does this work?
Why Settings API Options Override Customizer Settings?
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
Options saved and called in wrong order
You are misspelling the variables names. You define them as $new_value and $old_value with underscore that you forgot about. Except this your code working fine. function myplugin_update_field_foo( $new_value, $old_value ) { if ($new_value !== $old_value && is_array($old_value) && is_array($new_value)) { $new_value = array_unique( array_merge( $new_value, $old_value ) ); } return $new_value; } To get the … Read more
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’); ?>
Real quick this should point you in the right direction, you need to define your colorpicker and then reference it, so like: switch( $arguments[‘type’] ){ case ‘text’: case ‘password’: case ‘number’: printf( ‘<input name=”%1$s” id=”%1$s” type=”%2$s” placeholder=”%3$s” value=”%4$s” />’, $arguments[‘uid’], $arguments[‘type’], $arguments[‘placeholder’], $value ); break; case ‘colorpicker’: printf( ‘<input name=”%1$s” id=”%1$s” type=”%2$s” placeholder=”%3$s” value=”%4$s” />’, … Read more
If you right-click and Inspect Element you will see it is supposed to be inside an SVG file on your website, but if you open the SVG file the “smart-living” and “smart-workspace” parts are missing. Normally this type of file is either inside of a theme or a plugin but whoever set it up placed … Read more
Use a shortcode with parameters function oosdfw_title_display($atts) { $a = shortcode_atts( array( ‘before’ => ‘Sorry, ‘, ‘after’ => ‘ has sold out.’, ), $atts ); return $a[‘before’].get_the_title().$a[‘after’]; } add_shortcode( ‘oosd-title’, ‘oosdfw_title_display’ ); Put shortcode in text field and modify before and after parameters to suit your requirements. [oosd-title before=”Sorry ” after = ” has sold … Read more