WordPress check if value equals and echo “checked”
WordPress check if value equals and echo “checked”
WordPress check if value equals and echo “checked”
Hooking into the Meta Boxes (Name/Web Address/Description) on the ‘Add New Link’ Page
add_post_meta not saved
After I removed all the wp_nonce fields everything is working slightly. As far as I can remember, their job is to prevent sending requests from undesireable places and some actions. I guess I can’t make a proper nonce verification.
First of all, You don’t have to add ‘form’ html tag in the metabox. You missed to pass the ‘$post’ parameter to the function ‘display_post_options’ and you used selected() function wrong too. Here is the code after I updated it. function display_post_options( $post){ wp_nonce_field( basename( __FILE__ ), ‘post_options_nonce’ ); $post_options_select_value = get_post_meta($post->ID,’post_options_select’,true); ?> Choose Your … Read more
Your values are actually being saved – you can always check it in your database. The problem is in your metabox callback function post_options_callback – it is not being called with Post.ID value as an argument, but WP Post object is being passed. Here’s revisited piece of code: function post_options_callback( $post ) { $post_id = … Read more
Add “Select” For Custom Post Type Metabox
I don’t really understand this sentence– “It must get me only all post from unit post type that in unit type post type,”– and honestly the query looks correct to me, but I would suggest trying a meta_query and specifying the type, as well as disabling sticky post juggling. If you have 6 or more … Read more
I found the answer my self, the issue had to do with a line requesting the content of the metabox (as expected). The line: ‘template’ => get_template_directory() . ‘/lib/metaboxes/custom_textbox.php’, should have been changed to: ‘template’ => get_stylesheet_directory() . ‘/lib/metaboxes/custom_textbox.php’, According (to the WordPress Codex) will get the path for the main theme. If you want … Read more
Ridiculous problem with CDATA [duplicate]