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

learn more… | top users | synonyms

0
votes
0answers
50 views

Use and get custom user metadata

I wanted to check if a post custom field matches the logged user's custom metadata. If it does then list only posts that match. I think that's possible.
0
votes
1answer
2k views

Search custom post type by meta data

I have a custom post type 'Property' which my users need to be able to search by meta data. I have 3 search functions - 2 on the frontend 1 in the admin area - 2 of which are running as expected and ...
1
vote
1answer
123 views

populate post meta in gravity forms [closed]

I can populate post author email with this code: add_filter('gform_field_value_author_email', 'populate_post_author_email'); function populate_post_author_email($value){ global $post; ...
0
votes
0answers
406 views

Adding custom fields to the Quick Edit screen - puzzled about the column concept

We've been told that: The quick_edit_custom_box action hook will not fire unless there are custom columns present. (Source^) If so, then adding a custom field edit functionality to the Quick ...
0
votes
1answer
52 views

Meta box losing its value when scheduled post is published

I've created a plugin with a meta box that has a check box and noticed that when a post goes from scheduled (future) to published the meta is no longer checked. When I schedule the post and check the ...
0
votes
0answers
90 views

Advanced Custom Fields: wp_get_attachment_url not working, attachment page says “Missing Attachment”

I used Advanced Custom Fields to add a file upload field to a custom post type. I have the following code in the template for this custom post type: $file = get_field('file'); echo ...
0
votes
0answers
36 views

How to re-run the main query based on meta data value?

When a user requests a custom post url like */books/best-book-eva, I want to (with a plugin) hook in before the page is displayed (and the main query run if possible) check that posts meta value ...
0
votes
1answer
64 views

Is there a filter for get_post_custom()?

I know there's a filter get_post_content that I can hook into, but that only seems to work with get_post_meta, I need to filter individual values of get_post_custom() by checking if the metadata key ...
0
votes
1answer
191 views

How to get meta value in wp_attachment_metadata

I want to get wp_attachment_metadata in my own way. I want to separate the sizes (Thumbnail, Large, Medium, Small). The meta value on database looks like this: ...
0
votes
1answer
62 views

How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?

Using the below hooks, I tried to rewrite the permalinks of my custom post type magazine_issue to be made of values of additional meta-fields I added to the edit screen. The problem with my actual ...
2
votes
0answers
80 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
0
votes
1answer
69 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
2answers
157 views

Front end file upload returning wrong attachment url

So I'm making a simple file uploader with wordpress where users don't need to go into wp-admin to add a file. I have it working great, it uploads the file to the correct folder..etc but the only ...
0
votes
0answers
21 views

How to sort post_meta in edit.php?

I have Custom Type cpt1 and Custom Fields cf1, when you use hook manage_cpt1-bien_sortable_columns, wordpress don't sort the post_meta ?
0
votes
1answer
1k views

Adding custom fields (post meta) before/during wp_insert_post()

Our code base has a ton of logic that executes as the post is inserted/created. However, some of that logic depends on custom post meta. The only way I know of to add post meta to a new post is like ...
1
vote
1answer
1k views

advanced custom fields update_field for field type: Taxonomy

I need to insert a post via wp_insert_post and then add relevant post_meta - however, the WP admin has been customized with the excellent ACF. I know I can add_post_meta in this way: add_post_meta( ...
0
votes
0answers
59 views

Unsure how to add simple checkboxes that write to a small table to admin

I've been doing a lot of reading on the add_meta_boxes...but there's so much information that I'm confused about when to use them. I have a little plugin that writes out some checkboxes and then when ...
0
votes
1answer
163 views

Set Checkbox as checked by default

I want to add a checkbox in the post meta and set it as checked by default. I am trying following code, but it does not display the checked box by default. However it saves correctly and after saving ...
0
votes
3answers
164 views

Order by a meta fiel in query loop

I would like to sort my article from a category by a number added in a meta field. Here is the first step, I get the articles to display on the page. <?php $cat = get_post_meta( get_the_ID(), ...
0
votes
1answer
58 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
1k 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
0answers
41 views

Remove meta info for one specific category on all posts in that category

As for the moment each post on my site http://wonderfulwanderings.com (hope this is okay, just want you to know what I'm talking about) is displaying which category it belongs to. I would like to ...
0
votes
1answer
19 views

How to get pictures of the Wordpress post

During the post creation of a post in Wordpress, I add 2 pictures in the post Gallery. How can I retrieve uploaded pictures URLs to display them on the other template?
3
votes
2answers
1k views

Trying to get custom post meta through Jetpack JSON API [closed]

I'm using the Jetpack for Wordpress to produce a JSON API for my Events custom post type, which works fine: https://public-api.wordpress.com/rest/v1/sites/MYSITE/posts/?type=events&number=100 ...
0
votes
1answer
318 views

query_posts orderby postmeta

I'm trying to retrieve a custom post type and order it by a custom date stored in postmeta. The custom date is a unix timestamp. The meta_query works correctly - it only retrieves posts with a ...
0
votes
0answers
31 views

wp_postmeta are updated for only one page

Code below only updates wp_postmeta of one specific post, not all the posts. On other pages the meta_key is not even added to the table, so it is not the problem with saving but with something else, ...
0
votes
0answers
188 views

Add auto increment value to custom meta

I have a custom meta "code" in my CPT. How can I make it so that it has a number that will auto increment every time the admin publishes a post? My solution is to add a table in the database that is ...
0
votes
1answer
123 views

Custom post type submenu sorted by specific meta_key & meta_value

I have a created a custom post type called "Events" using register_post_type. I am now trying to create a submenu within "Events" that will only show events sorted by a specific meta_key and ...
0
votes
1answer
88 views

delete_post_meta() for whole CPT / multiple posts?

I'm cleaning up a theme and one of Custom Post Types has some odd, long gone custom fields. I want to delete them, unfortunately delete_post_meta() takes post->ID for an argument, while I want to ...
0
votes
1answer
63 views

Meta box values are displayed on Custom Fields list. Is it possible to hide them?

I have multiple meta boxes for my Custom Post Type posts. I want my users to add new fields using Custom Fields. The problem is - Custom Fields display all the garbage from my metaboxes and it might ...
0
votes
1answer
70 views

Wordpress postmeta: Store data as an array or single item?

I know it could be difficult to query a single item that saved in an array in wordpress postmeta table, but I have lots of metadata for a single post which may create too many rows for the postmeta ...
0
votes
1answer
357 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
3answers
545 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
1
vote
2answers
554 views

How to keep a check box in custom meta box for custom post type checked by default for add new post?

In my custom plugin, I have a custom post type and have a custom meta box for it. I have few fields in it, one of it is a check box. I want this check box to be checked by default when I go for a add ...
1
vote
2answers
158 views

Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?

There are a few plugins which can assist you in building your CPT's, and these can usually handle your taxonomies and sometimes postmeta also. Some even take it further than that. I know that as with ...
0
votes
0answers
66 views

How to create a custom search in wordpess matching with title and metadata

I want a custom search in wordpress where the search query should return results matching to post title or with a custom metadata. For example if a user is searching for "chicken" in my site, it ...
0
votes
1answer
424 views

WooCommerce custom taxonomy as meta?

I have created two custom taxonomies: (slug) = language (slug) = location On the single product page I would like to display these two as meta below the "Categories" and "Tags." Example: I found ...
0
votes
2answers
252 views

Trying to get property of non-object error using get_post_meta()

I made a simple function for post_meta, in functions.php: // Top Sub Heading (top_sub) FROM CUSTOM FIELD function topSub( $Trunckvalue = null ) { global $post; $TopSub = get_post_meta( ...
0
votes
1answer
62 views

How to query post ids liked by the Author

I'm using wti_like plugin and this is how i get the number(count) of post liked by the author // Get the author object $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); // Get the ...
0
votes
1answer
2k views

How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image ...
0
votes
1answer
116 views

Why does get_transient() always return string even if integer set?

I've been trying to bug fix the following method for hours now, and don't have an idea why it always returns a string, instead of an integer. The idea is to return a class property, if exists, or a ...
0
votes
0answers
94 views

Problem with inserting Iframe in post_meta with Cron

I am trying to automatically post from Tumblr to Wordpress. I've made some scripts that enable Wordpress to put the first image of the content as Featured image and put the first <iframe> in ...
0
votes
1answer
134 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
0
votes
1answer
280 views

Unique Post Meta Values

I want to use Unique IDs like YouTube video IDs and WordPress post IDs in a custom field 'youtube_id'. I just created a front-end add post page and want to check if 'youtube_id' used or not used in a ...
0
votes
1answer
81 views

Retrieve user_meta and copy to post_meta

As geo mashup only retrieves post_meta, I am trying to copy over the geo_location from a custom registration field into the meta for page containing the map. The code I am using is: <?php ...
0
votes
1answer
115 views

How to retrive Custom Post Type Meta Fields in Custom WP_Query

Can some one let me know How I can render the Custom Post Type Meta Fields (Meta-boxes). I have a Custom Post Type Called "News" and I successfully added a Metabox to my Custom Post Type called "News ...
0
votes
1answer
414 views

Gravity Forms Update post meta from template [closed]

I created a form called 'Books' which has the fields: Title (Post Title) Author Genre (Dropdown - fantasy, horror, drama... etc) ISBN Number Status (Dropdown - Default Option - Published, additional ...
2
votes
1answer
863 views

Get all posts from custom post type and insert in select input as metabox

I would like to know if its possible to do something like this. I have Slider custom post type and Services custom post type. For slider posts I have created a metabox for URL value to display next ...
2
votes
1answer
233 views

Save default value for empty or missing post meta

I am using WordPress and I am using a custom field that has the name ecpt_carprice for each post I am publishing, the field is saved in wp_postmeta the same as the attached image: Some of my cars ...
0
votes
3answers
2k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...