save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in $_POST, $_GET or the global $post_data, depending on how the post was edited.

learn more… | top users | synonyms

1
vote
4answers
307 views

Updating wp_options with an array on save_post results in duplicated entries

I'm not entirely sure this is Wordpress' fault, but I figure I'd ask anyway and see if anyone else has experienced any problems like this before. I'm trying to save an array to a wp_options table ...
1
vote
1answer
332 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. ...
1
vote
1answer
231 views

non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue

I registered a non-hierarchical custom taxonomy ('property_features'). There is a checkbox for every terms of this tax in a custom meta box on the edit-screen. All terms are displayed and all terms ...
0
votes
1answer
19 views

save_post action not firing when save

Below is my code that will take the post_id and randomly get 3 posts from the same category and store them as custom field. The code is clearly working, because when I click "New Post", I see the ...
0
votes
1answer
29 views

Insert/Update DB table when making new post or update older one

I was wondering how can I insert a DB row (not related to WordPress tables) only when I update or add a new post. Right now I have this... add_action( 'save_post', 'insertIntoDBatPost'); function ...
0
votes
1answer
58 views

How to save post change url youtube link?

In functions.php i using this to change width url from youtube: add_action('save_post', 'set_url_youtube'); function set_url_youtube() { $post = get_post($post_id); $content = ...
0
votes
1answer
171 views

Update Custom Field on Imported Post Creation

So I've created a function that updates several custom fields in a post when the post is created. The idea is to sanitize this information so that I can easily use it for other purposes. The ...
0
votes
1answer
283 views

save_post action inside a custom metabox class not working

I am writing a class to create metaboxes and save the form data. The problem is, I keep getting a warning when I click "publish": Warning: call_user_func_array() expects parameter 1 to be a valid ...
0
votes
1answer
93 views

Saving zero as meta value

I have a meta_key called "_ordre" and each time I create a new custom post, a new meta_value is set for that meta_key. The thing is, when I set the value of '_ordre' to 0, the meta_value is not saved ...
0
votes
1answer
146 views

Metaboxes not saving data

I'm rebuilding a metabox for a plugin and it now won't save the data I enter. The HTML is almost exactly the same as before, but the save_meta function just don't work. I've read through quite a few ...
0
votes
1answer
504 views

save_post custom post type ? $_POST not working?

i have this code. <?php add_action('add_meta_boxes', 'ct_meta_add'); add_action('save_post','ct_meta_save'); add_action('save_post','ct_parent'); // add meta functions function ct_meta_add() { ...
0
votes
1answer
529 views

Auto save title as custom meta field value

I create a custom post type where I removed the "Title", instead I want to use one of my custom meta value to become the title. This is just to make sure the title look good. Know that the post ...
0
votes
1answer
399 views

pass error to admin_notices on “quick edit”/save_post action

I currently have add_action('admin_notices','my_notice_function'); updating correctly whenever a page is refreshed (it's checking if a certain page has a certain parent) but when using the "Quick ...
0
votes
1answer
68 views

How to extend the page editor?

I'm really a newbie to WordPress. I can edit the page via admin Page menu. There is a form submitted on that page. How can I write my own functions to handle this form submission? In other words, how ...
1
vote
0answers
14 views

Upload File Metabox - Empty Files on POST

I'm creating a simple / generic upload file metabox. For some reason when I upload a file and update my post, it doesn't pull my uploaded file along with it, the $_FILES array will be completely ...
1
vote
0answers
42 views

Wordpress custom admin notice still displays after wp_insert_post_data validation

I am trying to validate post data before saving, specifically checking to see if an image exists within the first 750 characters of the post content. The code below works and display the admin notice ...
1
vote
0answers
158 views

How to notify specific users when i'm posting/modifying a new post

Here's what I'm trying to do... I'm trying to send new submissions only to contractors requested. Using Role Scoper, I can select only users who can access the new submission. However, I am looking ...
1
vote
0answers
88 views

Saving Custom Field Data before Publish

When creating a page or a post WordPress lets the content (title, body, featured image) be saved when using Ctrl + S. The Custom Fields do not save in the same way (in this case I'm using Advanced ...
1
vote
0answers
86 views

Events: Check for other event with same start date and category

I am using The Events Calendar and (correct me if I'm wrong) there is no checking to see if an event has a time conflict with another event that's already been entered. For example, if there is ...
0
votes
0answers
28 views

post_content not parsed using save_post action hook

A site I'm building for a client has to be able to download Vine's to a server when they've been posted using a shortcode ([vine id="..."]). This works fine for my local install (it's a Multisite ...
0
votes
0answers
27 views

save_post hook frustration

Clean 3.8.1, clean Twenty Fourteen theme, no plugins except for my own custom one. The main plugin PHP file only has a single "require_once('test.php')" And "test.php" in its entirety is: ...
0
votes
0answers
9 views

Disable a function from executing in post.php

I have a function that seems to execute on saving a post (post.php) and I would to disable it from executing then. I don't know how to specify that? I could check if is_admin, but that would disable ...
0
votes
0answers
58 views

Function that get ACF fields value before saving

Rewrited question: There is a similar question HERE but I don't know how to combine it with my code. I have a function that relay on acf checkbox field. It is working fine but I have to update the ...
0
votes
0answers
21 views

Deregister or disable duplicate check ($post_exists) in cpt saving/updating process

I have registered a custom post type which is ment to bring up 24 posts a year, titles only containg numbers 1-24. I did some rewrites to achive that the permalink structure of this posts will be ...
0
votes
0answers
27 views

How can I check if taxs changed on save_post/post_updated action?

Im running some custom actions on the 'post_updated' action hook. But I need to know if the taxonomies changed on post update to run some extra functions. The action hook only returns $post_after and ...
0
votes
0answers
55 views

WP Infinite loop

It is not working. add_action( 'save_post', 'jdev_save_custom_meta_box', 13, 2 ); function jdev_save_custom_meta_box(){ global $post; // Get our form field if( $_POST ) : if ( ...
0
votes
0answers
54 views

wordpress meta_box data don't save

I made this metabox with an input item and two select items(a dropdown and a checkbox). When i write something in the input item or i select something it disappear when i update the post. Another bug: ...
0
votes
0answers
79 views

Prevent save_post from running when preview button pressed?

I have a bug where my content gets saved twice (2 seperate rows in the posts table). This post creation is for a custom post type so the bug is to do with my code. To reproduce I: Create a new ...