The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
6 views

Update user data and use it instantly

I'm trying to update a user mail recieved by $_POST and use it instantly. It gets changed, however I cannot use it instantly. What is the way to do it? global $current_user; get_currentuserinfo(); ...
0
votes
0answers
16 views

Reset postmeta entries every month

I have this currently running on my site, which counts how many times each 'post' has been viewed, adds one view to the count and then saves it in postmeta: function getPostViews($postID){ $count_key ...
0
votes
1answer
51 views

Update post meta without deleting the old entries

$old = get_post_meta($post_id, 'figure_sugsubject_repeatable_fields', true); $new = array(); $figuresugsubjectpositions = $_POST['figuresugsubjectposition']; $figuresugsubjectworkplaces = ...
0
votes
1answer
24 views

update_post_meta does not work

I have meta box in my custom post type where I receive data from a front end form. The issue is that somewhere in this functions, something goes wrong and the data changed in admin edit panel does not ...
0
votes
0answers
13 views

Run function after post is updated

I would like to run a function after a post is saved. That function takes a .txt file thats uploaded with Advanced Custom Field file field, makes it into an array to then a json data. I want the json ...
0
votes
0answers
55 views

add_post_meta not saved

EDIT I changed it to if(isset($_POST['Make'])) update_post_meta($pid,"Make", $_POST['Make']); if(isset($_POST['Year'])) update_post_meta($pid,"Year", $_POST['Year']); ...
0
votes
1answer
148 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
40 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
81 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
97 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
235 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
168 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
41 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
152 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
30 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
61 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
291 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
673 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
58 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
72 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
131 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
317 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
65 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
51 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
919 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
260 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
212 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
310 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
59 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
87 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
829 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
64 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
214 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
407 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
146 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
199 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
76 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
89 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
802 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
23 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
138 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
224 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
121 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
45 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
141 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
203 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
377 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
529 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
82 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
177 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 ...