Search
 
SCRIPT & CODE EXAMPLE
 

PHP

woocommerce redirect shop page

// Redirect WooCommerce Shop URL
function wpc_shop_url_redirect() {
    if( is_shop() ){
        wp_redirect( home_url( '/custom-page/' ) ); // Assign custom internal page here
        exit();
    }
}
add_action( 'template_redirect', 'wpc_shop_url_redirect' );
Comment

shop manager Redirect @ WooCommerce

add_filter( 'login_redirect', 'login_redirect_shop_manager_on_orders_list', 10, 3 );
function login_redirect_shop_manager_on_orders_list( $redirect_to, $request, $user ) {
    $defined_user_role = 'shop_manager'; // The defined user role

    if( isset($user->roles) && is_array($user->roles) && in_array( $defined_user_role, $user->roles ) ) {
        $redirect_to = admin_url('edit.php?post_type=shop_order'); // Custom redirection url

        wp_safe_redirect( $redirect_to ); // Force redirection
        exit(); // Mandatory to avoid errors
    }
    return $redirect_to;
}
Comment

PREVIOUS NEXT
Code Example
Php :: get author display name wordpress 
Php :: check if session variable exists php 
Php :: Wordpress disable plugin or theme installation 
Php :: typo3 debug 
Php :: redirect in codeigniter 
Php :: main.WARNING: Session size of 315269 exceeded allowed session max size of 256000 
Php :: var_dump beautify 
Php :: php myadmin reset auto incremente 
Php :: get last 3 characters of string in php 
Php :: string to double php 
Php :: get the current page id in wordpress 
Php :: how to use bootstrap in laravel 8 remove tailwind 
Php :: change php version ubuntu 
Php :: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. 
Php :: wp+get feature image 
Php :: php self 
Php :: laravel get public path url 
Php :: yii2 where in 
Php :: php preg_match special characters 
Php :: laravel flutter save image in data 
Php :: failed to open stream permission denied laravel 
Php :: how to print array in laravel blade 
Php :: searching and removing element from an array php 
Php :: display exception in blade laravel 
Php :: php sleep half a second 
Php :: allert in php 
Php :: how to run laravel project 
Php :: the token has been blacklisted laravel jwt 
Php :: if post id is wordpress php 
Php :: custom bootstrap pagination laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =