Questions tagged [meta-value]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
17 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
1answer
9 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
23 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
52 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
35 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
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
64 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
20 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
68 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
38 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 ...
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
46 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
28 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
273 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
205 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
22 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
27 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
373 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
1answer
35 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
153 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
193 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
323 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
3answers
222 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
416 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
475 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
83 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
830 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
1answer
143 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
90 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 ...
0
votes
1answer
35 views

Multiple meta key and value search in the query

I am have this following API code for $_REQUEST $metakey = explode(',',$wpdb->escape($_REQUEST['key']) ); $metavalue = explode(',',$wpdb->escape($_REQUEST['value']) ); $meta = ...
0
votes
0answers
40 views

Loop random posts and display odd and even based on two alternating meta values?

I have a CPT containing an ACF select field for gender values Male or Female. I need to to display 6 random posts AND they need to be ordered so the odd posts are female and the even posts are male. ...
1
vote
1answer
51 views

How to extract specific post

I've to extract only the posts where the meta_value does't contain some specific string. I use this code: $query = new WP_Query( array( 'post_type' => 'estate', '...
1
vote
0answers
57 views

WP Query sort by meta value

I would like to get posts order by timestamps. I have to following code but the query keeps getting posts order by modification dates and not with the "evcal_srow" meta. Any clue? <ul class="...
0
votes
1answer
77 views

Get the total Author Favorited posts

I am using the plugin https://favoriteposts.com. To be a little clearer I have posts on my site that have a favourite count as a meta value. I want to get the total favourite count of all posts ...
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
2answers
476 views

Check for custom field value in different post type than current one and do something

I have 2 post types, one is for my posts and the other one is used as a submission form. When a user is on a single post page for post type A, I am trying to do several checks to then display ...
0
votes
1answer
266 views

Gather same custom field values in one value in a select tag with wp_query

I am trying to gather specific information in a select tag in order to filter pages. A have several training pages with same prices (for instance : $80, $120, $500, etc...). The problem is when 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
1answer
622 views

get value from selected input

here is my situation, I have different input, each of them them having a <input id="q1a2" type="radio" name="q1" value="1" tabindex="-1"> <input id="q2a1" type="radio" name="q2" value="3" ...
0
votes
1answer
29 views

Is it safe to add a new field to meta_value field?

I'm trying to offload Wordpress images from my web server. I've successfully moved everything over to Amazon AWS and have a syncing mechanism in place that uploads new images to AWS. Now I would like ...
0
votes
1answer
466 views

Create Shortcode shows only posts with custom_field meta

I want to create a shortcode, which shows only the posts that have the definite meta_value. I use the ACF Plugin for different meta-fields. I have the post type "publication" and e.g. want to show ...