You use the callback in a class context, but I see no class declaration. Maybe it was left out, but here’s a possible solution without using class.
function rttk_create_boxes() {
$myarray = $this->rttk_get_posttype_array();
foreach ( $myarray as $key => $value ) {
add_meta_box(
'rttk_' . $key . '_id',
__( 'Details', 'rara-theme-toolkit-pro' ),
'rttk_testimonials_metabox_callback',
null,
'side',
'high',
array( 'key' => $key )
);
}
}
// testimonials template form
function rttk_testimonials_metabox_callback( $post, $args ) {
$key = $args['args']['key'];
include RTTKPRO_BASE_PATH . '/includes/meta-parts/rttk-' . $key . '-template.php';
}
Related Posts:
- How do I remove all the metaboxes for a custom post type?
- Get all posts from custom post type and insert in select input as metabox
- Detect meta value changes when post is updated (post_updated)
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How can I display my custom metaboxes on a custom post template?
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- Populate Custom Fields in a Custom Post Type?
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- A better way to add a meta box to custom post types
- Metabox not show in categories custom post type cmb2
- Show Custom Post Type meta boxes only on Page Edit
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Meta Data for Custom Post Type not saving
- create custom meta box with default value
- Displaying a div from an assigned meta_value when on a page
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Why do I have to press the “Update” button twice to save my meta box values?
- Values from meta-box not on $_POST
- Custom post type suddenly stoped working after WordPress 5 update
- How can I output WPAlchemy repeating fields meta values in my page template?
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Save Metabox Custom Field Value
- Meta box data not saving
- WP_Meta_Query object with conditionals
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Meta Box with variable number of fields
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Get meta values from parent post and save in child post
- Custom meta box data not saving
- Collect custom post in a calendar
- Delete custom post type metadata without deleting the post in admin area
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Display a post count from a custom metabox selection
- Post AND page parameter for WP function
- Use a Variable in update_post_meta as the $meta_key
- Get post with multiple meta keys and value
- Removing Edit Permalink/View “Custom Post Type” areas
- Unable to save custom taxonomy terms in a custom-built metabox
- Custom Post Type: Set post_title equal to a custom post type field
- I can’t set meta_key in my custom post type query
- How to sort CPT by custom meta value (date), and return posts month by month
- How do I sort a custom post type admin column using two meta keys?
- how to interconnect custom post types?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Is it possible to create relational metabox values in a custom post?
- Changing custom type name hides the posts
- How do I create an archive page as a including metadata?
- Two Custom Post Types Many to Many Relationship
- Update postmeta Parent when post_status child change
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Dynamic Custom Fields
- Custom “radio button meta box” not saving correctly
- Check if post with same meta value exists
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- Archieve.php not loading for custom post type
- Create Array from custom post type to display a slider
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Topic won’t save for a custom post type — how to debug?
- copy images from custom field to another custom field
- Meta box not appearing in my custom post type
- Adding an extra parameter [string] to my posts’ permalink?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Custom Metabox Info Not Saving
- Metabox collapsed by default
- Use WP_query to match post types based on custom field values
- Stored meta from attachment, video length?
- Custom post type: “transition_post_status” action get title and other fields
- How to shows CPT which has specific meta key?
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Order by post meta value gets random results
- Metabox is not saving
- Rich Custom Field for Custom Post type not saving
- Display div based on Group metabox selection [closed]