Questions tagged [meta-value]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Keep PODS data (meta table) after wp-ultimo (multisite) template switching

I have a multisite install and using wp-ultimo to manage the subsite duplication, or "template sites" as they call it. One downside to this approach is that you'd lose any edits you make when you ...
0
votes
1answer
20 views

How to save a meta_value as a numeric value after I retrieve it via update_post_meta?

I tried things like $meta_rwp_user_score = (number_format_i18n($meta_rwp_user_score, 2)); , but this is not working. Where do I use that? <?php $meta_rwp_user_score['meta_rwp_user_score'] = ...
0
votes
0answers
17 views

file_get_contents to update_post_meta strange behavior database via shortcode

Here is the context : with a custom plugin, I create a shortcode which must retrieve a list of articles as text files (html inside h2, p, links) from a thematic folder. The html content of the text ...
0
votes
1answer
10 views

How to search usermeta table

What is the best way to search usermeta to find a user_id based on a meta_value? For example in usermeta table there is a row with user_id = 123 , meta_key = deviceid and meta_value = 45545. I know ...
0
votes
0answers
26 views

How can I list users by date in an array in meta_value?

I keep an order list of all users. I keep this list in the meta_key value named payments. The payments meta allows me to keep information about the payments the user made. To give an example for an ...
0
votes
1answer
24 views

How to order users by a date in the meta_value array

I have an 'payments' meta_key for the users. I store the payment information (date and payment amount) received from the user in meta_value connected to this meta_key. For example: array( [0] => ...
1
vote
1answer
53 views

Custom query for sidebar isn't returning results

I'm trying to create a shortcode that runs a custom query based on Yoast's primary category meta key. The goal is to pull posts with the same meta key value of the post being displayed and show 4 ...
1
vote
1answer
37 views

How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)

Sorry guys, had to post this again as site wouldn't let me respond to comments (new account). I have been working on some code to decrease quantity of a variable product based on the numeric values ...
0
votes
1answer
471 views

Sorting meta_value as integer doesn't work

This plugin uses the below chunk of code to print the top 10 highscores. But this doesn't get the list of top 10 scores sorted by meta_value in my WP install $scoreboard = new WP_User_Query( array( ...
0
votes
1answer
28 views

How to update/add child posts meta whenever the parent post meta is updated?

I couldn't find a solution to a very simple problem. When a meta value for the parent post is updated, I want the meta value of all child posts linked to this parent post to be updated. For example: ...
0
votes
1answer
11 views

Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen

