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

learn more… | top users | synonyms

3
votes
0answers
177 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 ...
2
votes
0answers
29 views

publish_post action hook doesn't give post_meta_data

I write the following function to get the post data on publish post but i see that post_meta is not available, its always empty. How do i retrieve the post meta data of a post on publish_post hook? ...
2
votes
0answers
845 views

Copying Custom Meta Values from existing post to a duplicate post

I'm trying to revise an existing WP plugin BU Versions to accept different custom meta field values from items I've set-up using the Advanced Custom Fields (ACF) plugin. BU Versions will copy over ...
2
votes
0answers
382 views

Querying posts with meta value that begins with a certain pattern

I am trying to create a search filter using meta_query. The only problem I'm having now is that I can't compare with wildcards. I think that's how you word it? $keyword = 'sos'; $tlds = array('com','...
1
vote
0answers
35 views

Get registered custom fields or post meta even if empty

I would like to be able to get all registered custom fields or post meta for a given post. The limitation I am facing is that the use of either get_post_meta or get_post_custom returns an array of ...
1
vote
0answers
27 views

hide posts with specific meta data from admin page

Does anyone have ideas on how to hide posts which has a metadata with a specific value from admin panel (the posts table which is shown when clicking all posts option from posts tab) thank you in ...
1
vote
0answers
24 views

How to retrieve an array of post IDs by a particular value stored in a custom meta's array

I have a custom post type 'projects' that has custom post meta 'members'. 'members' stores an array of another custom post type's IDs. I'd like to do loop through the 'projects' posts that have a ...
1
vote
0answers
46 views

Dynamic Custom Fields

I am working on a custom invoicing system for a client. I am looking for the best way to implement adding products dynamically to the invoice in the wordpress admin. There are hundreds of products ...
1
vote
0answers
31 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 ...
1
vote
0answers
33 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
0answers
50 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
vote
0answers
17 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
0answers
36 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 ...
1
vote
0answers
131 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 edit....
1
vote
0answers
394 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: ...
1
vote
0answers
127 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', '...
1
vote
0answers
567 views

Compare meta_query with a Regular Expression and do a less-than operation on it

I have the problem that my client is using a theme which stores options of items in a serialized way in the post_meta table. I already found out that this is not the best way to save values ...
1
vote
0answers
69 views

Post MetaTable Overload

Anyone run a wp site with a large amount of post meta data? My site uses ACF with several custom post types and at least 20 custom meta fields with each of my custom post types. I have over 1000 ...
1
vote
0answers
126 views

Custom RSS Feeds & Post Meta Data

Rss feeds normally display media files along with post excerpts. I am using post meta to add media files to a post. Unfortunately, since the audio file is not being inserted into the main textarea the ...
1
vote
0answers
115 views

Add Embed.ly API objects to post_meta on update

I created a new post type fr_news for adding news to a site. The user inputs a URL, and what I want it to do is use the Embed.ly API to display the news. I've got the API side figured out. Here's the ...
1
vote
0answers
1k views

Custom WP_Query for WordPress Search Results with meta_query

I am using a custom query to generate my search results. The code I am using works perfectly without the meta_query variables in my arguments array. I am trying to compare multiple custom fields with ...
1
vote
0answers
181 views

Attach time/date stamp on add_post_meta

we have an image viewer on our website where admins can tag images thought ajax (new feature on Wordpress 3.0). We are tagging just fine, but we need to filter when they were tagged. We are using ...
1
vote
0answers
108 views

How to increase load time of an archive/search page (WP_Query)

I'm currently looking at why the archive and search pages take so long to use, and have found that the bulk of processing time is spent on the query_posts that is called before the template has even ...
1
vote
0answers
118 views

Function to update post_meta based on existing post_meta

I have a custom post type for addresses on a Google Map. One meta field is for the address, but I want to convert that address to longitude/latitude. So I have a meta field for longitude & one for ...
0
votes
0answers
19 views

Transform post publish date fetching code into i18n format

I'm using Visual composer and I have a grid element which shows post date. The problem is - it is showing in English, while the site is in Bulgarian. I think I need to fetch the date in i18n format: ...
0
votes
0answers
9 views

Save and return input type is text on custom post type

I've got the following problem, and have been looking for way too long to solve it. I've made my custom post type, and custom taxanomies, and those all work great. But now I want a custom fields to ...
0
votes
0answers
12 views

Twentysixteen theme single post category display

Our site uses the twentysixteen theme and some posts are listed in more than 1 category, eg. Events (parent) & Skateboarding (sub category) Can anyone help me so the single post displays only the ...
0
votes
0answers
12 views

