0
votes
1answer
60 views

Wp_update_post: Infinite loop even with remove_action solution, OOP

I have a quite complex PHP class, reponsible for creating and printing meta_boxes, generating and saving meta fields, ... Each meta_box (object of class) has its own save function, that updates meta ...
0
votes
2answers
63 views

what is correct way to hook when update post

i try to hook when post is updated but all hook i try never executed except updated_post_meta add_action('updated_post_meta', 'my_function'); function my_function($post_id) { echo 'This is ...
3
votes
1answer
61 views

Disallow a user to post in certain categories

I am writing a plugin that will disallow user to post in certain categories. I am trying to display an error message to the user when he tries to post in the restricted category and also want WP ...
1
vote
1answer
331 views

“save_post” hook not triggered in WP 3.6.1

I developed a plugin having a custom metabox that is using the "save_post" hook to store data. The plugin is old 18 months and is used by thousands of customers, so I'm pretty sure everything is good. ...
0
votes
1answer
263 views

Catch and display error on save_post action

I wrote this function that adds data to an external db every time a custom post called 'event' is created. How can I prevent the save from happening if this function returns an error? At the moment, ...
2
votes
2answers
133 views

Placement of Code in Plugin for hooking `save_post`

I ran into a strange Problem today developing a new Plugin. I set it up as usual, creating the f711-roomprice folder in the Plugindirectory, and creating the f711-roomprice.php as well as an inc ...
1
vote
1answer
209 views

Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post ...
2
votes
2answers
131 views

How to check what kind of saving it is?

I use save_post hook, and I have to know inside this hook function, whether it is a publishing ( draft to publish ) or is it an updating, like publish to publish or draft to draft. Is there a way to ...
0
votes
2answers
497 views

'save_post' hook not working in WP 3.5

I used to have an extra option added to the 'Edit Media' screen (using the attachment_fields_to_edit hook, and then saving with attachment_fields_to_save). However, I've updated to 3.5 today, and the ...
0
votes
1answer
106 views

Bug: Post needs to be updated twice when adding action for save_post hook

My function does exactly what I want it to do: I'm trying to add/update meta fields in another post type when an "events" post is saved. Except the post needs to be updated twice for the information ...
2
votes
1answer
1k views

Check before publishing, if already exist post with current custom field value

I have a custom post type with only 3 custom fields in it. $post_types = get_post_meta($post->ID,'post_types',true); $post_taxonomies = get_post_meta($post->ID,'post_taxonomies',true); ...