Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wcfm_login_redirect', function( $redirect_to, $user ) {
- if(wcfm_is_vendor()) {
- $redirect_to = get_wcfm_settings_url();
- }
- return $redirect_to;
- }, 50, 2 );
- add_action( 'template_redirect', function() {
- global $wp, $WCFM_Query;
- if ( wcfm_is_vendor() && is_wcfm_page() ) {
- $wcfm_endpoints = $WCFM_Query->get_query_vars();
- $is_endpoint = false;
- foreach ( $wcfm_endpoints as $key => $value ) {
- if ( isset( $wp->query_vars[$key] ) ) {
- $is_endpoint = true;
- }
- }
- if ( ! $is_endpoint ) {
- wp_safe_redirect( get_wcfm_settings_url() );
- exit();
- }
- }
- }, 501 );
- add_filter('wcfm_is_allow_home_in_menu', function($is_allowed) {
- if(wcfm_is_vendor()) {
- return false;
- }
- return $is_allowed;
- });
Add Comment
Please, Sign In to add comment