This file contains 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
/** | |
* Format WordPress User's "Display Name" to Full Name on Login | |
* ------------------------------------------------------------------------------ | |
*/ | |
add_action( 'wp_login', 'wpse_9326315_format_user_display_name_on_login' ); | |
function wpse_9326315_format_user_display_name_on_login( $username ) { | |
$user = get_user_by( 'login', $username ); |
This file contains 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 | |
/** | |
* Place this in your functions.php | |
*/ | |
if ( is_user_logged_in() ) { | |
add_filter('show_admin_bar', '__return_false'); | |
} | |
?> |
This file contains 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
// Save fields | |
add_action( 'personal_options_update', 'pv_save_merchant_id' ); | |
add_action( 'edit_user_profile_update', 'pv_save_merchant_id' ); | |
// Display Fields | |
add_action( 'show_user_profile', 'pv_add_custom_merchant_id_field' ); | |
add_action( 'edit_user_profile', 'pv_add_custom_merchant_id_field' ); |
This file contains 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 | |
/** | |
* wcv_pps_shipping_costs | |
* | |
* This is fired on save & edit of a product | |
* | |
*/ | |
function wcv_pps_shipping_costs ( $post_id ){ | |
This file contains 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 | |
// | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); | |
$args = array( | |
post_type => 'product_variation', | |
post_author => $vendor_id | |
); |
This file contains 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 | |
sprintf( __( 'Total commission currently due: %d. <a href="%s">View details</a>.', 'wcvendors' ), !function_exists( 'woocommerce_price' ) ? $total_due : woocommerce_price( $total_due ), '?page=pv_admin_commissions' ) . | |
?> |
This file contains 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_filter( 'product_type_selector', 'remove_listing_package'); | |
// $product type is an array of product it containts the following: | |
// | |
// $product_type_selector = apply_filters( 'product_type_selector', array( | |
// 'simple' => __( 'Simple product', 'wcvendors-pro' ), | |
// 'grouped' => __( 'Grouped product', 'wcvendors-pro' ), | |
// 'external' => __( 'External/Affiliate product', 'wcvendors-pro' ), |
This file contains 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_filter( 'wcv_commission_rate', 'my_wcv_commission_rate', 10, 4 ); | |
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order ) { | |
$terms = get_the_terms( $product_id, 'product_cat' ); | |
// Loop through the categories | |
// It will break on the first category assigned | |
foreach ( $terms as $term ) { |