I asked the question in another group and here I got an answer that has turned out to be useful.
BE AWARE! It must be dealt with with caution as the PHP eval() function can be a significant security risk.
Find the answer here:
https://stackoverflow.com/a/55518496/11309498
Related Posts:
- Search that will look in custom field, post title and post content
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- WP insert post PHP function dynamically generated Custom Fields
- Conditional to modify query results
- Create a random unique 6 digit number as custom field for custom post type
- Using several custom fields as custom post title
- Replace text in post from cvs
- Query & Order posts by custom fields
- get_post_meta not working on publishing
- Displaying custom field according to date
- Add additional field to custom post_type
- finding and using post type fields in WordPress
- Get data from PHP to JavaScript to set position of each post on front page
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- CPT Repeatable Fields + Undefined Index
- Let users upload image(s) to the post from front end
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- How can I sort the order of multiple custom field values in a custom post type?
- How do I ensure that post_type and Taxonomy use the same slug?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- Custom fields array to display it monthly
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Sort custom post column by generated value?
- when looping through custom post data not appearing
- PHP Notice: Unidentified index
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Can’t pick up a field created with Advanced Custom Fields
- Get month and day from a Date Picker custom field
- Function not pulling image or text from custom post type
- Show Custom Post Type taxonomy term that matches custom field
- Order by custom field attribute
- Select Menu for Custom post Type does not save
- How do I filter a custom post type loop by a field?
- Get custom post fields and display them
- Send email on creation of custom post type and use get_post_meta()
- Filtering by Post Meta Custom Fields – Performance
- WordPress posts with multiple fields
- wp_query to find posts by year and month
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- WP Query—Relationship between two custom post types and their fields
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- How to output wordpress custom tags separated by comma?
- How to dynamically attach pictures to a carousel
- Loading all files within a directory
- Custom fields in Permalinks?
- Assigning the same custom meta box to multiple post types
- Blog page showing same content as homepage
- Custom Post Type Navigation on Custom Field
- query posts and custom post type with meta key
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to add a Custom Meta Box for more than one Post Type?
- Why do I lose the content of meta boxes when I leave the page?
- Dynamically add / duplicate custom meta in custom post types
- how to interconnect custom post types?
- How to insert content from another Custom Post type into Post?
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Create a post in custom post type using field in registration form after users submit form
- Show Different Header on a Specific Post ID
- Problem fields custom date, time, and checkbox
- Get all Posts If has same custom field values in Posts
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- WordPress custom meta field for custom post not storing data
- meta_query compare >= not working but
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- Admin notice not displaying
- Copy custom field value to post title
- Can’t get order_by meta_value_num to work properly
- How to Duplicate (multiple meta box)?
- Custom Post Type + 20k posts = blank/404 within Admin edit.php [duplicate]
- Create custom post type on successful woocommerce order [closed]
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Custom Post type and Custom Field WP_Query
- Adding custom tables to WordPress
- How to structure a site with product variations pages?
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Remove wrong dashes from get_the_title()
- List of Posts in a Custom Field
- Save an array from drop-down in custom meta box
- List all images from a single post meta value
- Plugin for custom posts and fields [closed]
- Including Custom Meta with posts_where query
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Populate Custom Fields in a Custom Post Type?
- Using wordpress template tags within an array
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Getting the URL of the parent page
- Custom query to filter posts that have current post as a taxonomy [closed]
- WP All Import – Using Xpath to set a select value
- How to change post featured image using a custom field of category?
- Custom post type permalink returns bad url