Custom metabox not displaying multiselect data in edit mode

I tested your code and this ended up working for me: case ‘multiselect’: echo ‘<select name=”‘.$field[‘id’].'” id=”‘.$field[‘id’].'”>’; foreach ($field[‘options’] as $option) { echo ‘<option’, $meta == $option[‘value’] ? ‘ selected=”selected”‘ : ”, ‘ value=”‘.$option[‘value’].'”>’.$option[‘label’].'</option>’; } echo ‘</select><br /><span class=”description”>’.$field[‘desc’].'</span>’; break; For the Field Array I just added another option with a blank value and a … Read more

Why does not my metabox save?

I notice a couple of things. First, your callback uses two parameters but you don’t ask for the second parameter when you hook it in. This: add_action( ‘save_post’, ‘kasparibi_left_menu_meta_save’ ); Should be: add_action( ‘save_post’, ‘kasparibi_left_menu_meta_save’ ,1 ,2 ); But, on the other hand, I don’t see where you use that parameter at all. Maybe I … Read more

Can’t Get Metabox Data Saved Assistance Needed

The save_post hook is the only one you need, also, your callback function is missing a parameter, check this example: /** * Save post metadata when a post is saved. * * @param int $post_id The ID of the post. */ function save_book_meta( $post_id ) { /* * In production code, $slug should be set … Read more

Cant’t delete my custom posts

Of course your custom posts can’t be trashed. They can’t even get set to private or draft or anything else then publish because your callback change_content() always sets the post status to publish every time a post (of your custom post type) gets saved. However trashing a post just means setting its status to trash. … Read more

Using PODS data with save_post

Yes, whenever a post is saved you should see all of the input items in $_POST … if you’re not using something like xdebug to debug with, you could do something like: echo “<pre>”; var_dump( $_POST ); echo “</pre>”; To test and see what is all included in $_POST … note this is just for … Read more

Reset all transients on post or page save

The technical side of it depends on the storage used. For default database storage the transient entries can be queried and deleted, since they have specific naming format. For enabled Object Cache storage cache can be flushed, which will get got cache and transient. The practical side of it — this is Bad Idea. Transients … Read more

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