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
1answer
387 views

update_post_meta() whenever custom post type is updated

I need the following functionality. Whenever my custom post type is updated or saved I need to overwrite certain custom post metas. I need to make sure this only affects posts of the post type ...
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 ...
1
vote
1answer
71 views

Change 2 fields in the post depending on the 3rd field before save

I have a custom content type called cards. I have 3 custom meta fields called: my_cards_activity (select field type; options 0 and 1) my_cards_user (select type; many options) my_cards_datetime ...
0
votes
1answer
22 views

How to prevent meta data from being edited in a post?

I need to add a 'poll' to every single post automatically, and wish to do this without having to manually create a poll each time using a plugin, so I had an idea to store the poll results as meta ...
2
votes
1answer
199 views

Frontend posting - everything saves other than checkboxes?

I have a form on the frontend of Wordpress which is saving all fields except a checkbox array. It displays and saves the correct values if I tick the boxes in the backend post editor, and the ticks ...
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, ...
-1
votes
1answer
63 views

What do the numbers mean at the end of add_action('save_post')…?

I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the save_post hook. For example, in the WordPress Codex it gives the following example: ...
1
vote
3answers
2k views

Custom post type save_post action not firing

Sorry if this is already answered on here. I looked around and couldn't see any answers to my question so I thought I'd post my own. I'm building a plugin for a client that gathers customer feedback ...
1
vote
2answers
1k views

Using save_post to replace the post's title

I am using custom posts, and in these, I don't a need for the title. This causes Wordpress to set the titles of my posts to "Auto Draft". I'd like to change the title's value to something else, ...
0
votes
1answer
503 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
703 views

Is there an easy way to AJAX-ify saving of post?

We have a plugin that allows us to manage custom post types and we'd like to add AJAX functionality in saving, editing, and deleting posts. I couldn't find similar problems in the internet so I'm ...
0
votes
1answer
654 views

Custom Post Type Meta Box Text Input Field Won't Save When Blank

I have some text fields in a custom post type that I fill in at first, but need to delete on a future update of the post. When I delete the text in the field and save the post, the text I deleted ...
0
votes
1answer
528 views

Custom Post Custom Taxonomy Data Not Saving in Edit Screen

I have a custom post type "projects" with a custom taxonomy "project_type." If I select a project type taxonomy within the post editor screen and hit update, the taxonomy isn't updated. Worse yet, it ...
5
votes
4answers
4k views

Prevent post from being published if custom fields not filled

I have a custom post type Event that contains a starting and ending date/times custom fields (as metaboxes in the post edit screen). I would like to make sure that an Event cannot get published (or ...
1
vote
3answers
297 views

Is it possible to create a post using a metabox?

I am trying to create a post (well, in the end, multiple posts) from a metabox using the 'save_post' hook. I executed the script once, creating 3900 or so new posts before I crawled into posts.php and ...
1
vote
1answer
480 views

How can I set taxonomy programmatically

Here is my situation. I plan to distribute a theme I am working on and it has a custom post type called Code and it has a custom taxonomy called Languages now I also use a custom metabox with a ...
5
votes
2answers
2k views

Why won't my metabox data save?

I have a custom post with a lot of meta boxes. I recently tried to add some dynamic metaboxes, using this question: Create more Meta Boxes as needed I managed to get the metaboxes to add nicely, the ...
0
votes
1answer
291 views

Custom field values get deleted

I created a custom post type:products which also has custom fields: price & shipping. Occasionally, if I leave the edit product window open or refresh it, I lose the values inside price and ...
1
vote
1answer
372 views

Trigger “unsaved changes” dialog for custom post meta changes

I'm using a custom post type with custom meta fields, but autosave and the "unsaved changes" dialog don't seem to be triggered for these custom meta fields. Autosave isn't as important to me as the ...
3
votes
2answers
635 views

Submitting posts from the front end - sanitizing data

I have a form that allows any registered user to submit a post (it's a custom post type - forum related), and I'm using wp_insert_post() to insert it into the db. From what I've seen in this function ...