All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

How To Tell If a Custom Field Was Made with ACF, Metabox.io, Carbon Fields, Custom Built, etc?

I am working on a plugin that will be using custom fields, but was curious if there was a way to tell which plugin/library created those custom fields. The reason I am trying to find this distinction ...
0
votes
1answer
62 views

Allow HTML in Custom Metabox area

I know there are many questions related to my question, but sincerely i was unable to get solution. My question is simple, how can i allow html in textarea in custom metabox on post. So far i have ...
0
votes
0answers
82 views

get custom post meta inside custom taxonomy

Hello I create a taxonomy for one of my custom type and add meta field on the backend , I would like to display it in the front end , my code is currently: Could you help me ? /* Add Image Upload to ...
1
vote
1answer
91 views

Hide custom meta data if empty

I have a custom field created for WooCommerce products. I am using the below code to create // ADD CUSTOM WOO DATA add_action('woocommerce_product_options_general_product_data', '...
0
votes
0answers
21 views

Generate post content from meta fields

I have a custom post type (match). Each posts on this CPT has one ore more custom fields. Is it possible to automatic generate the 'post content' with the value of my custom fields on these posts? ...
0
votes
0answers
12 views

Is it possible to remove a conditional value from WordPress custom metabox

Here I have attached the screenshot from MySQL for easy understanding. In this meta value a: denotes total no of users liked the post. User denotes user with id user-id My question : Is it possible ...
0
votes
1answer
65 views

copy images from custom field to another custom field

On my wordpress site I have a front end form that allows users to create posts and upload photos for a custom post type 'Property'. Using the following function - $property_sights_value = ...
0
votes
1answer
36 views

How to store multiple custom meta box

I am trying to store a multidimensional array of a Quiz where I dynamically add question box. But I am not able to figure out how to store dynamically added question box. The code is below function ...
0
votes
1answer
51 views

ajax delete value from custom field array

I have on my page a multi file upload that saves post attachments within a custom field --- if (!empty($_FILES['vidPix']['tmp_name'][0])) { $i = 1; $files = $...
0
votes
1answer
90 views

Save attachment custom fields on front end

I have a front end post form that lets users upload multiple photos and on there I have 2 input fields to try and save custom meta data for each attachment - $vid_pix = get_post_meta($v_Id, 'vid_pix',...
1
vote
2answers
59 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
1answer
56 views

Add custom field information to source meta data

I try to add information from a custom field into the metadata in the source code. While searching for the solutions I found some. As I am not really an expert I ask you guys. I want to add ...
-1
votes
2answers
260 views

How do i output images from URL's added to the same custom field key

This is my array of image URL's added to the same custom field named images. $images = get_post_custom_values( 'images' ); I need to print all these images in a template file.
0
votes
2answers
174 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
0answers
312 views

Save, update, get and sanitize post meta as HTML not plain

My post meta always is plain text HTML striped from it I need to Save, update, get and sanitize post meta as HTML not plain here is all my related code to this post meta filed Retrieve from ...
0
votes
0answers
24 views

How to get post that has non zero or greater than zero meta value

How to get post that has non zero or greater than zero meta value $args = array( 'sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => 1, 'exclude' => '', 'include' =>...
1
vote
1answer
317 views

How to create a shortcode to print specific values stored in a post meta array?

i am having problems printing a specific value stored in a post-meta array in a WordPress loop created by a Visual Composer Grid Builder, thru a shortcode (i also tried the grid builder Custom Field, ...
0
votes
1answer
2k views

Submitting Custom Post Types with custom fields from Front-end form

I'm trying to have a custom type post with 2 custom fields. Now I have the working custom post types and working form at the front-end via a template page. The problem is I can not get the custom ...
0
votes
1answer
588 views

How to show custom field on specific custom post type posts only when filled

On my demo website i would like to show some custom fields on posts of specific custom post type. And if possible only when they have a filled in value. Demo site: http://www.jsfaber.nl/gibson-eb-2014-...
1
vote
0answers
283 views

Run Shortcode of post's custom field in functions.php / Plugin

After 3 or 4 hours of searching the web for a solution, I abandoned it and hopefully you can help me? I added a sub-headline as a custom field (subheadlineclass). That works pretty. I can save, edit ...
0
votes
1answer
173 views

Unable to get specific value from post meta

I am using get_post_meta() to retrieve a custom meta field value from a given post. The custom meta box has a parent checkbox which has 3 child checkboxes. I want to get the values of both parent and ...
0
votes
1answer
2k views

Make Custom Fields Public in JSON - API

How do i make the custom fields public in rest API? I have added a custom field to the rest api. the challenge is - The metadata is returned when i am signed in my browser. if i try as public using ...
0
votes
1answer
714 views

Get custom fields without _edit_last, _edit_lock, _wp_page_template and _visual-subtitle

I'm getting custom fields using <?php $meta = get_post_custom($level_2->ID); ?> <?php foreach ( $meta as $key => $value) { ?> <?php echo $key.': '.$value[0].'<br />'; ?&...
0
votes
1answer
351 views

Create Meta boxes dynamically

I followed and created a meta box using all code from this question here: Create more Meta Boxes as needed Basically only two fields are created when you click on Add track button: Song title field ...
0
votes
1answer
697 views

Custom Fields Not Working In Footer

A friend of mine wants the address in his footer to be editable. So I thought to add Custom Fields to a post and then, in the footer call that post (named "Info Post") and get the address from a ...
2
votes
2answers
5k views

How to get custom field image url of specific size

I have a "cmb2" custom field with type->file. and i use it to upload images. If i use: echo get_post_meta( $post->ID, '_pf_photo1', 'medium' ); i get the url of the full image (not the medium ...
2
votes
1answer
4k views

Save metabox with multiple checkbox array

I have a requirement where the number of checkboxes outputted in the metabox is not fixed. Had it been fixed, I could've followed any one of the tutorials on the internet which suggests I name each ...
1
vote
1answer
2k views

Detect meta value changes when post is updated (post_updated)

In my theme, I want to create the function that when a metabox value is changed, the author is notified. Effectively, I have a custom metabox that loops through a certain level of user role (custom ...
1
vote
1answer
2k views

Why is my Custom Meta Box Field Inputs NOT saving?

I have a custom post type labelled 'web_design' and I want my 'web_design' posts to have the following custom fields: 1. 'client' - Client Name 2. 'exlink' - External Link 3. 'datefin' - Date Finished ...
0
votes
1answer
95 views

Display posts with empty custom field

How to list post with specific custom field which is empty? I have some posts with custom field 'author', and for some posts that custom field is emty, so I would like to find those posts to delete ...
0
votes
2answers
42 views

Cannot obtain custom meta information

I'm trying to access custom meta data from a custom post type called 'Videos' The following code is on a template page called 'single-videos.php' A custom field called 'Video URL', 'Video Width' and ...
9
votes
3answers
15k views

How to get custom post meta using REST API

I am trying to create a REST APIs for my wordpress website which is used for facility listing using wordpress job manager plugin. I have registered my custom post , taxonomies in \plugins\rest-api\...
0
votes
1answer
127 views

Saved Post Meta Array Returns as String

I am saving an array in post meta using update_post_meta. $arr = array('this', 'or that'); update_post_meta($post_id, 'field', $arr); $ret_arr = get_post_meta($post_id, 'field', true); var_dump($...
0
votes
1answer
37 views

Query Multiple meta

Hi i've looked through the forum but can't seem to find the right solution to what i'm looking what we have is a property website and have various pages setup to show specific types of properties ...
3
votes
1answer
771 views

Add options to featured image

I want to add an option to the featured image metabox. I have found a way to do this here The problem I'm having is saving the value tot the database. Here is what I have tried: add_filter( '...
1
vote
1answer
496 views

Meta Key Value in current-user-only loop

I created a loop for logged-in-users-only which works perfectly for all data except for meta keys. I'd like to be able to also extract meta keys but had no luck so far. This is my loop (based on this ...
1
vote
0answers
89 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 ...
0
votes
1answer
541 views

Order a WP_Query by meta value where the value is an array

I have a WordPress custom query: $args = array( 'posts_per_page' => 2, 'meta_key' => 'pworks_popular_posts', 'paged' => $page_nr ); $query = new WP_Query($args); if($query->...
1
vote
1answer
5k views

Create a random unique 6 digit number as custom field for custom post type

I use the following function to create a random unique 6 digit number and save it in a custom post type meta field. I am unsure about the use of rewind_posts() inside a while loop. The idea is that ...
4
votes
1answer
1k views

How to hide meta box values from custom fields list?

I have created a metabox : function drama_description_metabox_markup() { global $post; $drama_description_metabox_markup = get_post_meta( $post->ID, 'drama_description', true ); ?> ...
0
votes
1answer
780 views

How to call a post's metadata in shortcode.php?

I'm not a terribly advanced WordPress developer, but I can kind of futz my way into a solution most of the time. This time, no such luck: I'm trying to write a shortcode to display a custom post type ...
0
votes
0answers
342 views

How can I get the $key / $value pairs of custom fields that were added via 3rd party plugins or themes?

I'm running WP Job Manager plugin which is designed to allow its custom post type fields to be altered within a theme or plugin via custom filters. I have added my own custom fields (example) and the ...
0
votes
1answer
1k views

Add a custom class to the body tag using custom fields

There are certain posts where I want to manually append a custom body class using custom fields. How do I go about it appending the class to the body tag when a certain custom field is added to a ...
0
votes
1answer
424 views

Display Data From This Custom Media Upload Meta Box?

This plugin is working without any issue on CMS. Now I need to know how to properly display them in my post. Custom Media Upload Meta Box Plugin. $meta_box_media_upload = new Meta_Box_Media_Upload();...
0
votes
1answer
648 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
2k views

How to check if user meta field is empty in conditional else statement

Hello all I have a custom post type set up for my wordpress site within this custom post type i have a meta box with about 11 meta fields that I have added programatically. What I would like to do is ...
0
votes
1answer
2k views

Get all the posts where meta field with multiple choice has several values checked

I apologize beforehand for any confusion, I'm just 2 days with WP. So, I use Advanced Custom Fields to add formatable custom fields to posts of partucular type. One of fields is checkboxes with ...
0
votes
1answer
1k views

Define category ID using get_post_meta

I need to define the Category ID in my singles page through custom fields so that i can load a different category depending on the page. This is what i have so far and its not working. Any help would ...
0
votes
5answers
6k views

Get YouTube video id from url in a custom field

Here's the scenario, I have a site with thousands of YouTube video posts which are stored in a custom field 'video_url' which is being used in a custom video player. The custom player I'm using now ...
3
votes
1answer
3k views

get_post_meta() unserialize issue - returns boolean(false)

I'm using a simple custom plugin that parses and saves external XML data as a serialized array in a custom field. This works fine, however, when I update the post, instead of the array I only see a ...