PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.3.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.3.0
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / funnel / redirect.php

redirect.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.3.0, at includes/funnel/redirect.php

53 lines 991 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die();
3
4 /**
5 * Class Funnel_Redirect.
6 * Handle funnel step base url.
7 *
8 * @since 1.8.1
9 */
10 class Funnel_Redirect {
11 /**
12 * The funnel step url.
13 *
14 * @since 1.8.1
15 * @var string
16 */
17 public static $step_base = 'sellkit_step';
18
19 /**
20 * Funnel_Redirect constructor.
21 *
22 * @since 1.8.1
23 */
24 public function __construct() {
25 self::$step_base = get_option( 'sellkit_funnel_permalink_base', 'sellkit_step' );
26
27 if ( 'sellkit_step' === self::$step_base ) {
28 return;
29 }
30
31 add_filter( 'register_post_type_args', [ $this, 'replace_sellkit_step_slug' ], 10, 2 );
32 }
33
34 /**
35 * Change sellkit_step slug in url.
36 *
37 * @param array $args Post type arguments.
38 * @param string $post_type Post type slug.
39 * @since 1.8.1
40 * @return array
41 */
42 public function replace_sellkit_step_slug( $args, $post_type ) {
43 if ( 'sellkit_step' === $post_type ) {
44 $args['rewrite']['slug'] = self::$step_base;
45 }
46
47 return $args;
48 }
49 };
50
51 new Funnel_Redirect();
52
53