The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
133 views

using update_user_meta to rank users

I'm using a plugin that allows users to vote on posts, I'd like to add each vote that's cast to the authors user_meta so I can rank users the same way I rank posts. There's a couple of different ...
0
votes
0answers
26 views

update_post_meta() not working in bulk option

I am following this https://gist.github.com/michael-cannon/5820098 to update bulk values but its not working. I tried to debug each and every step but can't get the exact error. I have the following ...
0
votes
1answer
68 views

bulk update meta value with ajax

I want to update posts meta value in the wp_query to a different value on click. What I am basically doing is making a notification bubble (like stackoverflow). wp_query with the number of posts ...
1
vote
0answers
78 views

How to save double quotes in post meta, when the post meta data is an array? [closed]

Ok so I've been scratching my head on this one for a while. I'm making a plugin that adds a custom meta box to a custom post type. I'm using the update_post_meta function to save the data from the ...
1
vote
1answer
214 views

Change post thumbnail using front end post edit form

I'm trying to get the post thumbnail to change if a user selects a new file on a front end post edit screen. This is similar to the code I use to upload data and set the post thumbnail on a front end ...
0
votes
1answer
143 views

wp_insert_post bulk import 500 server error

I am working on a Wordpress import tool, where I use a custom city table in my database with longitude, latitude which combine with some other text and then import by wp_insert_post(). This works ...
0
votes
1answer
40 views

Custom Post Type not showing anything added by code anymore?

So I have a piece of code written and it worked before, hasn't been edited hasn't been changed, no updates on the WP DB no updates on any plugin on WP and it's suddenly not working correctly. This ...
0
votes
1answer
115 views

update_post_meta not adding anything.(Nor add_post_meta)

So I have made some kind of importer(From another non WP db to my WP db) which handles everything in a click of a button. Now it does correctly create a post type although one of the custom fields ...
0
votes
1answer
26 views

Declaring a var, placing it in a query and using the output of the query?

So i'm wondering if it's possible to declare a variable that you'd place in a query to then use it in a update_post_meta function? This is how I tried to do it. First off I made a connection to ...
0
votes
1answer
55 views

Stop `update_post_meta` from working each time page refreshes?

So my code I have here including update_post_meta makes it work when clicking a button I have although what I fail to find out is how I can prevent update_post_meta from working on each page ...
0
votes
1answer
243 views

Update value of a associative array with update_post_meta

