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

learn more… | top users | synonyms

0
votes
0answers
8 views

Pre_get_posts meta query value serialized array using multiple URL parameters

Using the 'pre_get_posts' action I'm looking to return all posts which match multiple URL parameters by defining the meta_query. For example: example.com/?size=large,small&options=green,blue,red ...
0
votes
0answers
11 views

Create new table vs post_meta table database dilemma

I'm working on custom function that will store post data but I dont know which method to use. I have meta box in edit post area that will store diferent videos (embed code) for each post will have ...
0
votes
0answers
8 views

How To Add Custom Meta Field Select/Radio Box to Post List Bulk Edit Mode

How can you add a radio fieldset to a custom post-types post list bulk edit screen for a custom meta field? Please provide in depth code example and explanation and thanks in advance. The ...
0
votes
1answer
13 views

Structure of postmeta meta_value for woocommerce product download

So I'm working on a monster script to port all of our existing stuff from Joomla/Virtuemart to Wordpress/WooCommerce. So far I've got just about everything done with moving over our product ...
0
votes
0answers
11 views

Need to make a “Meta Box” for Post search

I have a theme, where i can associate post with page there is called ( Hubs ) its part of the actually page. I have figure out so much that when i post a news about something, and it have to go into ...
0
votes
1answer
15 views

Storing post_meta fields in array

I need to have 8 separate post meta fields on each post in wp-admin (shown in a custom meta field box). I'd like the data from these 8 fields to be stored in an array as one post_meta field for easy ...
1
vote
1answer
96 views

How do I add advanced custom fields / meta fields to Elasticsearch? [closed]

I am using the plugin ElasticPress. I'd like it to index some extra (advanced custom) fields. The only info I can find is this comment by one of the developers: [...]if you would like to add ...
0
votes
0answers
30 views

How can I convert this SQL query to delete duplicate posts by specific meta_value instead of post_title?

This query works exactly as it should to DELETE all duplicate posts by post_title for my custom post type: $sql = " DELETE a.* FROM wp_posts AS a INNER JOIN ( SELECT ...
0
votes
0answers
17 views

Convert meta description into corresponding excerpts / yoast seo plugin

I m using Yoast SEO plugin on my blog. I never filled excerpts manually, but filled the meta description for each posts. But now for some reasons i need to use get_the_excerpt hook and I have never ...
4
votes
2answers
163 views

What is the different between an attachment in wp_posts and an attachment in wp_postmeta?

After the Woocommerce dummy products are imported, I notice that in the database, there are different records in different tables but point to THE SAME photo attachment. The question is why? What are ...
0
votes
4answers
104 views

Remove href tag from wp_postmeta in 34,000 posts?

I'm using Godaddy Hosting, PHP 5, and Wordpress 4.2.1 I have 34,000 + posts that need outdated href tags removed. I am able to remove tags, one post at a time, by using this code in a page template ...
0
votes
2answers
36 views

WP_Query Posts by Metadata from Option Tree

