Tagged Questions
2
votes
1answer
37 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
49 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
25 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:
...
0
votes
0answers
16 views
Custom post type sometimes duplicates on save
My plugin uses a custom post type where you can type text in a text field and with javascript add another text field dynamically, think of a todo list where you can keep adding new items.
When they ...
1
vote
3answers
280 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 ...
0
votes
2answers
172 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
263 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
314 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
0answers
127 views
get_term_meta not working on save_post [closed]
I'm doing a custom post type 'budget' to taxonomy 'budget-term' relationship using post meta 'budget-term-id'. This hooks starts on save_post, and basically it creates a 'budget-term' term and save ...
0
votes
1answer
439 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
302 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 ...
3
votes
4answers
2k 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
260 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
309 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 ...
4
votes
2answers
1k 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
235 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
282 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 ...
2
votes
2answers
495 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 ...