The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
101 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 ...
2
votes
1answer
443 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 ...
2
votes
0answers
289 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
191 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
1answer
208 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
241 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
384 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
62 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
1answer
90 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); ...
2
votes
1answer
924 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
285 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
427 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
1k 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
64 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
58 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
79 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
699 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
219 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 ...
3
votes
1answer
219 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
145 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
280 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
685 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 ...
1
vote
2answers
1k 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
369 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
426 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, ...
4
votes
1answer
325 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
2k 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
253 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
1k 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
417 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
239 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
550 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
587 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
170 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
152 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
790 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
657 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
447 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 ...
2
votes
2answers
1k 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
532 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
754 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
4k 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 ...
3
votes
1answer
5k 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' => ...
1
vote
1answer
597 views

Custom Post Type: Set post_title equal to a custom post type field

I’ve created a custom post type for employees in a company with some fields they have to fill (like E-mail, phone, etc.) and a select box which takes some values from another custom post type called ...
0
votes
1answer
235 views

Post via wp-admin and via iOS app, same hooks and triggers involved?

I've got an add_action in functions.php, the action is for save_post and the function I'm running I've named set_attachment_url. I'm simply getting the first attachment on a post and setting a custom ...
0
votes
1answer
1k views

Front-end update_post_meta snippet displays white screen?

Thanks to @Anu's correction I now have a function to update_post_meta from the front end. Something is wrong in my script however, because with the function below nothing is being displayed on the ...
0
votes
1answer
759 views

What action hook updates post meta?

Is there an straight-forward example anywhere of using wp_update_post() to edit post_meta on the front end? I have not been able to find any good learning resources. What I want to do is display post ...