The update-post-meta tag has no wiki summary.
0
votes
0answers
13 views
Select Options Meta Data is Not Updating in Edit Meta Box
I have a Meta box with two user inputs 1: Text-field and 2:a Select drop Down options. I used following Save Method in mt Meta box and second part of the code belong to saving the Selected option from ...
0
votes
1answer
27 views
How to update/delete array in post meta value?
I using post meta like..
$meta = get_post_meta(99,'_mymeta',true);
$value = $meta['somekey'];
echo $value;
But how to update $meta['somekey'] to some another value ?
How to use update_post_meta to ...
1
vote
0answers
23 views
Copying Custom Meta Values from existing post to a duplicate post
I'm trying to revise an existing WP plugin BU Versions to accept different custom meta field values from items I've set-up using the Advanced Custom Fields (ACF) plugin.
BU Versions will copy over ...
0
votes
0answers
28 views
Wordpress custom field being lost on wp_update_post, with a twist
I'm using wp_update_post to programmatically add a title and tags to posts from the front end. I'm running into a hair-tearing issue with custom fields in the process: one of the two custom fields ...
0
votes
0answers
22 views
wp_schedule_event not working
I am trying to make a scheduled event which trigger two 'update_post_meta' registered in function_1 and function_2.
Here is the code I have so far.
function function_1($post_ID=0){
~~~~
...
0
votes
1answer
25 views
update_post_meta not working?
The value is not updated when using the following code:
add_action( 'save_post', 'updatethumb' );
function updatethumb( $post_id ) {
//verify post is not a revision
if ( ...
2
votes
1answer
66 views
update_post_meta not saving when value is zero
I have a problem with the update_post_meta function.
I have a user submitted value, which I pass via $_POST and then saving to post meta.
All is working fine, but when the value is '0' the post meta ...
1
vote
1answer
52 views
Update post meta on bulk edit / update
I have a small problem with a code that works most of the time. I just discovered it cannot be used when I bulk edit custom post type.
If I'm on individual post page and hit publish, the custom post ...
0
votes
2answers
39 views
updating meta_key from the frontend
I am wanting to update the meta_key in the database to reorder postmeta from the frontend.
I'm using jQuery UI drag and drop to move items into an order, I can update the values but the meta_key is ...
0
votes
0answers
41 views
Scheduled Post Meta Update in Wordpress
I have a system that sums up values from various sources and pass those to post_meta in order to query posts in accordance with the order of meta_value_num.
I was successful at passing those value to ...
0
votes
1answer
36 views
Store SNS share value via function.php
I am trying to store SNS share value + comment count on my postmeta, DB.
I put code below to accomplish this task,
function get_sns_share($post_ID=0) {
$url1=get_permalink($post->ID);
...
0
votes
0answers
30 views
editing check box value
I have custom meta fields that users fill out through a form. I then have a second form that loads the data they posted and updates it if they want to make changes using update_post_meta.
It works ...
0
votes
0answers
52 views
Update Post Meta Data during post display processing
I have some relatively complex and costly code which extracts details of images from a JAlbum album, and displays that info with relevant posts. This currently runs every time the post is displayed, ...
2
votes
1answer
170 views
Inserting Hundreds of Thousands of Posts at Once
I have a project in which I create an array of 200k+ lines w/ 25 fields that run the wp_insert_post and update_post_meta. To start it processes pretty fast the slows down a lot after 10k records or ...
0
votes
1answer
136 views
Change wordpress meta tag description using WP functions
I do apprecciate this may sound like the usual question, but it is not. Just to let you understand I do not need to install one of the many SEO Plugin and change it on the box before content is ...
0
votes
1answer
130 views
update_post_meta only updating on last loop of foreach
I'm building a way to upload multiple files for an announcement custom post type on the front end. My function here uploads any number of files succesfully so I can see them under "Media" in ...
0
votes
2answers
305 views
update_post_meta() not working in save_post
I have added some text input fields to metabox in my custom post. Now whenever I put some data in those text fields in admin panel and click 'save', all data vanishes. Here is the code:
<?php
...
0
votes
1answer
39 views
Create a new custom field for all posts based on current custom field
I have a custom field for a large number of posts that contains the url for a youtube video. I used to grab the ID from the video and use that to build the thumb but in a new version I'm actually ...
1
vote
0answers
40 views
How to prevent further updates of custom meta when using actions to set one meta based on another
I'm using rilwis' Meta Box plugin (see https://github.com/rilwis/meta-box) to add custom meta boxes to a custom post type.
I then want to populate one piece of meta data based on the value of ...
0
votes
1answer
52 views
Function is Missing an Action Hook
I have tied an action into a status change, which works on the backend. However,using a frontend button for updating post status does not trigger the ...
1
vote
1answer
270 views
“update_post_meta” not working in “wp_insert_post_data” hook
I have created the following hook in my functions.php
add_filter('wp_insert_post_data', 'ad_change_title');
function ad_change_title($data)
{
if($data['post_type'] != 'ad_listing')
...
0
votes
1answer
96 views
update_post_meta after form is submited
I'm using the plugin "Formidable" to easily manage and create forms. I have set a custom post type, and created an extra post_meta.
I can use meta('test'); within the loop to show my meta value on ...
0
votes
1answer
217 views
Wordpress update_post_meta is not functioning as expected [closed]
I am creating a form with the goal of creating a post and assigning it a feature image. I have the post creation working 100% as expected, but I don't understand why update_post_meta is not ...
3
votes
1answer
126 views
Storing meta fields multiple times OR once with multi dimensional array?
I got some options that I expand using a repeater type field. The values I save for each field is already an array so in essence I'm saving a multi dimentional array per option. (See this weekly ...
0
votes
1answer
85 views
How to update post meta with xml data
I am trying to get this to work, but it doesn't. What is wrong?
$tutorgeocodesrc = "http://where.yahooapis.com/geocode?location=" . urlencode($tutoraddressfull) . "&appid=...";
$tutorgeocode = ...
0
votes
1answer
159 views
Check for page template on save_post hook
I'm reading into the save_post Codex and I find that you need to check the $_REQUEST['post_meta_data'] in the edit window to hook into save_post.
I altered the example code:
function ...
-2
votes
1answer
284 views
How to sum 2 variables [closed]
I'm trying to finish a simple script that will run on localhost only I'll use it to store some variables 'cause I would like to use wordpress also as 'money manager' (as a proof of concept).
But maybe ...
1
vote
1answer
307 views
Use ajax to update_post_meta
2 days ago I asked this then I tried to work on my code to be able to understand how ajax and php work and now I have a new issue that, probably would be easily solved.
These are my codes:
<?php
...
0
votes
2answers
427 views
Custom Post Type, Saving Multiple Checkboxes
For a custom post type, I'm pulling in a list of another custom post types that I need to select for saving ...
<input type="checkbox" name="32"> My CPT <br>
<input type="checkbox" ...
0
votes
1answer
198 views
Saving Revision of post meta key/value on each update_post_meta event
I have some code that updates a meta-key's value by incrementing...
$post_id = $wpdb->get_var( $query );
$meta = get_post_meta( $post_id, 'stuff', TRUE );
$meta++;
...
1
vote
3answers
149 views
Saving custom fields to a custom taxonomy
I am trying to create a custom field for a custom taxonomy. update_post_meta works great with posts. Taxonomies are not posts so this won't work.
<?php update_post_meta($post_id, $meta_key, ...
0
votes
2answers
179 views
How to avoid overwriting meta with empty metaboxes? [closed]
I have a custom post type with about 20 different metaboxes. What I would like to do is be able to hit "New post" for this type, enter the post title, fill in an unique identifier on one of the ...
3
votes
1answer
203 views
Code to make a post sticky
How is it possible to upgrade a post to make it sticky directly from code, not by admin area?
Is it possible through a code like:
update_post_meta($post_id, $meta_key, $meta_value, $prev_value);
In ...
0
votes
1answer
777 views
is there an update_post_meta action
Are there any actions I can hook into for update_post_meta()? I don't see anything obvious in the source. Woocommerce lets you change the featured status of items via ajax from the edit screen. I ...
0
votes
2answers
209 views
Custom Post type forgetting data
I just set up a custom post type, mostly following this tutorial.
I'm setting up things on my site now, doing a lot of CSS modifications and such, and every few minutes the post just forgets ...
3
votes
2answers
534 views
Custom Post type - how to get checkbox to update meta field to null
I have 7 meta fields for a custom post type in Wordpress. These 7 in particular are days of the week (Sunday thru Saturday) and have checkboxes for each. I've successfully gotten the checkbox to POST ...
0
votes
1answer
316 views
Having trouble with custom post type / meta box
I've been working on a custom post type meta-box implementation that allows me to change the post_date to match the value in my "date" meta-box.
The function works perfectly except when I try to add ...
0
votes
1answer
137 views
Why do I have to press the “Update” button twice to save my meta box values?
I'm having a problem with updating the post_date in a custom function I've written.
I'm trying to change the "post_date" to my custom "meta_date" value.
Here is the function:
function ...
1
vote
3answers
356 views
Change the post date from a meta box
I'm having a problem with updating the post_date in a custom function I've written.
I'm trying to change the "post_date" to my custom "meta_date" value.
Here is the function:
function ...
0
votes
1answer
347 views
Problem Saving Custom Post Type Meta Values
I need a second set of eyes. I am unsure why this code is not saving properly. Basically I hit save and my field values disappear.
I have two other post-types saving fine using this structure. I ...
0
votes
1answer
139 views
Custom post type - update_meta not working
I'm sure this must be something simple, but I can't for the life of me work out why this isn't working.
if (!class_exists('FeaturedItem')) :
class FeaturedItem {
var $plugin_url;
function ...
1
vote
0answers
134 views
Save modified Custom Field content into another Custom Field on article save [closed]
In my articles I allow editors to enter a date in a human readable dd.mm.yyyy format into a custom field. But I also need this date as unix timestamp in the DB. So I wrote a function which takes the ...
0
votes
1answer
459 views
Media attachment date and post date
I have just migrated a massive site (2500+ users, 5000+ posts/images) to Wordpress using custom code. Basically every post has one image and that image is attached to the post as the featured image, ...
1
vote
1answer
393 views
Change post_date to post_modified date on post template?
I'm looking to change the post created date to a modified date on my post template (single.php). Moreso, I'm looking to control when I update that date based on whether I make significant changes to ...
0
votes
1answer
231 views
save radio button selection in post-meta on submit
Right now I'm reading tags from the tag box, and putting them in a form with radio buttons so the user can choose a "main tag" from the tags they just typed in:
function write_tags(){
var rawtags ...
1
vote
1answer
625 views
Custom field values deleted when trashing custom post type
I've created a custom post type with 2 custom fields attached to it... When I create a post of this type and fill in the custom fields, the data is, in fact, saved to the db... However, if I trash one ...
1
vote
1answer
431 views
update_post_meta, xml parser
I'm hitting the wall for nearly two hours now, trying to figure this out.
Here is the thing' I have made a xml parser to read xml file and add posts (with content) from xml:
$ch = curl_init( ...
0
votes
2answers
505 views
Wordpress User Frontend Editing Custom Fields
I'm using the plugin Wordpress User Frontend and editing the title and content of a post is nice (I managed to change it so I can edit custom post types), but there's no support for editing custom ...
1
vote
2answers
2k views
How to use wp_insert_post to update meta box?
I'm trying to use wp_insert_post to create a front-end submission form so visitors can create a post AND update the meta box fields of that post -- not the custom fields.
For example, when I use the ...
2
votes
1answer
2k views
How to save an array with one metakey in postmeta?
I have an array saved in postmata, each array key become a metakey. I want to change the code to save the whole array with one metakey. How to do that? Thanks!
$poddata = Array(
'pod_id' => ...