This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********This function is used to display the pagebuilder option on the CPTs**********/ | |
add_filter('et_builder_post_types', 'mndsz_divi_admin_display_pagebuilder'); | |
function mndsz_divi_admin_display_pagebuilder($mndsz_post_types) | |
{ | |
$mndsz_get_custom_post_types = get_post_types(array('public' => true, '_builtin' => false)); | |
$new_post_types = array_merge($mndsz_post_types, $mndsz_get_custom_post_types); | |
return $new_post_types; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('woocommerce_thankyou', 'mindsize_change_role_on_successful_purchase'); | |
function mindsize_change_role_on_successful_purchase($order_id ) { | |
$order = new WC_Order( $order_id ); | |
$user_id = $order->user_id; | |
$wp_user_object = new WP_User($user_id); | |
if($wp_user_object->roles[0] != "administrator"){ // Do not change admin role | |
wp_update_user( array( 'ID' => $wp_user_object->ID, 'role' => "wholesale" ) ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove product meta */ | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add free shipping for users in subscriber or administrator roles. | |
function mindsize_wc_conditional_free_shipping( $rates, $package ) { | |
get_currentuserinfo(); | |
global $current_user; | |
if ($current_user->ID) { | |
$user_roles = $current_user->roles; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add gravity forms support for shop managers. | |
function mindsize_gravity_forms_shop_manager_role(){ | |
$role = get_role('shop_manager'); | |
// remove full access in case it was added previously | |
$role->remove_cap('gform_full_access'); | |
$role->add_cap('gravityforms_view_entries'); | |
$role->add_cap('gravityforms_edit_entries'); | |
} |