Post meta is a data set containing additional core as well as custom post information.

learn more… | top users | synonyms

1
vote
0answers
23 views

WPDB Multiple site's posts and get featured images

I am using the code below to query 5 Wordpress sites for their posts, merging them into an array, sorting the array by date, and then displaying them: //SITE 1 $mydb = new ...
-1
votes
0answers
15 views

'Gravity Forms + Custom Post Types' plugin map Multiple Fields Into one meta_key field as array values

we're using Gravity Wiz's awesome plugin 'Gravity Forms + Custom Post Types' plugin. Specifically, we're using this as a way to provide front end custom post type creation/editing on the front-end for ...
6
votes
1answer
65 views

What is “meta_input” parameter in wp_insert_post() used for?

I am inserting some post into wordpress using the function wp_insert_post(). I want to insert some custom fields on each post and reading the documentation I though the meta_info parameter was used ...
1
vote
1answer
16 views

WordPress Post Visibility Options for Frontend

I want to have a code/clue to add "wp post visibility" option for front-end. I will use radio buttons get a value from user. e.g. if user selects "No" the post will become private else if user chooses ...
1
vote
0answers
17 views

Show Custom Post Type meta boxes only on Page Edit

I've went through the laborious process of creating the CPT. I see it on the sidebar of my WP install, I can add new, save data, and on frontend I can output the data. Is it possible with WP to move ...
0
votes
0answers
26 views

Update post meta does not serialize array

For some reason my update_post_meta() function does not accept an array. Normally the function serializes the array by itself, but now I need to do this by myself, otherwise it does not update. Could ...
0
votes
0answers
23 views

Using esc_html for textarea inputs

I am using the following code for a variety of input fields, building a CPT for a theme: function display_meta_box_from_cpt <input type="text" size="80" name="imgurl" ...
0
votes
0answers
8 views

Set all values of given meta_key in postmeta?

I have a custom post type to which I attached several fields of meta data. On a given action in the admin, I need to be able to reset the values of a specific meta_key in that meta data to zero for ...
0
votes
1answer
26 views

Sort by meta value num, but ignore zero value

I have custom-post-type 'company' and taxonomy 'services' fot this CPT. I have created meta-field 'service_XXXX_price' (where XXXX is service id) for companies and fill this field with number. If this ...
9
votes
2answers
119 views

Explanation of update_post_(meta/term)_cache

I was reading over some best practices from 10up and they mention setting these two flags to false in a WP_Query ( depending on what you're querying ): 'update_post_meta_cache' => false: useful ...
0
votes
1answer
18 views

How to get posts with a metadata numeric key greater than X?

I'm trying to add a "Highlighted" section for each category on my website. This will be located in a page, using a shortcode. I'm going to add a new post metadata key which will be a number from 0 to ...
0
votes
1answer
23 views

Query posts according to specific post meta values

I have a loop in my index.php for my home page like this... <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> I have a function to query the posts by ...
0
votes
1answer
6 views

wp_get_attachment_metadata()['image_meta'] fetch WP metadata or EXIF?

wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) )['image_meta']['credit'] returns nothing although there IS information in the attachment's credit field. Is ...
0
votes
1answer
16 views

post_name is not stored until post is published… where should I store my slug until it goes live then?

important try as normal contributor user, not as admin see here I actually have it reproduced. Seems like a bug to me but whatever. I want users to choose their slug. Well, as you cannot store ...
0
votes
1answer
17 views

Sort by meta key within same day

I try to build something that can sort posts by day - and whithin the same day sort them with any meta value (integer) - like popularity or vote or what have you. So that, in the end, i get today's ...
0
votes
1answer
31 views

Delete custom meta

My custom meta box correctly saves my file upload. When the user wants to clear the field, they can click delete and I want to delete that meta data of the file url only. How can I assign the meta_id ...
0
votes
1answer
19 views

How can I get the post ID from a WP_Query loop?

