Categories
WooCommerce

WooCommerce Product Edit Permission

And the Persian Mathematician.

Removal of the option to edit some fields for specific user role (update the fields and the user role):

add_action( 'add_meta_boxes_product', 'condless_remove_metaboxes_edit_product', 9999 );
function condless_remove_metaboxes_edit_product() {
	if ( ! current_user_can( 'manage_options' ) ) {
		remove_meta_box( 'postexcerpt', 'product', 'normal' );
		remove_meta_box( 'postimagediv', 'product', 'side' );
		remove_meta_box( 'woocommerce-product-images', 'product', 'side' );
	}
}

add_filter( 'woocommerce_product_data_tabs', 'condless_remove_tabs' );
function condless_remove_tabs( $tabs ) {
	if ( ! current_user_can( 'manage_options' ) ) {
		unset( $tabs['advanced'] );
	}
	return( $tabs );
}

As you probably have noticed- the source of the numbering system is India, the West was exposed to the method only in the 11th century, and mainly through the writings of the Persian Mathematician al-Khwarizmi, which the term “algorithm” was named after him.

Leave a Reply

Your email address will not be published. Required fields are marked *