-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn-to-shop.php
32 lines (27 loc) · 1.11 KB
/
return-to-shop.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Plugin Name: Return to shop
* Description: Modify return to shop button url for WooCoomerce. (This button show up when cart is empty)
* Plugin URI: https://wordpress.org/plugins/return-to-shop
* Text Domain: return-to-shop
* Author: Smit Patel
* Author URI: https://smitpatelx.com
* Version: 1.0.1
* Requires at least: 5.2
* Requires PHP: 7.1
* License: MIT
* License URI: https://github.com/smitpatelx/return-to-shop/blob/master/LICENSE
*/
if(!defined('ABSPATH')){
exit;//Exit if accessed directly
}
require_once(__DIR__.'/includes/rts_modify_url.php');
require_once(__DIR__.'/includes/rts_page_registration.php');
require_once(__DIR__.'/includes/activation.php');
require_once(__DIR__.'/includes/deactivation.php');
register_activation_hook( __FILE__, 'rts_activation');
register_deactivation_hook( __FILE__, 'rts_deactivation');
// Register submenu page
add_action('admin_menu', 'register_rts_submenu_page', 99);
// Change button url
add_filter( 'woocommerce_return_to_shop_redirect', 'rts_modify_url' );