i have a custom field like this: function nutrix_display_recipe_mb( $post_object ) { global $post; wp_nonce_field( basename( __FILE__ ), 'recipe_mb_nonce' ); // PREPARATION TIME FIELD $html = '';...
0
votes
1answer
1k views

WordPress Admin Panel search posts with custom post meta values along with title

Trying to modify default admin search by including search by custom post type fields, Below is my code, function custom_search_query( $query ) { $custom_fields = array( // put all the ...
1
vote
1answer
2k views

Seach custom post type posts only by meta fields?

is it possibile to search custom post type product by _sku or other custom meta field with input text field? I don't want to use plugin, just need custom WP function. I have found this solution for ...
0
votes
1answer
710 views

Saving zero as meta value

I have a meta_key called "_ordre" and each time I create a new custom post, a new meta_value is set for that meta_key. The thing is, when I set the value of '_ordre' to 0, the meta_value is not saved ...
0
votes
1answer
67 views

Update a list of product to featured if product have meta value (Mysql not wpquery)

Since woo 3 featured product is name and slug of taxonomy 'product_visibility'. I need to update all products with same meta_value contained in list to 'featured'. My products have a meta_key = '...
0
votes
1answer
21 views

How to get specific attribute from DB

a:3:{ i:0;a:2:{s:21:"wwsd_percent_discount";s:2:"10";s:25:"wwsd_minimum_discount_qrt";s:2:"20";} i:1;a:2:{s:21:"wwsd_percent_discount";s:2:"20";s:25:"wwsd_minimum_discount_qrt";s:2:"50";} i:2;a:...
1
vote
1answer
31 views

How can I convert postmeta from unserialized to serialized?

I'm replacing 2 fields that were previously set up with ACF and saved separately. Instead of those, I want to have 1 piece of serialized postmeta. So, I'm going from meta_key: old_key_1, meta_value: ...
0
votes
2answers
24 views

Find a way to retrive data updated through metabox plugin to web page

I developed a customer metabox plugin to save user details to db and retrieve them back to Contact Us Page in my website. But I searched a way to retrieve the data to contact us page and I couldn't ...
1
vote
1answer
72 views

Need wp_query to return all children and grandchildren

I am working on a site with three different main 'topevel' sections, that act as the top level parents of the site. Each toplevel section has children and grandchildren, and there needs to be a ...
1
vote
1answer
15 views

OG Meta Tags not being scraped by facebook or twitter

When trying to share a blog from my wordpress website on social media, (facebook, twitter), there is no URL preview card. No picture, no description, nothing. I installed yoast seo plugin on my ...
1
vote
0answers
21 views

Meta_query on same meta key, with diffrenct values

i'm trying to get_users with the meta_query where i need to find users where either they don't have the meta key, or it is blank. It seems like everywhere i look, i should be able to use the OR on ...
0
votes
1answer
41 views

Prepare WPDB with meta key and meta value

I'm trying to prepare WPDB by post type, meta key, and meta value global $post; global $wpdb; $rid = absint($_POST["rid"]); // number $last_id = absint($_POST["lastID"]); // post ID $query = $wpdb-&...
0
votes
0answers
9 views

Sort query by title in meta value stored as id

How can I sort a query alphabetically by meta value where the meta value has the id of a related post and not its title? I have two custom post types: news and companies. Each post under news has a ...
1
vote
0answers
1k views

How to pull email and name from Flamingo plugin

I am trying to pull the name and email from the database and show on the front end of my website. I tried many scripts and looked on the flamingo forum as well. But couldnt find a solution. All the ...
0
votes
0answers
63 views

Get meta_value from GDRating

I am trying to get meta value from GD Rating table for each post ID with following sql: $querystr = "SELECT meta_value FROM $wpdb->gdrts_itemmeta WHERE meta_key LIKE 'stars-rating_rating'"; $...
0
votes
1answer
47 views

How to get string from add_theme_support('title-tag') for meta tag and beautify?

It recommends that we should use add_theme_support('title-tag') for displaying blog title. However, I also need to get the title as string for another purpose. It's for optimizing SEO. As you already ...
1
vote
1answer
29 views

How to change image atributes right before an image to be saved?

I have an installed plugin to import XML content, but it can't change some meta-data of the new image that will be saved. For example, I'd like to intercept the action of saving an image BEFORE its ...
0
votes
1answer
306 views

REST API and filtering by meta value

I have a posttype 'timeslip' and I am calling this with the following API endpoint: /wp-json/wp/v2/timeslip?meta_key=user_id&meta_value=1 I have exposed my custom field user_id to the API meta ...
0
votes
2answers
49 views

How to update a custom field in all posts with the value of another custom field in the same post?

I try to get the value of the source field 'enddate', save it in the variable $enddatevar and write it in the target field 'promote' in the loop by activating the plugin, but the code I added to this ...
0
votes
1answer
5k views

Assign/update the custom field value for all posts

I have over 1000 posts. Each post has a custom field XYZ. I'm looking for a function that I can run once that will assign a value of 1 to each of the posts' custom field XYZ. I've had a look at this ...
0
votes
1answer
231 views

meta_query check for meta value in key which holds an array of values

In every post of my custom post type called "announcements" I save the users' ID inside an array which resides in a meta_key called "post_is_read" whenever a user reads an announcement. Just to ...
0
votes
1answer
24 views

how to SELECT meta values that are not null?

I have a rating system for our products but there is an issue: by the code, that will SELECT all comments in commentmeta table that have rating as meta_key. even those who do not have a rate (the ...
0
votes
1answer
30 views

How to get all multi-select user meta values and add them to an array?

I am trying to grab meta_values from a user profile's multi-select field, and convert them to usernames, which I will then input into an array. Let's say that the user has selected two options (out of ...
0
votes
1answer
385 views

Wordpress meta query with meta serialized data array value

Looking for a method to nest AND/OR relation in meta_query based on array serialized values. Reviewed these already: Query multiple meta key values? WP Meta Query for some meta (array) values I ...
0
votes
3answers
17k views

Order by custom field date with ASC order

I've found several similar question but none of them explains why the below is giving me nothing with ASC order. It works with DESC. Basically it's a query that should list posts where the custom ...
0
votes
1answer
36 views

Reading Content in an Array as it relates to a meta_query

I am capturing a user's Work Anniversary and their content is being stored in an array. So the key as it relates to these Meta Fields is hire_date and the value that is stored in that array looks ...
0
votes
1answer
157 views

how to change value return by _stock_status

i am finding how to change the value from _stock_status on single product. I have display the product stock status by that code: <?php echo get_post_meta( get_the_ID(), '_stock_status', true ); ?&...
2
votes
1answer
194 views

meta_query works locally but not on live server

I'm filtering posts by author's last name initials. On my local server, the query runs beautifully, but when I push live, it doesn't. It doesn't find anything. Does it have anything to do with the way ...
2
votes
1answer
2k views

How to get user_meta value for new user regsitered?

We have a customized the registration process. Users register themselves. When a user registers, some meta values are updated based on the $user_id. Now we need to send an email. We have used action ...
2
votes
1answer
2k views

How to use Meta Value Compare in WP_Query For Max and Min numbers

I am using WP_Query for visitor to filter the posts. The posts is about products. So in the filter, it has a field where user can select Maximum price and Minimum price. (Just like most of the ...
2
votes
1answer
330 views

Ordering Posts Type A by Custom Fields of related Post Type B

I'm not sure if this is even possible (also posted to ACF forum https://support.advancedcustomfields.com/forums/topic/ordering-by-custom-field-of-relationship-field-object/#post-62454) I have two ...
0
votes
1answer
370 views

How to sort by meta value num, but ignore zero value?

I have custom-post-type company and taxonomy services for this CPT. I have created meta-field service_[id]_price for companies and fill this field with a number. If this company has not price for this ...
0
votes
3answers
228 views

How to add custom filed value after in wp post title

(WP Post Title)Malwarebytes Anti-Malware (Custom field value)3.5.1.2522 How to add custome meta value in wordpress after wp post title in same hyperlink
0
votes
1answer
420 views

Do comparision after updates hooks of acf-fields?

I have this code: public function init() { add_filter('acf/update_value/name=bookitall_fromdate', array($this, 'check_bookingdates' ), 10, 3); add_filter('acf/update_value/name=...
2
votes
1answer
483 views

Autoprediction / Autocomplete Search with Meta Keys

currently I am stuck with my real estate search. What I am trying to do sounds pretty simple: I have one field in a search form. I want that field be able to generate auto suggestions / auto complete ...
1
vote
2answers
85 views

What Wordpress function to use to get meta value by using meta keys?

This is the code: if ($keys = get_post_custom_keys()) { foreach ((array) $keys as $key) { $keyt = trim($key); if (is_protected_meta($keyt, 'post')) { continue; ...
0
votes
2answers
843 views

Sortable Custom Columns not sorting correct

I am using the code below to sort code as per meta_value. But in this specific Column I have dates displayed for example: 20 April 2018 or 01 June 2018 The sorting works sort of but now when I order ...
0
votes
2answers
482 views

how to query for meta_value have array

I have array in post_meta like this: array( 'option1' => 'true', 'option2' => 'true', 'option3' => 'false', option4' => 'true', 'option5' => 'false' ) and I would ...
0
votes
1answer
146 views

Using Orderby and meta_value to order natural/alphanumerical

I added a custom column for a custom post type. Then I put it to be the 3th column, and now I want to sort it alphanumerical. I use this action : add_action( 'pre_get_posts', '...
0
votes
1answer
93 views

Print specific values stored in a post meta array

I'm triing to print some values stored in a post meta. My post meta_values looks like this : a:3:{s:6:"amount";s:117:"€2.00";s:6:"entity";s:5:"11854";s:9:"reference";s:9:"800146779";} I'm ...