I am doing a WP_Query trying to filter out the posts by Metadata. $args = array( 'ignore_sticky_posts'=> 1, 'post_type' => 'post_projects', 'post_status' => 'publish', ...
0
votes
0answers
15 views

how to show posts based on meta value for a logged user in admin pannel

I need to show posts in admin panel based on meta value. I have a meta box when logged in user want to add new post, he should checked the users in meta box that can view that post. when that user ...
3
votes
1answer
82 views

Use REGEXP in WP_Query meta_query key

I know I can use REGEXP in WP_Query like this: $query = new WP_Query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( ...
0
votes
0answers
20 views

Wordpress User Meta Open Graph and WPSEO Yoast different in production and staging environments

When using Facebook share to share a link I have been using WPSEO and custom hooks to update the Open Graph meta information based on custom parameters in the url in the theme's function.php file. /* ...
0
votes
1answer
35 views

WP_Query - Accessing MetaValue from Query Result

Have this code. In doing a var_dump the meta_value is being retrieved under public object meta_value. I'm trying to access this data in a "WordPress" away instead of a more traditional PHP way. What ...
0
votes
1answer
79 views

Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]

In woocommerce, I've got a bunch of products, which all have a certain material assigned. My current implementation of a material is a CPT (with about 20 fields (color, transparancy, reflection, ...
0
votes
1answer
38 views

Disable Facebook Comments Automatically On CPT

I am working with the Facebook comments plugin. I have a custom post type that never uses Facebook comments. I am trying to create a function to automatically turn these off when the custom post ...
0
votes
0answers
27 views

WP-API : post_meta not updated… but have another entry

When creating a post, I put some post_meta here is the code for the creation edition and deletion of a post https://gist.github.com/eduplessis/dc530523f0b98ae233dc and here is the result of the ...
1
vote
1answer
54 views

Execute action after post is saved with all related post_meta records (data)

I have to execute custom PHP code after new post is saved with all it's meta data. My question is how to achieve that? Tried with save_post action, but it executes before meta records are saved, so I ...
1
vote
1answer
55 views

Sorting and limitation with pre_get_posts

This is my third question regarding WP queries and pre_get_posts (sorry about that) but I cant give up one step before the full success :) So the story - my query is limiting front page posts to ...
4
votes
4answers
192 views

get registered metaboxes by post type or post ID

I am looking for a method to get the registered metaboxes for a specific post type (or post ID) when on a separate, unrelated post type. I am working on making a custom "editing" post type for a ...
4
votes
1answer
127 views

How can merge two arrays values in one array and save in database

I am working on WordPress upload meta fields. When user upload images the images are sized in two dimension one is "thumb" and one is "big" and they re sized very perfectly. I save both of images ...
0
votes
0answers
18 views

Dynamic CSS for CPT that requires post meta data

I have an, admittedly weird, CPT structure. I have two CPT's, one is 'section' - which is basically meant to represent a tag in HTML - and the other is 'sectioned_page' - which displays user chosen ...
0
votes
1answer
30 views

Why is get_post_meta returning an array when I specify it as single?

The documentation from get_post_meta makes it sound as if the single argument will determine whether or not meta values are returned in an array or not. For example: // If I set single to false, or ...
0
votes
1answer
25 views

Display post meta conditionally based on it's value

