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
function add_custom_menus(){ | |
$user = wp_get_current_user(); | |
if ( in_array( 'employer', (array) $user->roles ) ) { | |
//The user has the "author" role | |
echo '<style type="text/css">.woocommerce-MyAccount-navigation-link--downloads {display: none;}.woocommerce-Addresses .u-column2 {display: none;}</style>'; | |
}elseif ( in_array( 'candidate', (array) $user->roles ) ) { | |
//The user has the "author" role | |
echo '<style type="text/css">.woocommerce-MyAccount-navigation-link--downloads {display: none;}.woocommerce-MyAccount-navigation-link--orders {display: none;}.woocommerce-MyAccount-navigation-link--edit-address {display: none;}</style>'; | |
} | |
} |
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
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) { | |
$count = get_comments_number( $listing->get_id() ); | |
// Only add if our custom field is not empty. | |
if ( '' !== $count ) { | |
if($count == 1){$data['countz'] = $count ." Review";} | |
else{ $data['countz'] = $count ." Reviews";} | |
} | |
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
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1); | |
function wc_assign_custom_role($args) { | |
$args['role'] = 'wc_product_vendors_admin_vendor'; | |
return $args; | |
} |
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
//See available parameters: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters | |
add_filter( 'listify_wp_job_manager_filters_dropdown_category', function( $args ) { | |
$args['orderby'] = 'id'; | |
return $args; | |
} ); |
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
/** | |
* Plugin Name: Product Vendors, auto approve | |
*/ | |
function automaticallyApproveRegisteredVendors ( $vendorData ) { | |
$vendorData['role'] = 'wc_product_vendors_admin_vendor'; | |
return $vendorData; | |
} | |
add_filter( 'wcpv_registration_default_user_data', | |
'automaticallyApproveRegisteredVendors', 10, 1); |
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
function rating_count_listify_single_job_listing_meta() { | |
global $post; | |
$count = listify_get_listing( $post )->get_rating_count(); | |
$text = esc_html( sprintf( _n( '%d Review', '%d Reviews', $count, 'listify' ), $count ) ); | |
// Link. | |
$link = listify_submit_review_url( $post ); | |
if ( $link && is_singular() ) { | |
$text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; | |
} | |
// Output. |
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
function wc_bypass_logout_confirmation() { | |
global $wp; | |
if ( isset( $wp->query_vars['customer-logout'] ) ) { | |
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) ); | |
exit; | |
} | |
} | |
add_action( 'template_redirect', 'wc_bypass_logout_confirmation' ); |
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
function custom_listify_single_job_listing_actions_after() { | |
global $post; | |
$phone = get_post_meta( $post->ID, '_phone', true ); | |
echo '<a href="tel:' . $phone . '" class="button">My Button</a>'; | |
} | |
add_filter( 'listify_single_job_listing_actions_after', 'custom_listify_single_job_listing_actions_after' ); |
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
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1); | |
function wc_assign_custom_role($args) { | |
$args['role'] = 'employer'; | |
return $args; | |
} |
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
add_filter( 'wpjms_job_listing_loop_args', function( $args ) { | |
$args= array( | |
'post_type' => array( 'job_listing' ), | |
'author' => get_current_user_id(), | |
'posts_per_page' => 20, | |
); |
NewerOlder