My answer use 3 steps too :
Step 1 : adding a new tab on the list
add_filter("woocommerce_product_data_tabs", function ($product_data_tabs) {
$product_data_tabs["newTabId"] = [
"label" => "Hello 1",
"target" => "htmlIdOfTheBox",
"class" => [],
];
return $product_data_tabs;
});
Step 2 : preparing the html box for this new tab
add_action("woocommerce_product_data_panels", function () {
?>
<div id="htmlIdOfTheBox" class="panel woocommerce_options_panel">
<strong>Hello 2</strong>
</div>
<?php
});
Step 3 : filling this new box with the custom post types and saving the choices in the product. Sorry this big step is your work 😉
I think that this step starts with getting all the custom post “album” with the “get_posts” function : http://codex.wordpress.org/Function_Reference/get_posts
Related Posts:
- Remove POST_TYPE from custom post type permalink
- Custom Post Type | Fatal Error on register_post_type()
- Redirect to another page using contact form 7? [closed]
- Add Excerpt On Quicksand Plugin
- How to Add Custom Taxonomy To Woocommerce Plugin
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- register_taxonomy with multiple object type and update_count_callback
- Redirect after deleting post and keep track of pagination
- How often do you need to register_post_type?
- How to use a dedicated template for the Custom Post Type from a plugin?
- How to load a new template page according to a particular URL?
- Updating post meta for custom post types
- How to register custom post types in a plugin?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to append element after thumbnail
- Best practice for adding posts in bulk
- How to have the right design for a custom post type without accessing themes
- Set object terms not working on plugin activation
- Get rewrite slug of custom post type in template
- custom post type not showing in menu
- Custom posts don’t work
- How to customize a permalink (URL) structure?
- Adding a custom post type taxonomy template in plugin
- Plugin: register custom post types, child ready and performance best practices
- changing meta value and meta key of price field
- custom payment gateway in woocommerce failed to connect to remote api server
- Addition of custom option panel crashes Media Library & Admin Area
- WooCommerce sort products by the actual product width(not the shipping width)
- Custom fields for custom post type
- ACF in wordpress
- How can I have different content for different countries?
- post_parent in custom post type
- How to insert data into meta box from another plugin?
- Custom post type’s posts are not showing anywere but in xml sitemap
- Unable to format dates to put in event calendar
- Update Post Status On Woocommerce Payment Complete
- Custom post type in Custom widget – $listItem
- Add custom columns in custom post type browse page
- Validate Custom Post Type fields
- Types plugin custom post add_action hooks
- Convert Custom Table Data Based Plugin To Be Searchable
- how can i show a google map in custom post type
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Custom Post Type, Custom Columns List
- Check if theme supports sidebar
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Ultimate Members Default Post Layout problem
- custom post type and user post count shortcode
- Cannot view Custom Post Type no matter what I try
- ‘Simple’ Reservation System
- How to show link to product in custom fields?
- Restrict Custom Post Type to One Item
- Custom Post Type Front Page Gives 404
- Show Post columns to specific users on condition
- Convert attribute woocommerce terms (taxonomy terms) in posts of custom post type
- Woocommerce list variations that are added already to cart in Single Product
- Insert custom taxonomy into category query
- Run query on specific admin options page and send results to select field in another function
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Can’t save custom post type fields
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- get_post_types doesn’t work in plugin
- Registering an optional custom post type from a plugin
- Add category slug as class attribute in a link array
- Custom Post Types in plugins?
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- How to delete unnecessary custom post types in the UI
- Set a Custom Post Type as a Homepage
- Create Custom Coupon Type
- I am having a problem with fetching product data in the Gutenberg block editor
- Need to add custom cart item data
- Redirrect after facebook successful login to wooommerce cart page url
- how to add custome text in each products side in checkout page after pincode validation [closed]
- Post URL redirecting to homepage
- ACF – Tags not showing up in Custom Post Types
- Add block templates (html) via plugin for custom post type
- Add File field in WooCommerce Box office plugin
- Subpage for Custom Post Type
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- Custom post type URl Cutomization
- Woocommerce attatch files and custom input meta to cart items and then to order
- get_posts() return NULL using a custom plugin and add_submenu_page() with Post Type
- Include theme header and footer in custom plugin
- Is it possible to create a custom post type with blank page for Post List and Add Post Page only?
- REST API callback function is not called
- Sticky bar with filter button and product count
- How to fetch WordPress Gallery Images to a Custom Post Type?
- How to show metabox in custom php menu page
- WooCommerce Checkout – Validate User Role
- Query custom fields with three dates – start and end does not work
- Remove H1 title in admin post edit screen
- Custom Search Function in WordPress Returns No Results
- Display box in sidebar of custom post type
- How can I keep a WordPress dropdown menu open when navigating to a child page?
- How to Display News in a Timeline with Headline, Category, and Time?
- Remove `View post` Text