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

save_post hook is not called when post is saved

A quick way of debugging the save function before redirection – is to die(print_r($post_id)); // or var_dump($post_id); this will stop all PHP from continuing and is fast for small debugging where you don’t need an entire log. throw that into your function, and see what happens in it – change the variable to see if … Read more

Custom Post Type Metadata Not Saving

The primary issue is your save_post action isn’t firing because: add_action( ‘save_post’. ‘save_meta’, 10, 2 ); should be add_action( ‘save_post’, ‘save_meta’, 10, 2 ); You also have inconsistency between client-name and _client_name, but without seeing the field_value function, I’m not sure if that’s a problem or not. I would also use something more unique than … Read more