2

we could change the parent one that says Products, and we change that name to something else, but not the children.

Is it possible?

enter image description here

Thank you so much

2
  • Why do you want to change WooCommerce core labels? Commented Apr 27, 2016 at 19:55
  • Instead of products we have documents
    – mithrandir
    Commented Apr 27, 2016 at 20:31

1 Answer 1

6

There are two ways you can do this. First is to translate it via the PO/MO files provided.

The other way You can change the labels on the filter.

add_filter( 'woocommerce_register_post_type_product', 'custom_post_type_label_woo' );

function custom_post_type_label_woo( $args ){
    $labels = array(
        'name'               => __( 'Elements', 'your-custom-plugin' ),
        'singular_name'      => __( 'Element', 'your-custom-plugin' ),
        'menu_name'          => _x( 'Elements', 'Admin menu name', 'your-custom-plugin' ),
        'add_new'            => __( 'Add Element', 'your-custom-plugin' ),
        'add_new_item'       => __( 'Add New Tour', 'your-custom-plugin' ),
        'edit'               => __( 'Edit Element', 'your-custom-plugin' ),
        'edit_item'          => __( 'Edit Element', 'your-custom-plugin' ),
        'new_item'           => __( 'New Element', 'your-custom-plugin' ),
        'view'               => __( 'View Element', 'your-custom-plugin' ),
        'view_item'          => __( 'View Element', 'your-custom-plugin' ),
        'search_items'       => __( 'Search Elements', 'your-custom-plugin' ),
        'not_found'          => __( 'No Elements found', 'your-custom-plugin' ),
        'not_found_in_trash' => __( 'No Elements found in trash', 'your-custom-plugin' ),
        'parent'             => __( 'Parent Element', 'your-custom-plugin' )
    );

    $args['labels'] = $labels;
    $args['description'] = __( 'This is where you can add new tours to your store.', 'your-custom-plugin' );
    return $args;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.