woocommerce_register_post_type_product_form
Allow developers to customize the product form post type registration arguments.
Usage
add_filter( 'woocommerce_register_post_type_product_form', 'wp_kama_woocommerce_register_post_type_product_form_filter' ); /** * Function for `woocommerce_register_post_type_product_form` filter-hook. * * @param array $args The default post type registration arguments. * * @return array */ function wp_kama_woocommerce_register_post_type_product_form_filter( $args ){ // filter... return $args; }
- $args(array)
- The default post type registration arguments.
Changelog
Since 9.1.0 | Introduced. |
Where the hook is called
woocommerce_register_post_type_product_form
woocommerce/includes/class-wc-post-types.php 385-438
apply_filters( 'woocommerce_register_post_type_product_form', array( 'labels' => array( 'name' => __( 'Product Forms', 'woocommerce' ), 'singular_name' => __( 'Product Form', 'woocommerce' ), 'all_items' => __( 'All Product Form', 'woocommerce' ), 'menu_name' => _x( 'Product Forms', 'Admin menu name', 'woocommerce' ), 'add_new' => __( 'Add New', 'woocommerce' ), 'add_new_item' => __( 'Add new product form', 'woocommerce' ), 'edit' => __( 'Edit', 'woocommerce' ), 'edit_item' => __( 'Edit product form', 'woocommerce' ), 'new_item' => __( 'New product form', 'woocommerce' ), 'view_item' => __( 'View product form', 'woocommerce' ), 'view_items' => __( 'View product forms', 'woocommerce' ), 'search_items' => __( 'Search product forms', 'woocommerce' ), 'not_found' => __( 'No product forms found', 'woocommerce' ), 'not_found_in_trash' => __( 'No product forms found in trash', 'woocommerce' ), 'parent' => __( 'Parent product form', 'woocommerce' ), 'featured_image' => __( 'Product form image', 'woocommerce' ), 'set_featured_image' => __( 'Set product form image', 'woocommerce' ), 'remove_featured_image' => __( 'Remove product form image', 'woocommerce' ), 'use_featured_image' => __( 'Use as product form image', 'woocommerce' ), 'insert_into_item' => __( 'Insert into product form', 'woocommerce' ), 'uploaded_to_this_item' => __( 'Uploaded to this product form', 'woocommerce' ), 'filter_items_list' => __( 'Filter product forms', 'woocommerce' ), 'items_list_navigation' => __( 'Product forms navigation', 'woocommerce' ), 'items_list' => __( 'Product forms list', 'woocommerce' ), 'item_link' => __( 'Product form Link', 'woocommerce' ), 'item_link_description' => __( 'A link to a product form.', 'woocommerce' ), ), 'description' => __( 'This is where you can set up product forms for various product types in your dashboard.', 'woocommerce' ), 'public' => true, 'menu_icon' => 'dashicons-forms', 'capability_type' => 'product', 'map_meta_cap' => true, 'publicly_queryable' => true, 'hierarchical' => false, // Hierarchical causes memory issues - WP loads all records! 'rewrite' => $permalinks['product_rewrite_slug'] ? array( 'slug' => $permalinks['product_rewrite_slug'], 'with_front' => false, 'feeds' => true, ) : false, 'query_var' => true, 'supports' => $supports, 'has_archive' => $has_archive, 'show_in_rest' => true, 'show_ui' => true, 'show_in_menu' => true, 'exclude_from_search' => true, 'show_in_nav_menus' => false, ) )