I am trying to change the value of a specific key of an associative array which was saved in my post meta. This is how my array is saved in a custom field: Array ( [0] => Array ( ...
8
votes
1answer
570 views

Why are simple updates to wp_postmeta's “_edit_lock” so slow?

In our MySQL slow query log, the cumulatively slowest query is a simple update to wp_postmeta. Here's an example: UPDATE `wp_postmeta` SET `meta_value` = '1392835505:386' WHERE `post_id` = 94705 ...
0
votes
1answer
53 views

Meta box with front-end styling

I have a specific Gallery post of products that I release at the start of every Monday on my website, which differs from my other Gallery posts. These types of Gallery post don't require the Authors ...
0
votes
0answers
61 views

update_post_meta frontend

Ok I have searched and searched the internet to find an answer to no avail. Here is my issue. I have a form that is pre-populated with metadata fields. I want to have two submit buttons one will ...
0
votes
1answer
116 views

Difficultly changing date format in post meta value

I have a custom post type with a custom field that takes a date. The posts are later ordered by the date in that custom field. Unfortuately I formatted the date incorrectly and there are already a ...
0
votes
1answer
288 views

WooCommerce wp_insert_post action firing on every save

function initial_product_data ( $post_id ) { // lets get out of here if this is not a new product if ( 'product' != $_POST['post_type'] ) return; // make sure the post isn't automagically ...
0
votes
1answer
58 views

How do I delete element from a serialized array upon deletion of a post?

I want to delete an element (post id) from a serialized array associated with a specific meta_key. The following screenshot tells the whole story. What you're seeing are, post ids saved in a ...
0
votes
1answer
49 views

Rich Custom Field for Custom Post type not saving

I am new to creating meta boxes and I am trying to create a custom field meta box that is connected to a custom post type which is created by WooTheme Sensei (Post type = lesson). I am trying to use ...
1
vote
1answer
795 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
1answer
219 views

update_post_meta not working in action hook

I'm having a real problem updating custom fields (within a custom post type) with data from the database. I have a table in the database called wp_company_profiles with address fields (i.e. ...
1
vote
0answers
165 views

Bulk update all posts from plugin settings screen

I'm writing a plugin right now that will populate custom metadata for all posts on the site based on a certain rule. I've already created a Plugin's settings page and a logic that should be triggered ...
0
votes
1answer
282 views

wordpress update multiple posts post meta

I am trying to update multiple posts post meta at the same time. I have the following query: <form action="" method="post"> <?php $variations = new WP_Query(); ...
0
votes
0answers
58 views

Gravity Sum list column with post_after_submission

I want to make sure I'm doing this right. I have a gravity form with a list field with three columns. Basically, Product Name | Quantity | Notes I want to sum the value of all the values in the ...
0
votes
1answer
82 views

Use an id on a button to update_post_meta in post

I hope that someone can answer this conundrum for me.. As its doing my head in a bit LOL. I have a button with the code as follows: <button class="contact-owner-send" ...
0
votes
1answer
729 views

update_post_meta and update_field ony working when saving the post

I use Advanced Custom Fields (ACF) to store data in a custom field. I had latitude and longitude information stored separately, but I they need to be in one custom field so I made the function below. ...
-1
votes
2answers
63 views

Update an existing post in a custom post type

Alright lets say we have a connected user that access one of his post to replace some existing informations in X fields thats already exist with some new ones.. How could i manage to update the old ...
0
votes
1answer
201 views

Any way to update_post_meta with html content? It gets stripped and becomes empty

So I am cloning some divs created from an array using jQuery. Here is an example. I have a drop down list that contains items to add to the meta box. The add button clones a hidden div based on the ...
0
votes
1answer
358 views

function wp_insert_post and wp update_post_meta [duplicate]

how combine wp_insert_post and wp update_post_meta? i need first insert post, then update post, let me know about example? i want sample for my future project Thanks
0
votes
1answer
140 views

Advanced custom field - posted fields from custom post type

I'm using the Advanced Custom Fields - plugin and I have custom post type called 'course' where some fields from the ACF are related to. I have this code below: function update_course($course_id) { ...
0
votes
3answers
192 views

Using preg_replace to filter custom textarea

I am developing a custom post type, which, among others includes the possibility of sending an email from within the post editor. The email body textarea is populated through a custom settings page ...
0
votes
0answers
75 views

when saveing $meta_box i get Undefined index error

I need help to fix these Notices: PHP Notice: Undefined index: person-name in testimonials.php on line 112 PHP Notice: Undefined index: position in testimonials.php on line 112 PHP Notice: Undefined ...
0
votes
0answers
87 views

Update fields with post object and custom tax with wp_insert_post

Updated Post 'update_field' Function is Acf Plugin $supplier_one = 'my supplier'; $supplier_two = 'my supplier TWO'; $post_id_one = 555; $post_id_two = 556; update_field('suppliers', $supplier_one, ...
0
votes
3answers
760 views

How to create a button click counter meta box?

I am trying to create button click counter meta box in a custom post type, but I can't get it to work. What I want to do is when a user click the submit button, then it will do update_post_meta in the ...
0
votes
0answers
22 views

Automatically Create Handler For Newly Generated Form Table

I have a mwtabox with form that will create similar form table with different input name when a button is clicked. It is by adding an incremented number after the name, so it will be like this: name ...
0
votes
0answers
137 views

Updating post meta and Meta Box plugin

I've installed Meta Box wordpress plugin and create a text field meta box with clone option: add_action( 'admin_init', 'rw_register_meta_boxes' ); function rw_register_meta_boxes() { $meta_boxes ...
2
votes
1answer
215 views

Unable to save datetime custom meta field using update_post_meta() function

When I do something like this (in my plugin function inside WP admin): $metaboxes = get_post_meta( $post_id ); echo "<pre>"; print_r($metaboxes); echo "</pre>"; die(); I get all my ...
0
votes
1answer
115 views

Front end update_post_meta Help

I followed the help provided in this question but cannot get the form save the data. I tried using 'save_post' action hook to try and save the post like we do for admin side. Any help would be highly ...
0
votes
0answers
43 views

update_post_meta array issues

I am not sure what I am doing wrong here and would appreciate the help I have an array the looks like this: Array ( [85369] => 3 [85368] => 13 [85378] => 23 ) When I try to ...
1
vote
1answer
138 views

How to use update_post_meta inside wp_trash_post

I have some metadata on my post edit page that saves perfectly using the hook and function below: add_action('save_post', 'save_meta_data'); function save_meta_data($post_id){ ...
0
votes
1answer
184 views

How do I save each option in a multiple select menu as it's own meta_key + meta_value pair?

How do I save each option in a multiple select menu as it's own meta_key + meta_value pair? This is the basic multiple select menu. Note: multiple select menus allow you to select more than one ...
0
votes
1answer
317 views

update_post_meta not working in plugin

I am trying to update post meta for a voting plugin. Specifically it calls update_post_meta() on an ajax request. Here is the code: function add_settings_menu() { add_options_page('Contested ...
0
votes
0answers
501 views

Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array

I am trying to unset/remove then replace/update a single value from a post meta field, but my code for array_push() and unset() are removing all of the values from each array. Here are the two halves ...
0
votes
1answer
80 views

updating one custom meta field only

i am trying to update only one custom field that is store in serialized form. By updating that field my other custom meta fields becomes blank/empty. how can i update only a specific meta value ...
0
votes
1answer
167 views

WordPress front-end media (image) upload ERROR!

I pasted my codes HERE in Pastebin. Thing is that, I have posts, where the post thumbnail is the first image and the custom fields are used to store the other 3 images of the post. The form fields ...
0
votes
0answers
97 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
407 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
270 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
187 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
186 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
221 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 ...