Detect, if post is saved manually or programmatically in save_post-hook
Detect, if post is saved manually or programmatically in save_post-hook
Detect, if post is saved manually or programmatically in save_post-hook
Use save_post to generate file on wordpress
First of: Your custom title suffix getting duplicated might not be what you want to happen, but is expected behavior as per your code sample. The save_post action hook runs everytime a post (or page) is created or updated. Hence your callback runs everytime. Let me offer two solutions: 1 Use the wp_insert_post action instead … Read more
In wordpress root directory,open file wp-config.php,and find this code: define(‘WP_DEBUG’, true); and just set the value to false somehow like this: define(‘WP_DEBUG’, false); so that all errors will display,hope this can be helpful to u! and also the best way is to resintall wordpress if it’s convient to u
You will need to interrupt the post submission process much sooner. Your code hooked to admin_init stands a pretty good chance of working, with a modification or two, and wp_die is pretty harsh. I’d just redirect back to the originating page without saving, if it were me. Something like (untested)… function check_post_limit() { if (!isset($_POST[‘ID’])) … Read more
Add the following right at the top of your function code, it will exit the function if it’s doing an auto save: if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; You may find you also need to use the following aswell: if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) return;
Meta data not saved on save_post
If you are running mod_security or anything like that would be first thing to check. Security modules are server are known to react badly to WP’s POST requests. That is consistent with circumstances you describe (post saves, Ajax).
I think you inject some code to display your custom button. You can try to add the save post action in your code: do_action(‘save_post’); And then add redirect code, be carefull with the Infinite loop.
So yes, the problem is not with the saving, it’s how you load the saved data back… See the documentation for get_post_meta: if you dont’ provide a meta data key, the function returns all meta data for that post – which has to be returned as an array. Try this instead: $littlereds_storedMeta = get_post_meta($post->ID, ‘catagory’, … Read more