Add “Post Options” for new wordpress post
You must use add_meta_box function. Take a look to this tutorials: Using add_meta_box() Tutorial: Creating Custom Write Panels in WordPress Example How To Add Meta Boxes To Edit Area
You must use add_meta_box function. Take a look to this tutorials: Using add_meta_box() Tutorial: Creating Custom Write Panels in WordPress Example How To Add Meta Boxes To Edit Area
I finally found a way to add more lines to the Sites > Infos table : It’s a little bit ugly, but it works. I simply use the action admin_footer to add a bunch of HTML code at the end of the page, and then use jQuery to move it to the right place. add_action(‘admin_footer’, … Read more
There’s a bug(ish) report regarding this here: http://make.wordpress.org/themes/2011/07/01/wordpress-3-2-fixing-the-edit_theme_optionsmanage_options-bug/ You can use a filter to modify the theme page capability. First you’ll want to edit your register_setting() calls to look like this: register_setting( ‘map-options’, ‘map_zoom’ ); register_setting( ‘map-options’, ‘map_longitude’ ); register_setting( ‘map-options’, ‘map_latitude’ ); The first parameter is the settings group and this is what we’re … Read more
You can use PHP’s stripslashes() command: <?php echo stripslashes( get_option( ‘myOption’ ) );
There isn’t anything clever that I can see. I’ve used two approaches in the past: 1 – Your plugin’s activation code could save all your default options, so that you never need to use the second parameter to get_option Really, this equates to your… default value for setting that have not yet been saved. 2 … Read more
I had the same issue as you did, but I found how to fix it in this tutorial: https://digwp.com/2016/05/wordpress-admin-notices/ Basically, I had my settings page outside of the Settings menu, so I had to explicitly add settings_errors() to my options page and they started working. 🙂 Hope that helps.
There exists a special function to check if the site icon is set, namely the has_site_icon() function. So you could try: add_action( ‘wp_head’, ‘wpse_default_site_icon’, 99 ); add_action( ‘login_head’, ‘wpse_default_site_icon’, 99 ); function wpse_default_site_icon() { if( ! has_site_icon() && ! is_customize_preview() ) { // your default icons here } } The case when the site icon … Read more
Looking at the sources (core files, wp-includes/option.php) you can always find your target hook tags: add_action(‘added_option’, ‘wpse230212_callback_add’, 10, 2); add_action(‘updated_option’, ‘wpse230212_callback_update’, 10, 3); function wpse230212_callback_add( $option_name, $option_value ) { // do stuff on add_option } function wpse230212_callback_update( $option_name, $old_value, $option_value ) { // do stuff on update_option } Hope that helps.
Yep, this does seem like a cron issue. Core Control plugin is good to diagnose cron tasks (among other things). I am still unsure what is the reason of you getting overrun with feed transients. However I had written some code that might help with automatic cleanup.
The best hook I can find is wpmu_new_blog (line 1086, wp-includes/ms-functions.php, wpmu_create_blog()) – it passes 6 arguments like so; do_action( ‘wpmu_new_blog’, $blog_id, $user_id, $domain, $path, $site_id, $meta ); $meta is an array of initial site options, not to be confused with the options generated by populate_options(). Programatically creating nav menus may prove to be a … Read more