PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.5
ShopBuilder – WooCommerce Builder For Elementor v3.2.5
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Controllers/PluginsSupport/WooAddressBook.php +23 -11 2.1.63.2.5 View file →
@@ -1,8 +1,7 @@
1 1 <?php
2 -
3 2 /**
4 - * Radiustheme Variation Gallery support.
3 + * WooCommerce address book plugin support.
5 4 *
6 5 * @package RadiusTheme\SB
7 6 */
8 7
@@ -7,13 +6,9 @@
7 6 */
8 7
9 8 namespace RadiusTheme\SB\Controllers\PluginsSupport;
10 9
11 -use RadiusTheme\SB\Helpers\ElementorDataMap;
12 -use RadiusTheme\SB\Helpers\Fns;
13 -use RadiusTheme\SB\Modules\WishList\WishlistFns;
14 10 use RadiusTheme\SB\Traits\SingletonTrait;
15 -use RadiusTheme\SB\Helpers\BuilderFns;
16 11
17 12 // Do not allow directly accessing this file.
18 13 if ( ! defined( 'ABSPATH' ) ) {
19 14 exit( 'This script cannot be accessed directly.' );
@@ -19,9 +14,9 @@
19 14 exit( 'This script cannot be accessed directly.' );
20 15 }
21 16
22 17 /**
23 - * Product Description class
18 + * WooCommerce address book plugin support
24 19 */
25 20 class WooAddressBook {
26 21 /**
27 22 * SingletonTrait.
@@ -31,21 +26,38 @@
31 26 /**
32 27 * Construct function
33 28 */
34 29 private function __construct() {
30 + add_filter( 'woocommerce_edit_address_slugs', [ $this, 'change_slug' ], 99 );
35 31 add_shortcode( 'rtsb_woo_address_book', [ $this, 'woo_address_book' ] );
36 32 }
37 33
38 34 /**
39 - * @param $atts
40 - * @param $content
35 + * Address book shortcode.
41 36 *
42 - * @return void
37 + * @return string
43 38 */
44 - public function woo_address_book( $atts, $content = '' ) {
39 + public function woo_address_book() {
45 40 ob_start();
41 +
46 42 $address = \WC_Address_Book::get_instance();
47 43 $address->wc_address_book_page( '' );
44 +
48 45 return ob_get_clean();
49 46 }
50 47
48 + /**
49 + * Change endpoint slug.
50 + *
51 + * @param array $slugs Page slug.
52 + *
53 + * @return array
54 + */
55 + public function change_slug( $slugs ) {
56 + $the_slug = [];
57 + foreach ( $slugs as $key => $value ) {
58 + $the_slug[ $key ] = $key;
59 + }
60 +
61 + return $the_slug;
62 + }
51 63 }