0
votes
1answer
126 views
+50

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
1answer
66 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
77 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 ...
0
votes
1answer
234 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
561 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
1answer
57 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
778 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
277 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
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
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
73 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 ...
2
votes
1answer
402 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
267 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 ...
3
votes
1answer
216 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
412 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 ...
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 ...
3
votes
1answer
4k 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
583 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 ...