I have a custom field that's a radio button with 3 choices (yes, no, other). What I'd like to do is the following: [If custom field value is yes] Display something here [elseIf custom field value ...
0
votes
1answer
31 views

Can't get post ID using wp_insert_post_data

I have 3 custom fields as shown below. I want to use them to generate the title when I save/publish... etc The code works if I insert the post id as a number but not like this... function ...
0
votes
0answers
19 views

How to manipulate Wordpress custom fields to implement OG Tags on individual Posts

Hello my name is Erin and I have just started sharing my website content onto Facebook. The problem I've run into is that I can not control the description, image or title of the post. After doing ...
0
votes
1answer
18 views

How to add post reference field to a plugin?

I am trying to add a field to a custom post type through a plugin I am creating. One of the fields I need is a post reference / link to field. Any ideas on how to do this? In the WYSIWYG when you ...
0
votes
1answer
22 views

Filter query posts by the count of metas for a meta key

I know it is possible to filter queries to order posts by the numeric value of a meta. For example, I store the number of total likes for a post in a single meta key : ...
0
votes
0answers
15 views

Detect DOM Changes in Custom Metabox

I have a scenario where I use a custom metabox that contains two tables. One table contains a select list which a user can then add details about the selection. When complete, they click a button to ...
1
vote
0answers
31 views

How to compare two posts including their meta fields on a scalable base?

I have set up a wordpress in a way that posts can be cloned and be altered by a different author. whenever this is the case, i want the administrator to be notified via an additional tab in the ...
0
votes
0answers
16 views

help with wordpress post_meta saving and updating

i have this code which works fine, i can input information, save information, retrieve information no problem but if i want to erase an existing information to leave the field blank it will not erase, ...
0
votes
0answers
44 views

set s3 image as a featured image in wordpress post while posting the post programatically from an external source

I am pretty much new to wordpress. My requirement is that i need to make a post from an external source using ajax to wordpress site. The post data merely contain "posttitle,description,etc..." and an ...
0
votes
1answer
19 views

Save values generated via API as custom meta fields

I'm using the IMDB Connecter plugin to grab meta data for movies and I'm wondering if I can save some of the information it generates as custom meta data. Basically, I want to be able to save the ...
1
vote
3answers
83 views

Orderby meta_value only returns posts that have existing meta_key

I have the following wp_query: $args = array( 'post_type' => 'news', 'orderby' => 'meta_key', 'order' => 'ASC', 'meta_key'=>'custom_author_name', ...
0
votes
0answers
64 views

Undefined index error in custom post metabox

I'm getting this error with my custom post metabox. The custom post and metabox works fine, but if i have debug on and when i try to save any other page or post, i will get an error: Notice: ...
0
votes
1answer
58 views

Get $post->ID from a URL

I have a custom post type called music. I have created a custom template as a normal page to show some stats for the musicians. I have a page where they can see all there songs and have added a ...
0
votes
0answers
39 views

Meta query compare timestamp if exists

I have a custom post type with a start and end date timestamp. These fields are not required so they may not exist. What I want to do is query and show all posts that don't have the end date set or ...
1
vote
1answer
41 views

Safe to delete blank postmeta?

We have a lot of rogue custom fields. I feel that we can clear significant space in the DB if we remove the blank values. If I query my database with the following: select * from wp_postmeta where ...
1
vote
1answer
38 views

Custom post meta values reset by autosave [duplicate]

I have created a post view counter plugin that increments a count each time a post is viewed/refreshed. The count is working fine however if editing a live post the autosave functionality appears to ...
0
votes
1answer
80 views

Reduce or prevent calling of update_meta_cache

My theme calls the update_meta_cache() function 58 times per page! This function appears to run the following query based on the post in question: SELECT post_id, meta_key, meta_value -> FROM ...
0
votes
1answer
80 views

Change meta tags programatically

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property="og:title" content="title" /> <meta ...
0
votes
0answers
20 views

Define meta fields in a page template

I had an idea for managing fields for page templates and I thought I'd post it here to see if (1) this is terrible and (2) if there's a better way to define the fields in the template. Here's the ...
0
votes
0answers
42 views

Custom post type term names with ampersand in the term name

Every time I think I've got a handle on WordPress it finds a way to baffle me. Recently we've been having an issue with not being able to attach term names with an & (ampersand) character in the ...
1
vote
0answers
45 views

Custom filter function not working with Custom post type

I have custom post type "soto_property". I have made a custom filter to filter post listing according to used meta data named "operations". Here is my code- <?php add_filter( 'parse_query', ...
0
votes
1answer
29 views

use post meta in add_meta_boxes action

Is there any way to use get_post_meta within a function called by the add_meta_boxes action hook? I only want to display the meta box if a specific post meta matches a regex, but so far, I have not ...
1
vote
0answers
59 views

Storing revisions of metadata for custom post type

Storing metadata for custom post types is easy, you just need to add an action for 'save_post' with your method that handles this. In which you have then something like the following for a field that ...
0
votes
1answer
47 views

Read post meta values, only if posts are public

I want to retrieve meta_values applied to posts. Currently I execute the following query global $wpdb; $table = $wpdb->prefix.'postmeta'; $values = $wpdb->get_results( "SELECT meta_value ...
0
votes
0answers
7 views

Moving WordPress Featured Image Box Below Title [duplicate]

I would like to move the featured image box just below the title field in the New Post admin. I tried the following code, but that just places it below the text editor. function ...