I have a WP_Query loop that gets posts of a certain type. These posts have custom post meta so I need to be able to get the ID of the post without echoing it so I can display that post's meta. How ...
0
votes
1answer
42 views

How to create html block to display extra information on woocommerce single product page

i am using this theme for my website, it has tour booking facility with wocommerce, i am using external am using third party booking, they give me link & i simply paste it in each tour (product) ...
1
vote
1answer
37 views

Order posts by meta value and Date

I'm trying to sort posts based on one post meta value and date. I'm using this plugin ( https://github.com/JonMasterson/WordPress-Post-Like-System ) to add like system to my posts. The code that ...
0
votes
0answers
11 views

Button inside a custom meta box which deletes post meta

I have a custom meta box which allows a file upload. I want to add a button for my users to be able to remove the file (or at least clear the meta data for it). To delete the post meta, I know I can ...
0
votes
0answers
21 views

Filter question list on substring of metavalue

On the admin page I want to filter posts based on meta values. I know using the pre_get_posts hook will allow me to filter based on specific meta values, however I want to filter on a certain ...
1
vote
0answers
30 views

Get draggable widgets on Edit Post page

Is it possible to get the widgets with settings (just as widgets.php page) on the Edit post (like attached image) ? There i can define a custom sidebar in post meta. However how to get the list of ...
1
vote
1answer
28 views

Delete post meta conditionally after save post

I want to update/delete a post meta when a custom post (in this case custom post type is "booking") is updated upon the change of post meta . In my case if user change the post meta booking_status to ...
0
votes
1answer
18 views

Post Meta for Custom Post Types

I am using WordPress to build a job website and a huge portion of my website is involved with storing and retrieving user information to and from the database. There are three types of custom posts ...
1
vote
0answers
37 views

Default Custom Field Value Automatically Update

I have created a hidden custom field with a php function as its value. Like so -- $value_rating = get_post_meta($Property_Id, 'vr', true); <input type="hidden" name="vr" class="form-control ...
-1
votes
2answers
55 views

How can I add a custom meta value on file upload?

I am looking for an option where a custom meta value will be saved when user uploads an attachment. Lets say I need a meta key _example_meta_key and want to save meta value of this as ex087659bh (It ...
0
votes
1answer
18 views

Delete custom post type metadata without deleting the post in admin area

I'm working on a plugin for a client and they need the ability to attach a couple of PDFs to a post as metadata. The client will need to occasionally update these attachments but without deleting the ...
0
votes
0answers
21 views

Find page metadata in database

I want to insert metadata to custom fields (from "advanced custom fields" plugin) manually (with wp_update_post_meta). I need to know how the meta value strings look like so I can insert this kind ...
4
votes
0answers
75 views

Get ID of a page containing secondary loop in content

I am trying to get the ID (outside of loop) of a page which have a loop of another CPT within its content using a shortcode. If I do a print_r of get_queried_object(), all I get the args used to ...
1
vote
0answers
15 views

Show values of custom post meta on 'Add new post' page?

I am developing a website in which I am giving my users a separate profile. Their profile includes a dynamic slider. I made a custom post type named 'Slider' and added all images using: ...
1
vote
1answer
32 views

Delete all post meta except featured image

My aim is to clear up my database entries. I did a migration from blogger which added many useless post_meta. I found a plugin (db reset) that has the option to reset/delete all post meta. However if ...
0
votes
0answers
16 views

Edit is changing my custom's post type parent id

I'm having a custom post type (vehicle) and i attached a gallery (post) with image attachments in it. Through my custom frontend form, I set all the post and postmeta details right, as i want to, so ...
1
vote
0answers
33 views

How can I create a WP_Query that returns posts where one meta_value <= another meta_value

I have a working, pretty complex SQL query hand-written in a function. For the sake of leveraging WP_Query optimizations, and simplifying my code for maintainability, I'd like to convert it all to ...
0
votes
0answers
14 views

Trying to automatically set woocommerce product dimensions on save if left empty

So I'm trying to automatically set product dimensions & weight on a site if they're left empty, WooThemes told me I can use this as a starting point but the rest is out of their support scope. ...
0
votes
1answer
73 views

Update post meta in woocommerce order frontend

I will that the custome can update in the order the custom fileds (who was insert in the checkout page) I have this code in the order-details.php Page but it show only the value in the input but he ...
0
votes
2answers
40 views

Add multiple meta keys to a post at once

I figured how to add an input value as a meta key value to a new post from a frontend post form (thanks to @thedeadmedic), but I can't figure how to add two or more meta keys at once. Is this possible ...
0
votes
1answer
22 views

Add a meta to a post submited from a frontend form

I use a frontend form by @TheDeadMedic to post regular posts. I figured out how to add to this form a category and a location (custom taxonomy) dropdown menus, and also how to sanitize and how to ...
0
votes
0answers
40 views

Show posts in numeric price order using meta query combining 2 meta keys

I've built a custom estate agency website for a client but I'm stuck on this one last thing before it's good to launch. I'm using custom meta fields to allow for additional meta data such as Price, ...
0
votes
0answers
8 views

Generate meta_value programatically for thumbnail in Ruby

I am inserting posts in wordpress db using ruby. The problem is that adding a post thumbnail, there is a met_value field in post_meta table that has an auto generated hash which looks like ...
0
votes
1answer
25 views

Get post_meta from specific post [closed]

I'm trying to get the post_meta from a specific post. However: the following code breaks my document: $img= get_post_meta('4996','ATHLETE-side_img'; Then further down in the code I was planning ...
0
votes
1answer
64 views

How to add together (get the sum) a field from all author's posts

Using the plugin WPeddit I want to count the epicredvote score from all posts of an author together to get the sum. The following is a custom field that puts out a score, like "3" or "-2" or ...
0
votes
1answer
32 views

Compile meta values from custom loop into array and then calculate sum total

I tried explaining this yesterday but I fear I made things more complicated than they needed to be. I have a custom loop that pulls through standard Wordpress posts with various arguments. $args = ...
0
votes
2answers
52 views

Order by post meta value gets random results

I want to order a custom post type by post meta field. This query works fine partially and load results. The problem is that the order of results vary at each time this query is executed. I have ...
0
votes
1answer
23 views

Count of posts by different parameters?

I need to get the count of posts (just a number, nothing else) by custom taxonomy AND post meta(string) but I can't find a good way to combine them both. Im fairly new to programming & WP, Im ...
0
votes
2answers
102 views

Get post id within comments loop

I have a custom comments loop on my author.php page. I am trying to get the post id so that I can echo the permalink for the post that the comment belongs to. Also so I can echo some post meta custom ...
3
votes
2answers
111 views

Is there a hook / action that is triggered when adding or removing a post thumbnail?

I'm trying to update a custom field after a post thumbnail (Featured Image) is either added or removed from a post. The aim of this is to keep track of whether a featured image has been added or ...
0
votes
0answers
30 views

Insert image caption (metadata) in shortcode in functions.php

I've created a shortcode that displays a random image given that certain parameters are filled, like img url and number of images to random through. It looks like this: function randimg_shortcode( ...
0
votes
0answers
91 views

How to find field key name of meta values ?

Using visual composer to create custom grid elements made me wonder: how can I find the field key name of a meta value ? I need these to include in a template of a grid element or for different ...
0
votes
0answers
19 views

Custom Table for custom post type meta data

I'm looking to store the meta data for a post type in a uniquely named table. You see I have a site with a large amount of custom post types with a large a mount of custom fields. I want to clone ...
0
votes
0answers
7 views

How to use Wordpress Functions in php file linked to email piping

I'm writing an plugin to add meta data to a post when I receive an email. So far my plugin receives the email correctly, but I need the WordPress functions to update the metadata. I can already get ...