Add custom field on the page post-new.php

I've made 2 new custom collumns in my MySQL DB in the wp_post table. And i would like to insert there some text which i will take it from a textfield insite post-new.php As far as i can see, i have ...
0
votes
0answers
20 views

How can I get post meta data (custom field) from within a custom wordpress action hook?

I have a custom hook in my theme which is set up like this: do_action('my_custom_hook'); That code is in my header.php file and outside of the main loop. I have a call to this hook like so in my ...
0
votes
0answers
5 views

Theme only saving post fields set by the author

I have a theme I'm customizing and every time I try add my own post field (meta data) nothing gets saved yet the fields set by author do. Is there something I'm missing or are there any restrictions ...
0
votes
0answers
12 views

Delete single meta row from multiple meta rows under same key of a post

I'm storing meta data for my posts using a single key, so it's creating multiple meta data. <?php $data = array( 'user_id' => $user_id, 'message' => $message ); add_post_meta( $post_id, '...
0
votes
0answers
22 views

WP Meta Query at depth 2

I'm interested in doing a meta query according to some post data that doesn't exist at the first level of the post meta. In other words, I would need two or more keys to get to the variable I'm ...
0
votes
0answers
26 views

Sharing tables between 2 different websites based on the same database

I have 2 different websites installed on the same database. The 2 websites are sharing the users tables, but I want them to share the posts tables too. I tried to do it by editing wp-db.php. After ...
0
votes
0answers
27 views

Grabbing data from Meta Box

I am using someone elses code for uploading files to a custom post type, and I need to be able to get the URL back from it. In the editor, the value is the URL so that isn't an issue, but I need to ...
0
votes
0answers
27 views

Storing a many to many post type relationship in post meta and keeping SQL ability for Joins

I have 2 Custom Post types and i am manually keeping a relation between them in a many to many relationship by keeping an array as a custom field. All PARENT post types have ONE filed in wp_postmeta ...
0
votes
0answers
29 views

Use $wpdb->get_results with filter based on array

I need to filter my SQL query (in a plugin) based on an array of meta_values. I have CPT-A which is related to CPT-B. I am keeping an array of CPT-A ids in meta_key afz_entry_tags of CPT-B I need ...
0
votes
0answers
20 views

Does get_post_meta result in a database query each time?

I want to add some new functionality to a post type. It is going to result in a dynamic number of meta fields. I want to know if i could consolidate the content into a single field (messy) or to ...
0
votes
0answers
26 views

Missing Post Meta and '0' value or meta ID

I have a custom plugin that saves metadata to the DB and has been doing so for months. All good. My latest issue is that post_meta values are disappearing (post title, content and taxonomies seem to ...
0
votes
0answers
120 views

How to show twitter link preview (Card View)

I want to ask about my problem. I can't show twitter link preview for my website and for information, I just add this code i get from WP Beginners <?php #twitter cards hack if(is_single() |...
0
votes
0answers
39 views

Why are my custom metaboxes not updating the post meta?

It works fine when creating a new post, but nothing happens when I edit a post. What am I doing wrong? function imgw_save_contest_meta( $post_id, $post ) { global $post; if( $post->...
0
votes
0answers
58 views

How can I make my plugin display custom post meta data on the front end?

I have been googling this for quite a while but have come up with nothing. I am writing my own plugin and I need to display custom post meta fields on the front end on the archive page. How can I do ...
0
votes
0answers
22 views

Custom Fields with pre-filled content

as this is my first post here I first of all like to say "Thanks" because I found a lot of hints here for my problems in the past. Now I have to ask for the first time: We are offering news under ...
0
votes
0answers
35 views

add_post_meta only adding 1 character

I am trying to make a form that auto posts without needing to be signed in. So far I'm testing with dummy data, but I'm running into trouble with the add_post_meta part. It seems to only be adding 1 ...
0
votes
0answers
27 views

Order by meta_value_num issue

I am using meta_value_num to get the list of teams by their ranking, it working fine in 1,2,3,4 etc position, but in case of 11th, 12th, 13th etc position it consider them as a second position, the ...
0
votes
0answers
22 views

How to avoid duplicate post entry admin page

I am building a cinema website with different custom post types. How do I avoid duplicate post entries? For example, I have a post type: Trailer First I add a trailer Terminator. After if I add ...
0
votes
0answers
38 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" placeholder="http://www....
0
votes
0answers
23 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
0answers
18 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 ...
0
votes
0answers
32 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 ...