@@ -8,169 +8,169 @@ |
||
8 | 8 | */ |
9 | 9 | class Integrations { |
10 | 10 | |
11 | - /** |
|
12 | - * Holds class instance |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * |
|
16 | - * @var object \lsx_health_plan\classes\Integrations() |
|
17 | - */ |
|
18 | - protected static $instance = null; |
|
19 | - |
|
20 | - /** |
|
21 | - * Holds class instance |
|
22 | - * |
|
23 | - * @since 1.0.0 |
|
24 | - * |
|
25 | - * @var object \MAG_CMB2_Field_Post_Search_Ajax() |
|
26 | - */ |
|
27 | - public $cmb2_post_search_ajax = false; |
|
28 | - |
|
29 | - /** |
|
30 | - * Holds class instance |
|
31 | - * |
|
32 | - * @since 1.0.0 |
|
33 | - * |
|
34 | - * @var object \lsx_health_plan\classes\Download_Monitor() |
|
35 | - */ |
|
36 | - public $download_monitor = false; |
|
37 | - |
|
38 | - /** |
|
39 | - * Holds class instance |
|
40 | - * |
|
41 | - * @since 1.0.0 |
|
42 | - * |
|
43 | - * @var object \lsx_health_plan\classes\Woocommerce() |
|
44 | - */ |
|
45 | - public $woocommerce = false; |
|
46 | - |
|
47 | - /** |
|
48 | - * Holds class instance |
|
49 | - * |
|
50 | - * @since 1.0.0 |
|
51 | - * |
|
52 | - * @var object \lsx_health_plan\classes\WP_User_Avatar() |
|
53 | - */ |
|
54 | - public $wp_user_avatar = false; |
|
55 | - |
|
56 | - /** |
|
57 | - * Holds class instance |
|
58 | - * |
|
59 | - * @since 1.0.0 |
|
60 | - * |
|
61 | - * @var object \lsx_health_plan\classes\FacetWP() |
|
62 | - */ |
|
63 | - public $facetwp = false; |
|
64 | - |
|
65 | - /** |
|
66 | - * Constructor |
|
67 | - */ |
|
68 | - public function __construct() { |
|
69 | - add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
70 | - add_action( 'init', array( $this, 'download_monitor_init' ) ); |
|
71 | - add_action( 'init', array( $this, 'woocommerce_init' ) ); |
|
72 | - add_action( 'init', array( $this, 'wp_user_avatar_init' ) ); |
|
73 | - add_action( 'init', array( $this, 'facetwp_init' ) ); |
|
74 | - add_action( 'init', array( $this, 'lsx_team_init' ) ); |
|
75 | - add_action( 'init', array( $this, 'lsx_article_init' ) ); |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * Return an instance of this class. |
|
80 | - * |
|
81 | - * @since 1.0.0 |
|
82 | - * |
|
83 | - * @return object \lsx_health_plan\classes\Integrations() A single instance of this class. |
|
84 | - */ |
|
85 | - public static function get_instance() { |
|
86 | - // If the single instance hasn't been set, set it now. |
|
87 | - if ( null === self::$instance ) { |
|
88 | - self::$instance = new self(); |
|
89 | - } |
|
90 | - return self::$instance; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Includes the Post Search Ajax if it is there. |
|
95 | - * |
|
96 | - * @return void |
|
97 | - */ |
|
98 | - public function cmb2_post_search_ajax() { |
|
99 | - require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
|
100 | - if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
101 | - $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - /** |
|
106 | - * Includes the Post Search Ajax if it is there. |
|
107 | - * |
|
108 | - * @return void |
|
109 | - */ |
|
110 | - public function download_monitor_init() { |
|
111 | - if ( function_exists( 'download_monitor' ) ) { |
|
112 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php'; |
|
113 | - $this->download_monitor = Download_Monitor::get_instance(); |
|
114 | - } |
|
115 | - } |
|
116 | - |
|
117 | - /** |
|
118 | - * Includes the Woocommerce functions. |
|
119 | - * |
|
120 | - * @return void |
|
121 | - */ |
|
122 | - public function woocommerce_init() { |
|
123 | - if ( function_exists( 'WC' ) ) { |
|
124 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php'; |
|
125 | - $this->woocommerce = Woocommerce::get_instance(); |
|
126 | - } |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * Includes the Woocommerce functions. |
|
131 | - * |
|
132 | - * @return void |
|
133 | - */ |
|
134 | - public function wp_user_avatar_init() { |
|
135 | - if ( class_exists( 'WP_User_Avatar_Setup' ) ) { |
|
136 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php'; |
|
137 | - $this->wp_user_avatar = WP_User_Avatar::get_instance(); |
|
138 | - } |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Includes the FacetWP Indexer Filters. |
|
143 | - * |
|
144 | - * @return void |
|
145 | - */ |
|
146 | - public function facetwp_init() { |
|
147 | - if ( class_exists( 'FacetWP' ) ) { |
|
148 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php'; |
|
149 | - $this->facetwp = FacetWP::get_instance(); |
|
150 | - } |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * Includes the LSX Team Integration. |
|
155 | - * |
|
156 | - * @return void |
|
157 | - */ |
|
158 | - public function lsx_team_init() { |
|
159 | - if ( class_exists( 'LSX_Team' ) ) { |
|
160 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php'; |
|
161 | - $this->team = LSX_Team::get_instance(); |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - /** |
|
166 | - * Includes the Blog Integration. |
|
167 | - * |
|
168 | - * @return void |
|
169 | - */ |
|
170 | - public function lsx_article_init() { |
|
171 | - if ( wp_count_posts()->publish > 0 ) { |
|
172 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php'; |
|
173 | - $this->article = Articles::get_instance(); |
|
174 | - } |
|
175 | - } |
|
11 | + /** |
|
12 | + * Holds class instance |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * |
|
16 | + * @var object \lsx_health_plan\classes\Integrations() |
|
17 | + */ |
|
18 | + protected static $instance = null; |
|
19 | + |
|
20 | + /** |
|
21 | + * Holds class instance |
|
22 | + * |
|
23 | + * @since 1.0.0 |
|
24 | + * |
|
25 | + * @var object \MAG_CMB2_Field_Post_Search_Ajax() |
|
26 | + */ |
|
27 | + public $cmb2_post_search_ajax = false; |
|
28 | + |
|
29 | + /** |
|
30 | + * Holds class instance |
|
31 | + * |
|
32 | + * @since 1.0.0 |
|
33 | + * |
|
34 | + * @var object \lsx_health_plan\classes\Download_Monitor() |
|
35 | + */ |
|
36 | + public $download_monitor = false; |
|
37 | + |
|
38 | + /** |
|
39 | + * Holds class instance |
|
40 | + * |
|
41 | + * @since 1.0.0 |
|
42 | + * |
|
43 | + * @var object \lsx_health_plan\classes\Woocommerce() |
|
44 | + */ |
|
45 | + public $woocommerce = false; |
|
46 | + |
|
47 | + /** |
|
48 | + * Holds class instance |
|
49 | + * |
|
50 | + * @since 1.0.0 |
|
51 | + * |
|
52 | + * @var object \lsx_health_plan\classes\WP_User_Avatar() |
|
53 | + */ |
|
54 | + public $wp_user_avatar = false; |
|
55 | + |
|
56 | + /** |
|
57 | + * Holds class instance |
|
58 | + * |
|
59 | + * @since 1.0.0 |
|
60 | + * |
|
61 | + * @var object \lsx_health_plan\classes\FacetWP() |
|
62 | + */ |
|
63 | + public $facetwp = false; |
|
64 | + |
|
65 | + /** |
|
66 | + * Constructor |
|
67 | + */ |
|
68 | + public function __construct() { |
|
69 | + add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
70 | + add_action( 'init', array( $this, 'download_monitor_init' ) ); |
|
71 | + add_action( 'init', array( $this, 'woocommerce_init' ) ); |
|
72 | + add_action( 'init', array( $this, 'wp_user_avatar_init' ) ); |
|
73 | + add_action( 'init', array( $this, 'facetwp_init' ) ); |
|
74 | + add_action( 'init', array( $this, 'lsx_team_init' ) ); |
|
75 | + add_action( 'init', array( $this, 'lsx_article_init' ) ); |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * Return an instance of this class. |
|
80 | + * |
|
81 | + * @since 1.0.0 |
|
82 | + * |
|
83 | + * @return object \lsx_health_plan\classes\Integrations() A single instance of this class. |
|
84 | + */ |
|
85 | + public static function get_instance() { |
|
86 | + // If the single instance hasn't been set, set it now. |
|
87 | + if ( null === self::$instance ) { |
|
88 | + self::$instance = new self(); |
|
89 | + } |
|
90 | + return self::$instance; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Includes the Post Search Ajax if it is there. |
|
95 | + * |
|
96 | + * @return void |
|
97 | + */ |
|
98 | + public function cmb2_post_search_ajax() { |
|
99 | + require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
|
100 | + if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
101 | + $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + /** |
|
106 | + * Includes the Post Search Ajax if it is there. |
|
107 | + * |
|
108 | + * @return void |
|
109 | + */ |
|
110 | + public function download_monitor_init() { |
|
111 | + if ( function_exists( 'download_monitor' ) ) { |
|
112 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php'; |
|
113 | + $this->download_monitor = Download_Monitor::get_instance(); |
|
114 | + } |
|
115 | + } |
|
116 | + |
|
117 | + /** |
|
118 | + * Includes the Woocommerce functions. |
|
119 | + * |
|
120 | + * @return void |
|
121 | + */ |
|
122 | + public function woocommerce_init() { |
|
123 | + if ( function_exists( 'WC' ) ) { |
|
124 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php'; |
|
125 | + $this->woocommerce = Woocommerce::get_instance(); |
|
126 | + } |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * Includes the Woocommerce functions. |
|
131 | + * |
|
132 | + * @return void |
|
133 | + */ |
|
134 | + public function wp_user_avatar_init() { |
|
135 | + if ( class_exists( 'WP_User_Avatar_Setup' ) ) { |
|
136 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php'; |
|
137 | + $this->wp_user_avatar = WP_User_Avatar::get_instance(); |
|
138 | + } |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Includes the FacetWP Indexer Filters. |
|
143 | + * |
|
144 | + * @return void |
|
145 | + */ |
|
146 | + public function facetwp_init() { |
|
147 | + if ( class_exists( 'FacetWP' ) ) { |
|
148 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php'; |
|
149 | + $this->facetwp = FacetWP::get_instance(); |
|
150 | + } |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * Includes the LSX Team Integration. |
|
155 | + * |
|
156 | + * @return void |
|
157 | + */ |
|
158 | + public function lsx_team_init() { |
|
159 | + if ( class_exists( 'LSX_Team' ) ) { |
|
160 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php'; |
|
161 | + $this->team = LSX_Team::get_instance(); |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + /** |
|
166 | + * Includes the Blog Integration. |
|
167 | + * |
|
168 | + * @return void |
|
169 | + */ |
|
170 | + public function lsx_article_init() { |
|
171 | + if ( wp_count_posts()->publish > 0 ) { |
|
172 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php'; |
|
173 | + $this->article = Articles::get_instance(); |
|
174 | + } |
|
175 | + } |
|
176 | 176 | } |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * Constructor |
67 | 67 | */ |
68 | 68 | public function __construct() { |
69 | - add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
70 | - add_action( 'init', array( $this, 'download_monitor_init' ) ); |
|
71 | - add_action( 'init', array( $this, 'woocommerce_init' ) ); |
|
72 | - add_action( 'init', array( $this, 'wp_user_avatar_init' ) ); |
|
73 | - add_action( 'init', array( $this, 'facetwp_init' ) ); |
|
74 | - add_action( 'init', array( $this, 'lsx_team_init' ) ); |
|
75 | - add_action( 'init', array( $this, 'lsx_article_init' ) ); |
|
69 | + add_action('init', array($this, 'cmb2_post_search_ajax')); |
|
70 | + add_action('init', array($this, 'download_monitor_init')); |
|
71 | + add_action('init', array($this, 'woocommerce_init')); |
|
72 | + add_action('init', array($this, 'wp_user_avatar_init')); |
|
73 | + add_action('init', array($this, 'facetwp_init')); |
|
74 | + add_action('init', array($this, 'lsx_team_init')); |
|
75 | + add_action('init', array($this, 'lsx_article_init')); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function get_instance() { |
86 | 86 | // If the single instance hasn't been set, set it now. |
87 | - if ( null === self::$instance ) { |
|
87 | + if (null === self::$instance) { |
|
88 | 88 | self::$instance = new self(); |
89 | 89 | } |
90 | 90 | return self::$instance; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function cmb2_post_search_ajax() { |
99 | 99 | require_once LSX_HEALTH_PLAN_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
100 | - if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
100 | + if (method_exists('MAG_CMB2_Field_Post_Search_Ajax', 'get_instance')) { |
|
101 | 101 | $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
102 | 102 | } |
103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @return void |
109 | 109 | */ |
110 | 110 | public function download_monitor_init() { |
111 | - if ( function_exists( 'download_monitor' ) ) { |
|
111 | + if (function_exists('download_monitor')) { |
|
112 | 112 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-download-monitor.php'; |
113 | 113 | $this->download_monitor = Download_Monitor::get_instance(); |
114 | 114 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @return void |
121 | 121 | */ |
122 | 122 | public function woocommerce_init() { |
123 | - if ( function_exists( 'WC' ) ) { |
|
123 | + if (function_exists('WC')) { |
|
124 | 124 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-woocommerce.php'; |
125 | 125 | $this->woocommerce = Woocommerce::get_instance(); |
126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @return void |
133 | 133 | */ |
134 | 134 | public function wp_user_avatar_init() { |
135 | - if ( class_exists( 'WP_User_Avatar_Setup' ) ) { |
|
135 | + if (class_exists('WP_User_Avatar_Setup')) { |
|
136 | 136 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-wp-user-avatar.php'; |
137 | 137 | $this->wp_user_avatar = WP_User_Avatar::get_instance(); |
138 | 138 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @return void |
145 | 145 | */ |
146 | 146 | public function facetwp_init() { |
147 | - if ( class_exists( 'FacetWP' ) ) { |
|
147 | + if (class_exists('FacetWP')) { |
|
148 | 148 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-facetwp.php'; |
149 | 149 | $this->facetwp = FacetWP::get_instance(); |
150 | 150 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @return void |
157 | 157 | */ |
158 | 158 | public function lsx_team_init() { |
159 | - if ( class_exists( 'LSX_Team' ) ) { |
|
159 | + if (class_exists('LSX_Team')) { |
|
160 | 160 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-lsx-team.php'; |
161 | 161 | $this->team = LSX_Team::get_instance(); |
162 | 162 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @return void |
169 | 169 | */ |
170 | 170 | public function lsx_article_init() { |
171 | - if ( wp_count_posts()->publish > 0 ) { |
|
171 | + if (wp_count_posts()->publish > 0) { |
|
172 | 172 | require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/class-articles.php'; |
173 | 173 | $this->article = Articles::get_instance(); |
174 | 174 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | // If this file is called directly, abort. |
15 | 15 | if ( ! defined( 'WPINC' ) ) { |
16 | - die; |
|
16 | + die; |
|
17 | 17 | } |
18 | 18 | define( 'LSX_HEALTH_PLAN_PATH', plugin_dir_path( __FILE__ ) ); |
19 | 19 | define( 'LSX_HEALTH_PLAN_CORE', __FILE__ ); |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | * @return void |
31 | 31 | */ |
32 | 32 | function lsx_remove_extra_meta_box() { |
33 | - global $wp_meta_boxes; |
|
34 | - $all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ]; |
|
35 | - //remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' ); |
|
36 | - remove_meta_box( 'commentsdiv', $all_post_types, 'normal' ); |
|
37 | - remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' ); |
|
38 | - remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' ); |
|
33 | + global $wp_meta_boxes; |
|
34 | + $all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ]; |
|
35 | + //remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' ); |
|
36 | + remove_meta_box( 'commentsdiv', $all_post_types, 'normal' ); |
|
37 | + remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' ); |
|
38 | + remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' ); |
|
39 | 39 | } |
40 | 40 | add_action( 'add_meta_boxes', 'lsx_remove_extra_meta_box', 100 ); |
41 | 41 | |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | * @return void |
46 | 46 | */ |
47 | 47 | function lsx_login_redirect() { |
48 | - $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false ); |
|
49 | - if ( false === $plan_slug ) { |
|
50 | - $plan_slug = 'my-plan'; |
|
51 | - } |
|
52 | - return home_url( $plan_slug ); |
|
48 | + $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false ); |
|
49 | + if ( false === $plan_slug ) { |
|
50 | + $plan_slug = 'my-plan'; |
|
51 | + } |
|
52 | + return home_url( $plan_slug ); |
|
53 | 53 | } |
54 | 54 | add_filter( 'woocommerce_login_redirect', 'lsx_login_redirect' ); |
55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return object lsx_health_plan\classes\Core::get_instance(); |
60 | 60 | */ |
61 | 61 | function lsx_health_plan() { |
62 | - return \lsx_health_plan\classes\Core::get_instance(); |
|
62 | + return \lsx_health_plan\classes\Core::get_instance(); |
|
63 | 63 | } |
64 | 64 | lsx_health_plan(); |
65 | 65 | |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | * @return void |
70 | 70 | */ |
71 | 71 | function lsx_get_svg_icon( $icon ) { |
72 | - $path = '/assets/images/'; |
|
72 | + $path = '/assets/images/'; |
|
73 | 73 | |
74 | - if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) { |
|
75 | - // Load and return the contents of the file. |
|
76 | - return include LSX_HEALTH_PLAN_PATH . $path . $icon; |
|
77 | - } |
|
74 | + if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) { |
|
75 | + // Load and return the contents of the file. |
|
76 | + return include LSX_HEALTH_PLAN_PATH . $path . $icon; |
|
77 | + } |
|
78 | 78 | |
79 | - // Return a blank string if we can't find the file. |
|
80 | - return ''; |
|
79 | + // Return a blank string if we can't find the file. |
|
80 | + return ''; |
|
81 | 81 | } |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // If this file is called directly, abort. |
15 | -if ( ! defined( 'WPINC' ) ) { |
|
15 | +if ( ! defined('WPINC')) { |
|
16 | 16 | die; |
17 | 17 | } |
18 | -define( 'LSX_HEALTH_PLAN_PATH', plugin_dir_path( __FILE__ ) ); |
|
19 | -define( 'LSX_HEALTH_PLAN_CORE', __FILE__ ); |
|
20 | -define( 'LSX_HEALTH_PLAN_URL', plugin_dir_url( __FILE__ ) ); |
|
21 | -define( 'LSX_HEALTH_PLAN_VER', '1.4.0' ); |
|
18 | +define('LSX_HEALTH_PLAN_PATH', plugin_dir_path(__FILE__)); |
|
19 | +define('LSX_HEALTH_PLAN_CORE', __FILE__); |
|
20 | +define('LSX_HEALTH_PLAN_URL', plugin_dir_url(__FILE__)); |
|
21 | +define('LSX_HEALTH_PLAN_VER', '1.4.0'); |
|
22 | 22 | |
23 | 23 | /* ======================= Below is the Plugin Class init ========================= */ |
24 | 24 | |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function lsx_remove_extra_meta_box() { |
33 | 33 | global $wp_meta_boxes; |
34 | - $all_post_types = [ 'plan', 'video', 'workout', 'tip', 'recipe', 'meal' ]; |
|
34 | + $all_post_types = ['plan', 'video', 'workout', 'tip', 'recipe', 'meal']; |
|
35 | 35 | //remove_meta_box( 'wpseo_meta', $all_post_types, 'normal' ); |
36 | - remove_meta_box( 'commentsdiv', $all_post_types, 'normal' ); |
|
37 | - remove_meta_box( 'commentstatusdiv', $all_post_types, 'normal' ); |
|
38 | - remove_meta_box( 'lsx_blocks_title_meta', $all_post_types, 'side' ); |
|
36 | + remove_meta_box('commentsdiv', $all_post_types, 'normal'); |
|
37 | + remove_meta_box('commentstatusdiv', $all_post_types, 'normal'); |
|
38 | + remove_meta_box('lsx_blocks_title_meta', $all_post_types, 'side'); |
|
39 | 39 | } |
40 | -add_action( 'add_meta_boxes', 'lsx_remove_extra_meta_box', 100 ); |
|
40 | +add_action('add_meta_boxes', 'lsx_remove_extra_meta_box', 100); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Redirect user after login or redirect |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | * @return void |
46 | 46 | */ |
47 | 47 | function lsx_login_redirect() { |
48 | - $plan_slug = \lsx_health_plan\functions\get_option( 'my_plan_slug', false ); |
|
49 | - if ( false === $plan_slug ) { |
|
48 | + $plan_slug = \lsx_health_plan\functions\get_option('my_plan_slug', false); |
|
49 | + if (false === $plan_slug) { |
|
50 | 50 | $plan_slug = 'my-plan'; |
51 | 51 | } |
52 | - return home_url( $plan_slug ); |
|
52 | + return home_url($plan_slug); |
|
53 | 53 | } |
54 | -add_filter( 'woocommerce_login_redirect', 'lsx_login_redirect' ); |
|
54 | +add_filter('woocommerce_login_redirect', 'lsx_login_redirect'); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Undocumented function |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return void |
70 | 70 | */ |
71 | -function lsx_get_svg_icon( $icon ) { |
|
71 | +function lsx_get_svg_icon($icon) { |
|
72 | 72 | $path = '/assets/images/'; |
73 | 73 | |
74 | - if ( file_exists( LSX_HEALTH_PLAN_PATH . $path . $icon ) ) { |
|
74 | + if (file_exists(LSX_HEALTH_PLAN_PATH . $path . $icon)) { |
|
75 | 75 | // Load and return the contents of the file. |
76 | 76 | return include LSX_HEALTH_PLAN_PATH . $path . $icon; |
77 | 77 | } |
@@ -13,5 +13,5 @@ |
||
13 | 13 | * @return boolean |
14 | 14 | */ |
15 | 15 | function disable_sharing( $disabled ) { |
16 | - return true; |
|
16 | + return true; |
|
17 | 17 | } |
@@ -12,6 +12,6 @@ |
||
12 | 12 | * |
13 | 13 | * @return boolean |
14 | 14 | */ |
15 | -function disable_sharing( $disabled ) { |
|
15 | +function disable_sharing($disabled) { |
|
16 | 16 | return true; |
17 | 17 | } |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | global $connected_meals, $shortcode_args; |
8 | 8 | |
9 | 9 | if ( is_singular( 'plan' ) ) { |
10 | - $section_key = get_query_var( 'section' ); |
|
11 | - if ( '' !== $section_key && \lsx_health_plan\functions\plan\has_sections() ) { |
|
12 | - $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key ); |
|
13 | - if ( isset( $section_info['connected_meals'] ) && '' !== $section_info['connected_meals'] ) { |
|
14 | - $connected_meals = \lsx_health_plan\functions\prep_array( $section_info['connected_meals'] ); |
|
15 | - } |
|
16 | - } |
|
10 | + $section_key = get_query_var( 'section' ); |
|
11 | + if ( '' !== $section_key && \lsx_health_plan\functions\plan\has_sections() ) { |
|
12 | + $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key ); |
|
13 | + if ( isset( $section_info['connected_meals'] ) && '' !== $section_info['connected_meals'] ) { |
|
14 | + $connected_meals = \lsx_health_plan\functions\prep_array( $section_info['connected_meals'] ); |
|
15 | + } |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // Check for any shortcode overrides. |
20 | 20 | if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) { |
21 | - $connected_meals = array( get_the_ID() ); |
|
21 | + $connected_meals = array( get_the_ID() ); |
|
22 | 22 | } |
23 | 23 | ?> |
24 | 24 | |
@@ -26,144 +26,144 @@ discard block |
||
26 | 26 | |
27 | 27 | <?php |
28 | 28 | |
29 | - // Looking for meals. |
|
30 | - if ( empty( $connected_meals ) ) { |
|
31 | - $connected_meals = get_post_meta( get_the_ID(), 'connected_meals', true ); |
|
32 | - |
|
33 | - if ( empty( $connected_meals ) ) { |
|
34 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
35 | - if ( isset( $options['connected_meals'] ) && '' !== $options['connected_meals'] && ! empty( $options['connected_meals'] ) ) { |
|
36 | - $connected_meals = $options['connected_meals']; |
|
37 | - if ( ! array( $connected_meals ) ) { |
|
38 | - $connected_meals = array( $connected_meals ); |
|
39 | - } |
|
40 | - } |
|
41 | - } |
|
42 | - } |
|
43 | - |
|
44 | - // This is for the meal single template. |
|
45 | - if ( is_single() && is_singular( 'meal' ) ) { |
|
46 | - $connected_meals = array( get_the_ID() ); |
|
47 | - } |
|
48 | - |
|
49 | - // The top part |
|
50 | - echo wp_kses_post( wp_kses_post( lsx_health_plan_meal_main_content() ) ); |
|
51 | - |
|
52 | - if ( false !== $connected_meals && '' !== $connected_meals && ! empty( $connected_meals ) ) { |
|
53 | - |
|
54 | - $args = array( |
|
55 | - 'orderby' => 'date', |
|
56 | - 'order' => 'DESC', |
|
57 | - 'post_type' => 'meal', |
|
58 | - 'post__in' => $connected_meals, |
|
59 | - ); |
|
60 | - $meals = new WP_Query( $args ); |
|
61 | - if ( $meals->have_posts() ) { |
|
62 | - while ( $meals->have_posts() ) { |
|
63 | - $meals->the_post(); |
|
64 | - $meal_id = get_the_ID(); |
|
29 | + // Looking for meals. |
|
30 | + if ( empty( $connected_meals ) ) { |
|
31 | + $connected_meals = get_post_meta( get_the_ID(), 'connected_meals', true ); |
|
32 | + |
|
33 | + if ( empty( $connected_meals ) ) { |
|
34 | + $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
35 | + if ( isset( $options['connected_meals'] ) && '' !== $options['connected_meals'] && ! empty( $options['connected_meals'] ) ) { |
|
36 | + $connected_meals = $options['connected_meals']; |
|
37 | + if ( ! array( $connected_meals ) ) { |
|
38 | + $connected_meals = array( $connected_meals ); |
|
39 | + } |
|
40 | + } |
|
41 | + } |
|
42 | + } |
|
43 | + |
|
44 | + // This is for the meal single template. |
|
45 | + if ( is_single() && is_singular( 'meal' ) ) { |
|
46 | + $connected_meals = array( get_the_ID() ); |
|
47 | + } |
|
48 | + |
|
49 | + // The top part |
|
50 | + echo wp_kses_post( wp_kses_post( lsx_health_plan_meal_main_content() ) ); |
|
51 | + |
|
52 | + if ( false !== $connected_meals && '' !== $connected_meals && ! empty( $connected_meals ) ) { |
|
53 | + |
|
54 | + $args = array( |
|
55 | + 'orderby' => 'date', |
|
56 | + 'order' => 'DESC', |
|
57 | + 'post_type' => 'meal', |
|
58 | + 'post__in' => $connected_meals, |
|
59 | + ); |
|
60 | + $meals = new WP_Query( $args ); |
|
61 | + if ( $meals->have_posts() ) { |
|
62 | + while ( $meals->have_posts() ) { |
|
63 | + $meals->the_post(); |
|
64 | + $meal_id = get_the_ID(); |
|
65 | 65 | |
66 | 66 | |
67 | - // Breakfast. |
|
68 | - $pre_breakfast_snack = get_post_meta( get_the_ID(), 'meal_pre_breakfast_snack', true ); |
|
69 | - $breakfast = get_post_meta( get_the_ID(), 'meal_breakfast', true ); |
|
70 | - $post_breakfast_snack = get_post_meta( get_the_ID(), 'meal_breakfast_snack', true ); |
|
67 | + // Breakfast. |
|
68 | + $pre_breakfast_snack = get_post_meta( get_the_ID(), 'meal_pre_breakfast_snack', true ); |
|
69 | + $breakfast = get_post_meta( get_the_ID(), 'meal_breakfast', true ); |
|
70 | + $post_breakfast_snack = get_post_meta( get_the_ID(), 'meal_breakfast_snack', true ); |
|
71 | 71 | |
72 | - // Lunch. |
|
73 | - $pre_lunch_snack = get_post_meta( get_the_ID(), 'meal_pre_lunch_snack', true ); |
|
74 | - $lunch = get_post_meta( get_the_ID(), 'meal_lunch', true ); |
|
75 | - $post_lunch_snack = get_post_meta( get_the_ID(), 'meal_lunch_snack', true ); |
|
72 | + // Lunch. |
|
73 | + $pre_lunch_snack = get_post_meta( get_the_ID(), 'meal_pre_lunch_snack', true ); |
|
74 | + $lunch = get_post_meta( get_the_ID(), 'meal_lunch', true ); |
|
75 | + $post_lunch_snack = get_post_meta( get_the_ID(), 'meal_lunch_snack', true ); |
|
76 | 76 | |
77 | - // Dinner. |
|
78 | - $pre_dinner_snack = get_post_meta( get_the_ID(), 'meal_pre_dinner_snack', true ); |
|
79 | - $dinner = get_post_meta( get_the_ID(), 'meal_dinner', true ); |
|
80 | - $post_dinner_snack = get_post_meta( get_the_ID(), 'meal_dinner_snack', true ); |
|
77 | + // Dinner. |
|
78 | + $pre_dinner_snack = get_post_meta( get_the_ID(), 'meal_pre_dinner_snack', true ); |
|
79 | + $dinner = get_post_meta( get_the_ID(), 'meal_dinner', true ); |
|
80 | + $post_dinner_snack = get_post_meta( get_the_ID(), 'meal_dinner_snack', true ); |
|
81 | 81 | |
82 | - //Main Meals Title |
|
83 | - //echo '<h3 class="meals-section-title">' . esc_html__( 'Meal Plan', 'lsx-health-plan' ) . '</h3>'; |
|
84 | - ?> |
|
82 | + //Main Meals Title |
|
83 | + //echo '<h3 class="meals-section-title">' . esc_html__( 'Meal Plan', 'lsx-health-plan' ) . '</h3>'; |
|
84 | + ?> |
|
85 | 85 | <div class="row eating-row"> |
86 | 86 | <div class="col-md-4 eating-column"> |
87 | 87 | <?php |
88 | - if ( ! empty( $pre_breakfast_snack ) ) { |
|
89 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
90 | - echo wp_kses_post( apply_filters( 'the_content', $pre_breakfast_snack ) ); |
|
91 | - echo '</div>'; |
|
92 | - } |
|
93 | - if ( ! empty( $breakfast ) ) { |
|
94 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Breakfast', 'lsx-health-plan' ) . '</h3>'; |
|
95 | - echo wp_kses_post( apply_filters( 'the_content', $breakfast ) ); |
|
96 | - echo '</div>'; |
|
97 | - } |
|
98 | - if ( ! empty( $post_breakfast_snack ) ) { |
|
99 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
100 | - echo wp_kses_post( apply_filters( 'the_content', $post_breakfast_snack ) ); |
|
101 | - echo '</div>'; |
|
102 | - } |
|
103 | - |
|
104 | - $args = array( |
|
105 | - 'meal_id' => $meal_id, |
|
106 | - 'meal_time' => 'breakfast', |
|
107 | - ); |
|
108 | - lsx_hp_meal_plan_recipes( $args ); |
|
109 | - ?> |
|
88 | + if ( ! empty( $pre_breakfast_snack ) ) { |
|
89 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
90 | + echo wp_kses_post( apply_filters( 'the_content', $pre_breakfast_snack ) ); |
|
91 | + echo '</div>'; |
|
92 | + } |
|
93 | + if ( ! empty( $breakfast ) ) { |
|
94 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Breakfast', 'lsx-health-plan' ) . '</h3>'; |
|
95 | + echo wp_kses_post( apply_filters( 'the_content', $breakfast ) ); |
|
96 | + echo '</div>'; |
|
97 | + } |
|
98 | + if ( ! empty( $post_breakfast_snack ) ) { |
|
99 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
100 | + echo wp_kses_post( apply_filters( 'the_content', $post_breakfast_snack ) ); |
|
101 | + echo '</div>'; |
|
102 | + } |
|
103 | + |
|
104 | + $args = array( |
|
105 | + 'meal_id' => $meal_id, |
|
106 | + 'meal_time' => 'breakfast', |
|
107 | + ); |
|
108 | + lsx_hp_meal_plan_recipes( $args ); |
|
109 | + ?> |
|
110 | 110 | </div> |
111 | 111 | <div class="col-md-4 eating-column"> |
112 | 112 | <?php |
113 | - if ( ! empty( $pre_lunch_snack ) ) { |
|
114 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
115 | - echo wp_kses_post( apply_filters( 'the_content', $pre_lunch_snack ) ); |
|
116 | - echo '</div>'; |
|
117 | - } |
|
118 | - if ( ! empty( $lunch ) ) { |
|
119 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Lunch', 'lsx-health-plan' ) . '</h3>'; |
|
120 | - echo wp_kses_post( apply_filters( 'the_content', $lunch ) ); |
|
121 | - echo '</div>'; |
|
122 | - } |
|
123 | - if ( ! empty( $post_lunch_snack ) ) { |
|
124 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
125 | - echo wp_kses_post( apply_filters( 'the_content', $post_lunch_snack ) ); |
|
126 | - echo '</div>'; |
|
127 | - } |
|
128 | - |
|
129 | - $args = array( |
|
130 | - 'meal_id' => $meal_id, |
|
131 | - 'meal_time' => 'lunch', |
|
132 | - ); |
|
133 | - lsx_hp_meal_plan_recipes( $args ); |
|
134 | - ?> |
|
113 | + if ( ! empty( $pre_lunch_snack ) ) { |
|
114 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
115 | + echo wp_kses_post( apply_filters( 'the_content', $pre_lunch_snack ) ); |
|
116 | + echo '</div>'; |
|
117 | + } |
|
118 | + if ( ! empty( $lunch ) ) { |
|
119 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Lunch', 'lsx-health-plan' ) . '</h3>'; |
|
120 | + echo wp_kses_post( apply_filters( 'the_content', $lunch ) ); |
|
121 | + echo '</div>'; |
|
122 | + } |
|
123 | + if ( ! empty( $post_lunch_snack ) ) { |
|
124 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
125 | + echo wp_kses_post( apply_filters( 'the_content', $post_lunch_snack ) ); |
|
126 | + echo '</div>'; |
|
127 | + } |
|
128 | + |
|
129 | + $args = array( |
|
130 | + 'meal_id' => $meal_id, |
|
131 | + 'meal_time' => 'lunch', |
|
132 | + ); |
|
133 | + lsx_hp_meal_plan_recipes( $args ); |
|
134 | + ?> |
|
135 | 135 | </div> |
136 | 136 | <div class="col-md-4 eating-column"> |
137 | 137 | <?php |
138 | - if ( ! empty( $pre_dinner_snack ) ) { |
|
139 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
140 | - echo wp_kses_post( apply_filters( 'the_content', $pre_dinner_snack ) ); |
|
141 | - echo '</div>'; |
|
142 | - } |
|
143 | - if ( ! empty( $dinner ) ) { |
|
144 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Dinner', 'lsx-health-plan' ) . '</h3>'; |
|
145 | - echo wp_kses_post( apply_filters( 'the_content', $dinner ) ); |
|
146 | - echo '</div>'; |
|
147 | - } |
|
148 | - if ( ! empty( $post_dinner_snack ) ) { |
|
149 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
150 | - echo wp_kses_post( apply_filters( 'the_content', $post_dinner_snack ) ); |
|
151 | - echo '</div>'; |
|
152 | - } |
|
153 | - |
|
154 | - $args = array( |
|
155 | - 'meal_id' => $meal_id, |
|
156 | - 'meal_time' => 'dinner', |
|
157 | - ); |
|
158 | - lsx_hp_meal_plan_recipes( $args ); |
|
159 | - ?> |
|
138 | + if ( ! empty( $pre_dinner_snack ) ) { |
|
139 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
140 | + echo wp_kses_post( apply_filters( 'the_content', $pre_dinner_snack ) ); |
|
141 | + echo '</div>'; |
|
142 | + } |
|
143 | + if ( ! empty( $dinner ) ) { |
|
144 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Dinner', 'lsx-health-plan' ) . '</h3>'; |
|
145 | + echo wp_kses_post( apply_filters( 'the_content', $dinner ) ); |
|
146 | + echo '</div>'; |
|
147 | + } |
|
148 | + if ( ! empty( $post_dinner_snack ) ) { |
|
149 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
150 | + echo wp_kses_post( apply_filters( 'the_content', $post_dinner_snack ) ); |
|
151 | + echo '</div>'; |
|
152 | + } |
|
153 | + |
|
154 | + $args = array( |
|
155 | + 'meal_id' => $meal_id, |
|
156 | + 'meal_time' => 'dinner', |
|
157 | + ); |
|
158 | + lsx_hp_meal_plan_recipes( $args ); |
|
159 | + ?> |
|
160 | 160 | </div> |
161 | 161 | </div> |
162 | 162 | <?php |
163 | - } |
|
164 | - } |
|
165 | - } |
|
166 | - ?> |
|
163 | + } |
|
164 | + } |
|
165 | + } |
|
166 | + ?> |
|
167 | 167 | <?php wp_reset_postdata(); ?> |
168 | 168 | </div> |
169 | 169 | <?php |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | */ |
7 | 7 | global $connected_meals, $shortcode_args; |
8 | 8 | |
9 | -if ( is_singular( 'plan' ) ) { |
|
10 | - $section_key = get_query_var( 'section' ); |
|
11 | - if ( '' !== $section_key && \lsx_health_plan\functions\plan\has_sections() ) { |
|
12 | - $section_info = \lsx_health_plan\functions\plan\get_section_info( $section_key ); |
|
13 | - if ( isset( $section_info['connected_meals'] ) && '' !== $section_info['connected_meals'] ) { |
|
14 | - $connected_meals = \lsx_health_plan\functions\prep_array( $section_info['connected_meals'] ); |
|
9 | +if (is_singular('plan')) { |
|
10 | + $section_key = get_query_var('section'); |
|
11 | + if ('' !== $section_key && \lsx_health_plan\functions\plan\has_sections()) { |
|
12 | + $section_info = \lsx_health_plan\functions\plan\get_section_info($section_key); |
|
13 | + if (isset($section_info['connected_meals']) && '' !== $section_info['connected_meals']) { |
|
14 | + $connected_meals = \lsx_health_plan\functions\prep_array($section_info['connected_meals']); |
|
15 | 15 | } |
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Check for any shortcode overrides. |
20 | -if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) { |
|
21 | - $connected_meals = array( get_the_ID() ); |
|
20 | +if (null !== $shortcode_args && isset($shortcode_args['include'])) { |
|
21 | + $connected_meals = array(get_the_ID()); |
|
22 | 22 | } |
23 | 23 | ?> |
24 | 24 | |
@@ -27,57 +27,57 @@ discard block |
||
27 | 27 | <?php |
28 | 28 | |
29 | 29 | // Looking for meals. |
30 | - if ( empty( $connected_meals ) ) { |
|
31 | - $connected_meals = get_post_meta( get_the_ID(), 'connected_meals', true ); |
|
30 | + if (empty($connected_meals)) { |
|
31 | + $connected_meals = get_post_meta(get_the_ID(), 'connected_meals', true); |
|
32 | 32 | |
33 | - if ( empty( $connected_meals ) ) { |
|
34 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
35 | - if ( isset( $options['connected_meals'] ) && '' !== $options['connected_meals'] && ! empty( $options['connected_meals'] ) ) { |
|
33 | + if (empty($connected_meals)) { |
|
34 | + $options = \lsx_health_plan\functions\get_option('all'); |
|
35 | + if (isset($options['connected_meals']) && '' !== $options['connected_meals'] && ! empty($options['connected_meals'])) { |
|
36 | 36 | $connected_meals = $options['connected_meals']; |
37 | - if ( ! array( $connected_meals ) ) { |
|
38 | - $connected_meals = array( $connected_meals ); |
|
37 | + if ( ! array($connected_meals)) { |
|
38 | + $connected_meals = array($connected_meals); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | 44 | // This is for the meal single template. |
45 | - if ( is_single() && is_singular( 'meal' ) ) { |
|
46 | - $connected_meals = array( get_the_ID() ); |
|
45 | + if (is_single() && is_singular('meal')) { |
|
46 | + $connected_meals = array(get_the_ID()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // The top part |
50 | - echo wp_kses_post( wp_kses_post( lsx_health_plan_meal_main_content() ) ); |
|
50 | + echo wp_kses_post(wp_kses_post(lsx_health_plan_meal_main_content())); |
|
51 | 51 | |
52 | - if ( false !== $connected_meals && '' !== $connected_meals && ! empty( $connected_meals ) ) { |
|
52 | + if (false !== $connected_meals && '' !== $connected_meals && ! empty($connected_meals)) { |
|
53 | 53 | |
54 | - $args = array( |
|
54 | + $args = array( |
|
55 | 55 | 'orderby' => 'date', |
56 | 56 | 'order' => 'DESC', |
57 | 57 | 'post_type' => 'meal', |
58 | 58 | 'post__in' => $connected_meals, |
59 | 59 | ); |
60 | - $meals = new WP_Query( $args ); |
|
61 | - if ( $meals->have_posts() ) { |
|
62 | - while ( $meals->have_posts() ) { |
|
60 | + $meals = new WP_Query($args); |
|
61 | + if ($meals->have_posts()) { |
|
62 | + while ($meals->have_posts()) { |
|
63 | 63 | $meals->the_post(); |
64 | - $meal_id = get_the_ID(); |
|
64 | + $meal_id = get_the_ID(); |
|
65 | 65 | |
66 | 66 | |
67 | 67 | // Breakfast. |
68 | - $pre_breakfast_snack = get_post_meta( get_the_ID(), 'meal_pre_breakfast_snack', true ); |
|
69 | - $breakfast = get_post_meta( get_the_ID(), 'meal_breakfast', true ); |
|
70 | - $post_breakfast_snack = get_post_meta( get_the_ID(), 'meal_breakfast_snack', true ); |
|
68 | + $pre_breakfast_snack = get_post_meta(get_the_ID(), 'meal_pre_breakfast_snack', true); |
|
69 | + $breakfast = get_post_meta(get_the_ID(), 'meal_breakfast', true); |
|
70 | + $post_breakfast_snack = get_post_meta(get_the_ID(), 'meal_breakfast_snack', true); |
|
71 | 71 | |
72 | 72 | // Lunch. |
73 | - $pre_lunch_snack = get_post_meta( get_the_ID(), 'meal_pre_lunch_snack', true ); |
|
74 | - $lunch = get_post_meta( get_the_ID(), 'meal_lunch', true ); |
|
75 | - $post_lunch_snack = get_post_meta( get_the_ID(), 'meal_lunch_snack', true ); |
|
73 | + $pre_lunch_snack = get_post_meta(get_the_ID(), 'meal_pre_lunch_snack', true); |
|
74 | + $lunch = get_post_meta(get_the_ID(), 'meal_lunch', true); |
|
75 | + $post_lunch_snack = get_post_meta(get_the_ID(), 'meal_lunch_snack', true); |
|
76 | 76 | |
77 | 77 | // Dinner. |
78 | - $pre_dinner_snack = get_post_meta( get_the_ID(), 'meal_pre_dinner_snack', true ); |
|
79 | - $dinner = get_post_meta( get_the_ID(), 'meal_dinner', true ); |
|
80 | - $post_dinner_snack = get_post_meta( get_the_ID(), 'meal_dinner_snack', true ); |
|
78 | + $pre_dinner_snack = get_post_meta(get_the_ID(), 'meal_pre_dinner_snack', true); |
|
79 | + $dinner = get_post_meta(get_the_ID(), 'meal_dinner', true); |
|
80 | + $post_dinner_snack = get_post_meta(get_the_ID(), 'meal_dinner_snack', true); |
|
81 | 81 | |
82 | 82 | //Main Meals Title |
83 | 83 | //echo '<h3 class="meals-section-title">' . esc_html__( 'Meal Plan', 'lsx-health-plan' ) . '</h3>'; |
@@ -85,19 +85,19 @@ discard block |
||
85 | 85 | <div class="row eating-row"> |
86 | 86 | <div class="col-md-4 eating-column"> |
87 | 87 | <?php |
88 | - if ( ! empty( $pre_breakfast_snack ) ) { |
|
89 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
90 | - echo wp_kses_post( apply_filters( 'the_content', $pre_breakfast_snack ) ); |
|
88 | + if ( ! empty($pre_breakfast_snack)) { |
|
89 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
90 | + echo wp_kses_post(apply_filters('the_content', $pre_breakfast_snack)); |
|
91 | 91 | echo '</div>'; |
92 | 92 | } |
93 | - if ( ! empty( $breakfast ) ) { |
|
94 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Breakfast', 'lsx-health-plan' ) . '</h3>'; |
|
95 | - echo wp_kses_post( apply_filters( 'the_content', $breakfast ) ); |
|
93 | + if ( ! empty($breakfast)) { |
|
94 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__('Breakfast', 'lsx-health-plan') . '</h3>'; |
|
95 | + echo wp_kses_post(apply_filters('the_content', $breakfast)); |
|
96 | 96 | echo '</div>'; |
97 | 97 | } |
98 | - if ( ! empty( $post_breakfast_snack ) ) { |
|
99 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
100 | - echo wp_kses_post( apply_filters( 'the_content', $post_breakfast_snack ) ); |
|
98 | + if ( ! empty($post_breakfast_snack)) { |
|
99 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
100 | + echo wp_kses_post(apply_filters('the_content', $post_breakfast_snack)); |
|
101 | 101 | echo '</div>'; |
102 | 102 | } |
103 | 103 | |
@@ -105,24 +105,24 @@ discard block |
||
105 | 105 | 'meal_id' => $meal_id, |
106 | 106 | 'meal_time' => 'breakfast', |
107 | 107 | ); |
108 | - lsx_hp_meal_plan_recipes( $args ); |
|
108 | + lsx_hp_meal_plan_recipes($args); |
|
109 | 109 | ?> |
110 | 110 | </div> |
111 | 111 | <div class="col-md-4 eating-column"> |
112 | 112 | <?php |
113 | - if ( ! empty( $pre_lunch_snack ) ) { |
|
114 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
115 | - echo wp_kses_post( apply_filters( 'the_content', $pre_lunch_snack ) ); |
|
113 | + if ( ! empty($pre_lunch_snack)) { |
|
114 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
115 | + echo wp_kses_post(apply_filters('the_content', $pre_lunch_snack)); |
|
116 | 116 | echo '</div>'; |
117 | 117 | } |
118 | - if ( ! empty( $lunch ) ) { |
|
119 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Lunch', 'lsx-health-plan' ) . '</h3>'; |
|
120 | - echo wp_kses_post( apply_filters( 'the_content', $lunch ) ); |
|
118 | + if ( ! empty($lunch)) { |
|
119 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__('Lunch', 'lsx-health-plan') . '</h3>'; |
|
120 | + echo wp_kses_post(apply_filters('the_content', $lunch)); |
|
121 | 121 | echo '</div>'; |
122 | 122 | } |
123 | - if ( ! empty( $post_lunch_snack ) ) { |
|
124 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
125 | - echo wp_kses_post( apply_filters( 'the_content', $post_lunch_snack ) ); |
|
123 | + if ( ! empty($post_lunch_snack)) { |
|
124 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
125 | + echo wp_kses_post(apply_filters('the_content', $post_lunch_snack)); |
|
126 | 126 | echo '</div>'; |
127 | 127 | } |
128 | 128 | |
@@ -130,24 +130,24 @@ discard block |
||
130 | 130 | 'meal_id' => $meal_id, |
131 | 131 | 'meal_time' => 'lunch', |
132 | 132 | ); |
133 | - lsx_hp_meal_plan_recipes( $args ); |
|
133 | + lsx_hp_meal_plan_recipes($args); |
|
134 | 134 | ?> |
135 | 135 | </div> |
136 | 136 | <div class="col-md-4 eating-column"> |
137 | 137 | <?php |
138 | - if ( ! empty( $pre_dinner_snack ) ) { |
|
139 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
140 | - echo wp_kses_post( apply_filters( 'the_content', $pre_dinner_snack ) ); |
|
138 | + if ( ! empty($pre_dinner_snack)) { |
|
139 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
140 | + echo wp_kses_post(apply_filters('the_content', $pre_dinner_snack)); |
|
141 | 141 | echo '</div>'; |
142 | 142 | } |
143 | - if ( ! empty( $dinner ) ) { |
|
144 | - echo '<div class="content-box"><h3 class="eating-title">' . esc_html__( 'Dinner', 'lsx-health-plan' ) . '</h3>'; |
|
145 | - echo wp_kses_post( apply_filters( 'the_content', $dinner ) ); |
|
143 | + if ( ! empty($dinner)) { |
|
144 | + echo '<div class="content-box"><h3 class="eating-title">' . esc_html__('Dinner', 'lsx-health-plan') . '</h3>'; |
|
145 | + echo wp_kses_post(apply_filters('the_content', $dinner)); |
|
146 | 146 | echo '</div>'; |
147 | 147 | } |
148 | - if ( ! empty( $post_dinner_snack ) ) { |
|
149 | - echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__( 'Snack', 'lsx-health-plan' ) . '</h3>'; |
|
150 | - echo wp_kses_post( apply_filters( 'the_content', $post_dinner_snack ) ); |
|
148 | + if ( ! empty($post_dinner_snack)) { |
|
149 | + echo '<div class="content-box"><h3 class="eating-title snack-title">' . esc_html__('Snack', 'lsx-health-plan') . '</h3>'; |
|
150 | + echo wp_kses_post(apply_filters('the_content', $post_dinner_snack)); |
|
151 | 151 | echo '</div>'; |
152 | 152 | } |
153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | 'meal_id' => $meal_id, |
156 | 156 | 'meal_time' => 'dinner', |
157 | 157 | ); |
158 | - lsx_hp_meal_plan_recipes( $args ); |
|
158 | + lsx_hp_meal_plan_recipes($args); |
|
159 | 159 | ?> |
160 | 160 | </div> |
161 | 161 | </div> |
@@ -38,9 +38,12 @@ |
||
38 | 38 | |
39 | 39 | <?php endwhile; ?> |
40 | 40 | |
41 | - <?php else : ?> |
|
41 | + <?php else { |
|
42 | + : ?> |
|
42 | 43 | |
43 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
44 | + <?php get_template_part( 'partials/content', 'none' ); |
|
45 | +} |
|
46 | +?> |
|
44 | 47 | |
45 | 48 | <?php endif; ?> |
46 | 49 | </div> |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | 12 | <?php |
13 | - $page_id = get_the_ID(); |
|
14 | - $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
13 | + $page_id = get_the_ID(); |
|
14 | + $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
|
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | - ?> |
|
23 | + if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
24 | + ?> |
|
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
27 | 27 | <?php lsx_content_top(); ?> |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | <div class="row"> |
31 | 31 | <?php if ( have_posts() ) : ?> |
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
34 | - the_post(); |
|
35 | - ?> |
|
33 | + while ( have_posts() ) : |
|
34 | + the_post(); |
|
35 | + ?> |
|
36 | 36 | |
37 | 37 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-meal.php'; ?> |
38 | 38 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | </main><!-- #main --> |
52 | 52 | |
53 | 53 | <?php |
54 | - } else { |
|
55 | - wp_redirect( $redirect ); |
|
56 | - exit; |
|
57 | - } |
|
58 | - ?> |
|
54 | + } else { |
|
55 | + wp_redirect( $redirect ); |
|
56 | + exit; |
|
57 | + } |
|
58 | + ?> |
|
59 | 59 | |
60 | 60 | <?php lsx_content_after(); ?> |
61 | 61 |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | $redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id; |
15 | 15 | ?> |
16 | 16 | |
17 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
17 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
18 | 18 | |
19 | 19 | <?php lsx_content_before(); ?> |
20 | 20 | |
21 | 21 | <!-- Begining restricted content --> |
22 | 22 | <?php |
23 | - if ( current_user_can( 'administrator', $page_id ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) { |
|
23 | + if (current_user_can('administrator', $page_id) || current_user_can('wc_memberships_view_restricted_post_content', $page_id)) { |
|
24 | 24 | ?> |
25 | 25 | <main id="main" role="main"> |
26 | 26 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | <div class="post-wrapper workout-archive-plan archive-plan"> |
30 | 30 | <div class="row"> |
31 | - <?php if ( have_posts() ) : ?> |
|
31 | + <?php if (have_posts()) : ?> |
|
32 | 32 | <?php |
33 | - while ( have_posts() ) : |
|
33 | + while (have_posts()) : |
|
34 | 34 | the_post(); |
35 | 35 | ?> |
36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | <?php else : ?> |
42 | 42 | |
43 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
43 | + <?php get_template_part('partials/content', 'none'); ?> |
|
44 | 44 | |
45 | 45 | <?php endif; ?> |
46 | 46 | </div> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | <?php |
54 | 54 | } else { |
55 | - wp_redirect( $redirect ); |
|
55 | + wp_redirect($redirect); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | ?> |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | <?php } ?> |
23 | 23 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
24 | 24 | <?php |
25 | - $featured_image = get_the_post_thumbnail(); |
|
26 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
27 | - the_post_thumbnail( 'lsx-thumbnail-square', array( |
|
28 | - 'class' => 'aligncenter', |
|
29 | - ) ); |
|
30 | - } else { |
|
31 | - ?> |
|
25 | + $featured_image = get_the_post_thumbnail(); |
|
26 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
27 | + the_post_thumbnail( 'lsx-thumbnail-square', array( |
|
28 | + 'class' => 'aligncenter', |
|
29 | + ) ); |
|
30 | + } else { |
|
31 | + ?> |
|
32 | 32 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
33 | 33 | <?php |
34 | - } |
|
35 | - ?> |
|
34 | + } |
|
35 | + ?> |
|
36 | 36 | </a> |
37 | 37 | </div> |
38 | 38 | <div class="content-box meal-content-box white-bg"> |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | <?php the_title( '<h3 class="meal-title">', '</h3>' ); ?> |
41 | 41 | </a> |
42 | 42 | <?php |
43 | - if ( ! has_excerpt() ) { |
|
44 | - $content = wp_trim_words( get_the_content(), 20 ); |
|
45 | - $content = '<p>' . $content . '</p>'; |
|
46 | - } else { |
|
47 | - $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
48 | - } |
|
49 | - echo wp_kses_post( $content ); |
|
50 | - ?> |
|
43 | + if ( ! has_excerpt() ) { |
|
44 | + $content = wp_trim_words( get_the_content(), 20 ); |
|
45 | + $content = '<p>' . $content . '</p>'; |
|
46 | + } else { |
|
47 | + $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
48 | + } |
|
49 | + echo wp_kses_post( $content ); |
|
50 | + ?> |
|
51 | 51 | <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See meal', 'lsx-health-plan' ); ?></a> |
52 | 52 | </div> |
53 | 53 | <?php lsx_entry_bottom(); ?> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package lsx-health-plan |
6 | 6 | */ |
7 | 7 | |
8 | -$featured = get_post_meta( get_the_ID(), 'meal_featured_meal', true ); |
|
8 | +$featured = get_post_meta(get_the_ID(), 'meal_featured_meal', true); |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <?php lsx_entry_before(); ?> |
@@ -17,38 +17,38 @@ discard block |
||
17 | 17 | <?php lsx_hp_exercise_plan_meta(); ?> |
18 | 18 | |
19 | 19 | <div class="meal-feature-img"> |
20 | - <?php if ( $featured ) { ?> |
|
21 | - <span class="featured-meal"><?php lsx_get_svg_icon( 'icon-featured.svg' ); ?></span> |
|
20 | + <?php if ($featured) { ?> |
|
21 | + <span class="featured-meal"><?php lsx_get_svg_icon('icon-featured.svg'); ?></span> |
|
22 | 22 | <?php } ?> |
23 | - <a href="<?php echo esc_url( get_permalink() ); ?>"> |
|
23 | + <a href="<?php echo esc_url(get_permalink()); ?>"> |
|
24 | 24 | <?php |
25 | 25 | $featured_image = get_the_post_thumbnail(); |
26 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
27 | - the_post_thumbnail( 'lsx-thumbnail-square', array( |
|
26 | + if ( ! empty($featured_image) && '' !== $featured_image) { |
|
27 | + the_post_thumbnail('lsx-thumbnail-square', array( |
|
28 | 28 | 'class' => 'aligncenter', |
29 | - ) ); |
|
29 | + )); |
|
30 | 30 | } else { |
31 | 31 | ?> |
32 | - <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
|
32 | + <img loading="lazy" src="<?php echo esc_attr(plugin_dir_url(__FILE__) . '../assets/images/placeholder.jpg'); ?>"> |
|
33 | 33 | <?php |
34 | 34 | } |
35 | 35 | ?> |
36 | 36 | </a> |
37 | 37 | </div> |
38 | 38 | <div class="content-box meal-content-box white-bg"> |
39 | - <a href="<?php echo esc_url( get_permalink() ); ?>"> |
|
40 | - <?php the_title( '<h3 class="meal-title">', '</h3>' ); ?> |
|
39 | + <a href="<?php echo esc_url(get_permalink()); ?>"> |
|
40 | + <?php the_title('<h3 class="meal-title">', '</h3>'); ?> |
|
41 | 41 | </a> |
42 | 42 | <?php |
43 | - if ( ! has_excerpt() ) { |
|
44 | - $content = wp_trim_words( get_the_content(), 20 ); |
|
43 | + if ( ! has_excerpt()) { |
|
44 | + $content = wp_trim_words(get_the_content(), 20); |
|
45 | 45 | $content = '<p>' . $content . '</p>'; |
46 | 46 | } else { |
47 | - $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
47 | + $content = apply_filters('the_excerpt', get_the_excerpt()); |
|
48 | 48 | } |
49 | - echo wp_kses_post( $content ); |
|
49 | + echo wp_kses_post($content); |
|
50 | 50 | ?> |
51 | - <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See meal', 'lsx-health-plan' ); ?></a> |
|
51 | + <a href="<?php echo esc_url(get_permalink()); ?>" class="btn border-btn"><?php esc_html_e('See meal', 'lsx-health-plan'); ?></a> |
|
52 | 52 | </div> |
53 | 53 | <?php lsx_entry_bottom(); ?> |
54 | 54 | </article> |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct() { |
39 | 39 | $this->default_types = array( |
40 | - \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
41 | - \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
42 | - \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
43 | - \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
44 | - \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
40 | + \lsx_health_plan\functions\get_option('endpoint_meal', 'meal'), |
|
41 | + \lsx_health_plan\functions\get_option('endpoint_exercise_single', 'exercise'), |
|
42 | + \lsx_health_plan\functions\get_option('endpoint_recipe_single', 'recipe'), |
|
43 | + \lsx_health_plan\functions\get_option('endpoint_workout', 'workout'), |
|
44 | + \lsx_health_plan\functions\get_option('endpoint_plan', 'plan'), |
|
45 | 45 | ); |
46 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
47 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
48 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
49 | - add_action( 'cmb2_admin_init', array( $this, 'tips_connections' ), 15 ); |
|
46 | + add_action('init', array($this, 'register_post_type')); |
|
47 | + add_action('admin_menu', array($this, 'register_menus')); |
|
48 | + add_filter('lsx_health_plan_connections', array($this, 'enable_connections'), 10, 1); |
|
49 | + add_action('cmb2_admin_init', array($this, 'tips_connections'), 15); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public static function get_instance() { |
60 | 60 | // If the single instance hasn't been set, set it now. |
61 | - if ( null === self::$instance ) { |
|
61 | + if (null === self::$instance) { |
|
62 | 62 | self::$instance = new self(); |
63 | 63 | } |
64 | 64 | return self::$instance; |
@@ -68,21 +68,21 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function register_post_type() { |
70 | 70 | $labels = array( |
71 | - 'name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
72 | - 'singular_name' => esc_html__( 'Tip', 'lsx-health-plan' ), |
|
73 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
74 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
75 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
76 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
77 | - 'all_items' => esc_html__( 'All Tips', 'lsx-health-plan' ), |
|
78 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
79 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
80 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
81 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
71 | + 'name' => esc_html__('Tips', 'lsx-health-plan'), |
|
72 | + 'singular_name' => esc_html__('Tip', 'lsx-health-plan'), |
|
73 | + 'add_new' => esc_html_x('Add New', 'post type general name', 'lsx-health-plan'), |
|
74 | + 'add_new_item' => esc_html__('Add New', 'lsx-health-plan'), |
|
75 | + 'edit_item' => esc_html__('Edit', 'lsx-health-plan'), |
|
76 | + 'new_item' => esc_html__('New', 'lsx-health-plan'), |
|
77 | + 'all_items' => esc_html__('All Tips', 'lsx-health-plan'), |
|
78 | + 'view_item' => esc_html__('View', 'lsx-health-plan'), |
|
79 | + 'search_items' => esc_html__('Search', 'lsx-health-plan'), |
|
80 | + 'not_found' => esc_html__('None found', 'lsx-health-plan'), |
|
81 | + 'not_found_in_trash' => esc_html__('None found in Trash', 'lsx-health-plan'), |
|
82 | 82 | 'parent_item_colon' => '', |
83 | - 'menu_name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
83 | + 'menu_name' => esc_html__('Tips', 'lsx-health-plan'), |
|
84 | 84 | ); |
85 | - $args = array( |
|
85 | + $args = array( |
|
86 | 86 | 'labels' => $labels, |
87 | 87 | 'public' => true, |
88 | 88 | 'publicly_queryable' => false, |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | 'custom-fields', |
104 | 104 | ), |
105 | 105 | ); |
106 | - register_post_type( 'tip', $args ); |
|
106 | + register_post_type('tip', $args); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @return void |
113 | 113 | */ |
114 | 114 | public function register_menus() { |
115 | - add_submenu_page( 'edit.php?post_type=plan', esc_html__( 'Tips', 'lsx-health-plan' ), esc_html__( 'Tips', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=tip' ); |
|
115 | + add_submenu_page('edit.php?post_type=plan', esc_html__('Tips', 'lsx-health-plan'), esc_html__('Tips', 'lsx-health-plan'), 'edit_posts', 'edit.php?post_type=tip'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param array $connections |
122 | 122 | * @return void |
123 | 123 | */ |
124 | - public function enable_connections( $connections = array() ) { |
|
124 | + public function enable_connections($connections = array()) { |
|
125 | 125 | $connections['tip']['connected_plans'] = 'plan_connected_tips'; |
126 | 126 | $connections['plan']['plan_connected_tips'] = 'connected_plans'; |
127 | 127 | return $connections; |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @return void |
134 | 134 | */ |
135 | 135 | public function tips_connections() { |
136 | - foreach ( $this->default_types as $type => $default_type ) { |
|
136 | + foreach ($this->default_types as $type => $default_type) { |
|
137 | 137 | $cmb = new_cmb2_box( |
138 | 138 | array( |
139 | 139 | 'id' => $default_type . '_tips_connections_metabox', |
140 | - 'title' => __( 'Related Tips', 'lsx-health-plan' ), |
|
141 | - 'object_types' => array( $default_type ), // Post types. |
|
140 | + 'title' => __('Related Tips', 'lsx-health-plan'), |
|
141 | + 'object_types' => array($default_type), // Post types. |
|
142 | 142 | 'context' => 'normal', |
143 | 143 | 'priority' => 'high', |
144 | 144 | 'show_names' => false, |
@@ -146,15 +146,15 @@ discard block |
||
146 | 146 | ); |
147 | 147 | $cmb->add_field( |
148 | 148 | array( |
149 | - 'name' => __( 'Tips', 'lsx-health-plan' ), |
|
149 | + 'name' => __('Tips', 'lsx-health-plan'), |
|
150 | 150 | 'id' => $default_type . '_connected_tips', |
151 | - 'desc' => __( 'Connect the tips that apply to this ', 'lsx-health-plan' ) . $default_type, |
|
151 | + 'desc' => __('Connect the tips that apply to this ', 'lsx-health-plan') . $default_type, |
|
152 | 152 | 'type' => 'post_search_ajax', |
153 | 153 | 'limit' => 15, |
154 | 154 | 'sortable' => true, |
155 | 155 | 'query_args' => array( |
156 | - 'post_type' => array( 'tip' ), |
|
157 | - 'post_status' => array( 'publish' ), |
|
156 | + 'post_type' => array('tip'), |
|
157 | + 'post_status' => array('publish'), |
|
158 | 158 | 'posts_per_page' => -1, |
159 | 159 | ), |
160 | 160 | ) |
@@ -14,151 +14,151 @@ |
||
14 | 14 | */ |
15 | 15 | class Tip { |
16 | 16 | |
17 | - /** |
|
18 | - * Holds class instance |
|
19 | - * |
|
20 | - * @since 1.0.0 |
|
21 | - * |
|
22 | - * @var object \lsx_health_plan\classes\Tip() |
|
23 | - */ |
|
24 | - protected static $instance = null; |
|
17 | + /** |
|
18 | + * Holds class instance |
|
19 | + * |
|
20 | + * @since 1.0.0 |
|
21 | + * |
|
22 | + * @var object \lsx_health_plan\classes\Tip() |
|
23 | + */ |
|
24 | + protected static $instance = null; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Holds post_type slug used as an index |
|
28 | - * |
|
29 | - * @since 1.0.0 |
|
30 | - * |
|
31 | - * @var string |
|
32 | - */ |
|
33 | - public $slug = 'tip'; |
|
26 | + /** |
|
27 | + * Holds post_type slug used as an index |
|
28 | + * |
|
29 | + * @since 1.0.0 |
|
30 | + * |
|
31 | + * @var string |
|
32 | + */ |
|
33 | + public $slug = 'tip'; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Constructor |
|
37 | - */ |
|
38 | - public function __construct() { |
|
39 | - $this->default_types = array( |
|
40 | - \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
41 | - \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
42 | - \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
43 | - \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
44 | - \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
45 | - ); |
|
46 | - add_action( 'init', array( $this, 'register_post_type' ) ); |
|
47 | - add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
48 | - add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
49 | - add_action( 'cmb2_admin_init', array( $this, 'tips_connections' ), 15 ); |
|
50 | - } |
|
35 | + /** |
|
36 | + * Constructor |
|
37 | + */ |
|
38 | + public function __construct() { |
|
39 | + $this->default_types = array( |
|
40 | + \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ), |
|
41 | + \lsx_health_plan\functions\get_option( 'endpoint_exercise_single', 'exercise' ), |
|
42 | + \lsx_health_plan\functions\get_option( 'endpoint_recipe_single', 'recipe' ), |
|
43 | + \lsx_health_plan\functions\get_option( 'endpoint_workout', 'workout' ), |
|
44 | + \lsx_health_plan\functions\get_option( 'endpoint_plan', 'plan' ), |
|
45 | + ); |
|
46 | + add_action( 'init', array( $this, 'register_post_type' ) ); |
|
47 | + add_action( 'admin_menu', array( $this, 'register_menus' ) ); |
|
48 | + add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 ); |
|
49 | + add_action( 'cmb2_admin_init', array( $this, 'tips_connections' ), 15 ); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * Return an instance of this class. |
|
54 | - * |
|
55 | - * @since 1.0.0 |
|
56 | - * |
|
57 | - * @return object \lsx_health_plan\classes\Tip() A single instance of this class. |
|
58 | - */ |
|
59 | - public static function get_instance() { |
|
60 | - // If the single instance hasn't been set, set it now. |
|
61 | - if ( null === self::$instance ) { |
|
62 | - self::$instance = new self(); |
|
63 | - } |
|
64 | - return self::$instance; |
|
65 | - } |
|
66 | - /** |
|
67 | - * Register the post type. |
|
68 | - */ |
|
69 | - public function register_post_type() { |
|
70 | - $labels = array( |
|
71 | - 'name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
72 | - 'singular_name' => esc_html__( 'Tip', 'lsx-health-plan' ), |
|
73 | - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
74 | - 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
75 | - 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
76 | - 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
77 | - 'all_items' => esc_html__( 'All Tips', 'lsx-health-plan' ), |
|
78 | - 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
79 | - 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
80 | - 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
81 | - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
82 | - 'parent_item_colon' => '', |
|
83 | - 'menu_name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
84 | - ); |
|
85 | - $args = array( |
|
86 | - 'labels' => $labels, |
|
87 | - 'public' => true, |
|
88 | - 'publicly_queryable' => false, |
|
89 | - 'show_ui' => true, |
|
90 | - 'show_in_menu' => false, |
|
91 | - 'show_in_rest' => true, |
|
92 | - 'menu_icon' => 'dashicons-admin-post', |
|
93 | - 'query_var' => true, |
|
94 | - 'rewrite' => false, |
|
95 | - 'capability_type' => 'post', |
|
96 | - 'has_archive' => false, |
|
97 | - 'hierarchical' => false, |
|
98 | - 'menu_position' => null, |
|
99 | - 'supports' => array( |
|
100 | - 'title', |
|
101 | - 'editor', |
|
102 | - 'custom-fields', |
|
103 | - ), |
|
104 | - ); |
|
105 | - register_post_type( 'tip', $args ); |
|
106 | - } |
|
52 | + /** |
|
53 | + * Return an instance of this class. |
|
54 | + * |
|
55 | + * @since 1.0.0 |
|
56 | + * |
|
57 | + * @return object \lsx_health_plan\classes\Tip() A single instance of this class. |
|
58 | + */ |
|
59 | + public static function get_instance() { |
|
60 | + // If the single instance hasn't been set, set it now. |
|
61 | + if ( null === self::$instance ) { |
|
62 | + self::$instance = new self(); |
|
63 | + } |
|
64 | + return self::$instance; |
|
65 | + } |
|
66 | + /** |
|
67 | + * Register the post type. |
|
68 | + */ |
|
69 | + public function register_post_type() { |
|
70 | + $labels = array( |
|
71 | + 'name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
72 | + 'singular_name' => esc_html__( 'Tip', 'lsx-health-plan' ), |
|
73 | + 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ), |
|
74 | + 'add_new_item' => esc_html__( 'Add New', 'lsx-health-plan' ), |
|
75 | + 'edit_item' => esc_html__( 'Edit', 'lsx-health-plan' ), |
|
76 | + 'new_item' => esc_html__( 'New', 'lsx-health-plan' ), |
|
77 | + 'all_items' => esc_html__( 'All Tips', 'lsx-health-plan' ), |
|
78 | + 'view_item' => esc_html__( 'View', 'lsx-health-plan' ), |
|
79 | + 'search_items' => esc_html__( 'Search', 'lsx-health-plan' ), |
|
80 | + 'not_found' => esc_html__( 'None found', 'lsx-health-plan' ), |
|
81 | + 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ), |
|
82 | + 'parent_item_colon' => '', |
|
83 | + 'menu_name' => esc_html__( 'Tips', 'lsx-health-plan' ), |
|
84 | + ); |
|
85 | + $args = array( |
|
86 | + 'labels' => $labels, |
|
87 | + 'public' => true, |
|
88 | + 'publicly_queryable' => false, |
|
89 | + 'show_ui' => true, |
|
90 | + 'show_in_menu' => false, |
|
91 | + 'show_in_rest' => true, |
|
92 | + 'menu_icon' => 'dashicons-admin-post', |
|
93 | + 'query_var' => true, |
|
94 | + 'rewrite' => false, |
|
95 | + 'capability_type' => 'post', |
|
96 | + 'has_archive' => false, |
|
97 | + 'hierarchical' => false, |
|
98 | + 'menu_position' => null, |
|
99 | + 'supports' => array( |
|
100 | + 'title', |
|
101 | + 'editor', |
|
102 | + 'custom-fields', |
|
103 | + ), |
|
104 | + ); |
|
105 | + register_post_type( 'tip', $args ); |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * Registers the Recipes under the Meals Post type menu. |
|
110 | - * |
|
111 | - * @return void |
|
112 | - */ |
|
113 | - public function register_menus() { |
|
114 | - add_submenu_page( 'edit.php?post_type=plan', esc_html__( 'Tips', 'lsx-health-plan' ), esc_html__( 'Tips', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=tip' ); |
|
115 | - } |
|
108 | + /** |
|
109 | + * Registers the Recipes under the Meals Post type menu. |
|
110 | + * |
|
111 | + * @return void |
|
112 | + */ |
|
113 | + public function register_menus() { |
|
114 | + add_submenu_page( 'edit.php?post_type=plan', esc_html__( 'Tips', 'lsx-health-plan' ), esc_html__( 'Tips', 'lsx-health-plan' ), 'edit_posts', 'edit.php?post_type=tip' ); |
|
115 | + } |
|
116 | 116 | |
117 | - /** |
|
118 | - * Enables the Bi Directional relationships |
|
119 | - * |
|
120 | - * @param array $connections |
|
121 | - * @return void |
|
122 | - */ |
|
123 | - public function enable_connections( $connections = array() ) { |
|
124 | - $connections['tip']['connected_plans'] = 'plan_connected_tips'; |
|
125 | - $connections['plan']['plan_connected_tips'] = 'connected_plans'; |
|
126 | - return $connections; |
|
127 | - } |
|
117 | + /** |
|
118 | + * Enables the Bi Directional relationships |
|
119 | + * |
|
120 | + * @param array $connections |
|
121 | + * @return void |
|
122 | + */ |
|
123 | + public function enable_connections( $connections = array() ) { |
|
124 | + $connections['tip']['connected_plans'] = 'plan_connected_tips'; |
|
125 | + $connections['plan']['plan_connected_tips'] = 'connected_plans'; |
|
126 | + return $connections; |
|
127 | + } |
|
128 | 128 | |
129 | - /** |
|
130 | - * Registers the workout connections on the plan post type. |
|
131 | - * |
|
132 | - * @return void |
|
133 | - */ |
|
134 | - public function tips_connections() { |
|
135 | - foreach ( $this->default_types as $type => $default_type ) { |
|
136 | - $cmb = new_cmb2_box( |
|
137 | - array( |
|
138 | - 'id' => $default_type . '_tips_connections_metabox', |
|
139 | - 'title' => __( 'Related Tips', 'lsx-health-plan' ), |
|
140 | - 'object_types' => array( $default_type ), // Post types. |
|
141 | - 'context' => 'normal', |
|
142 | - 'priority' => 'high', |
|
143 | - 'show_names' => false, |
|
144 | - ) |
|
145 | - ); |
|
146 | - $cmb->add_field( |
|
147 | - array( |
|
148 | - 'name' => __( 'Tips', 'lsx-health-plan' ), |
|
149 | - 'id' => $default_type . '_connected_tips', |
|
150 | - 'desc' => __( 'Connect the tips that apply to this ', 'lsx-health-plan' ) . $default_type, |
|
151 | - 'type' => 'post_search_ajax', |
|
152 | - 'limit' => 15, |
|
153 | - 'sortable' => true, |
|
154 | - 'query_args' => array( |
|
155 | - 'post_type' => array( 'tip' ), |
|
156 | - 'post_status' => array( 'publish' ), |
|
157 | - 'posts_per_page' => -1, |
|
158 | - ), |
|
159 | - ) |
|
160 | - ); |
|
161 | - } |
|
162 | - } |
|
129 | + /** |
|
130 | + * Registers the workout connections on the plan post type. |
|
131 | + * |
|
132 | + * @return void |
|
133 | + */ |
|
134 | + public function tips_connections() { |
|
135 | + foreach ( $this->default_types as $type => $default_type ) { |
|
136 | + $cmb = new_cmb2_box( |
|
137 | + array( |
|
138 | + 'id' => $default_type . '_tips_connections_metabox', |
|
139 | + 'title' => __( 'Related Tips', 'lsx-health-plan' ), |
|
140 | + 'object_types' => array( $default_type ), // Post types. |
|
141 | + 'context' => 'normal', |
|
142 | + 'priority' => 'high', |
|
143 | + 'show_names' => false, |
|
144 | + ) |
|
145 | + ); |
|
146 | + $cmb->add_field( |
|
147 | + array( |
|
148 | + 'name' => __( 'Tips', 'lsx-health-plan' ), |
|
149 | + 'id' => $default_type . '_connected_tips', |
|
150 | + 'desc' => __( 'Connect the tips that apply to this ', 'lsx-health-plan' ) . $default_type, |
|
151 | + 'type' => 'post_search_ajax', |
|
152 | + 'limit' => 15, |
|
153 | + 'sortable' => true, |
|
154 | + 'query_args' => array( |
|
155 | + 'post_type' => array( 'tip' ), |
|
156 | + 'post_status' => array( 'publish' ), |
|
157 | + 'posts_per_page' => -1, |
|
158 | + ), |
|
159 | + ) |
|
160 | + ); |
|
161 | + } |
|
162 | + } |
|
163 | 163 | |
164 | 164 | } |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | - $lsx_hp_documentation = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/getting-started/' ); |
|
3 | - $lsx_hp_settings = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/installation/' ); |
|
4 | - $lsx_hp_features = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/' ); |
|
5 | - $version = esc_html( LSX_HEALTH_PLAN_VER ); |
|
2 | + $lsx_hp_documentation = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/getting-started/' ); |
|
3 | + $lsx_hp_settings = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/installation/' ); |
|
4 | + $lsx_hp_features = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/' ); |
|
5 | + $version = esc_html( LSX_HEALTH_PLAN_VER ); |
|
6 | 6 | |
7 | - //Product Urls |
|
8 | - $health_plan_link = esc_url( 'https://wordpress.org/plugins/lsx-health-plan/' ); |
|
9 | - $lsx_hp_plans = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/' ); |
|
10 | - $lsx_hp_weeks = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/#week' ); |
|
11 | - $lsx_hp_tips = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/tips/' ); |
|
12 | - $lsx_hp_workouts = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/workouts/' ); |
|
13 | - $lsx_hp_exercises = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/exercises/' ); |
|
14 | - $lsx_hp_meals = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/meals/' ); |
|
15 | - $lsx_hp_recipes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/recipes/' ); |
|
16 | - $lsx_hp_shortcodes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/shortcodes/' ); |
|
7 | + //Product Urls |
|
8 | + $health_plan_link = esc_url( 'https://wordpress.org/plugins/lsx-health-plan/' ); |
|
9 | + $lsx_hp_plans = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/' ); |
|
10 | + $lsx_hp_weeks = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/#week' ); |
|
11 | + $lsx_hp_tips = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/tips/' ); |
|
12 | + $lsx_hp_workouts = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/workouts/' ); |
|
13 | + $lsx_hp_exercises = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/exercises/' ); |
|
14 | + $lsx_hp_meals = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/meals/' ); |
|
15 | + $lsx_hp_recipes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/recipes/' ); |
|
16 | + $lsx_hp_shortcodes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/shortcodes/' ); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <?php |
2 | - $lsx_hp_documentation = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/getting-started/' ); |
|
3 | - $lsx_hp_settings = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/installation/' ); |
|
4 | - $lsx_hp_features = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/' ); |
|
5 | - $version = esc_html( LSX_HEALTH_PLAN_VER ); |
|
2 | + $lsx_hp_documentation = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/getting-started/'); |
|
3 | + $lsx_hp_settings = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/installation/'); |
|
4 | + $lsx_hp_features = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/'); |
|
5 | + $version = esc_html(LSX_HEALTH_PLAN_VER); |
|
6 | 6 | |
7 | 7 | //Product Urls |
8 | - $health_plan_link = esc_url( 'https://wordpress.org/plugins/lsx-health-plan/' ); |
|
9 | - $lsx_hp_plans = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/' ); |
|
10 | - $lsx_hp_weeks = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/plans/#week' ); |
|
11 | - $lsx_hp_tips = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/tips/' ); |
|
12 | - $lsx_hp_workouts = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/workouts/' ); |
|
13 | - $lsx_hp_exercises = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/exercises/' ); |
|
14 | - $lsx_hp_meals = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/meals/' ); |
|
15 | - $lsx_hp_recipes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/recipes/' ); |
|
16 | - $lsx_hp_shortcodes = esc_url( 'https://www.lsdev.biz/lsx/documentation/lsx-health/shortcodes/' ); |
|
8 | + $health_plan_link = esc_url('https://wordpress.org/plugins/lsx-health-plan/'); |
|
9 | + $lsx_hp_plans = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/plans/'); |
|
10 | + $lsx_hp_weeks = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/plans/#week'); |
|
11 | + $lsx_hp_tips = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/tips/'); |
|
12 | + $lsx_hp_workouts = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/workouts/'); |
|
13 | + $lsx_hp_exercises = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/exercises/'); |
|
14 | + $lsx_hp_meals = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/meals/'); |
|
15 | + $lsx_hp_recipes = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/recipes/'); |
|
16 | + $lsx_hp_shortcodes = esc_url('https://www.lsdev.biz/lsx/documentation/lsx-health/shortcodes/'); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 | |
@@ -22,27 +22,27 @@ discard block |
||
22 | 22 | <div class="row"> |
23 | 23 | <div class="col-md-12"> |
24 | 24 | <div class="box documentation"> |
25 | - <h2><?php esc_html_e( 'Getting Support', 'lsx-health-plan' ); ?></h2> |
|
26 | - <p><?php esc_html_e( 'Our website\'s', 'lsx-health-plan' ); ?> <a href="<?php echo wp_kses_post( $lsx_hp_documentation ); ?>" target="_blank"><?php esc_html_e( 'documentation', 'lsx-health-plan' ); ?></a> <?php esc_html_e( 'page is a great place to start to learn how to configure and customize our plugin. Here are some links to some of the key settings and modules:', 'lsx-health-plan' ); ?></p> |
|
25 | + <h2><?php esc_html_e('Getting Support', 'lsx-health-plan'); ?></h2> |
|
26 | + <p><?php esc_html_e('Our website\'s', 'lsx-health-plan'); ?> <a href="<?php echo wp_kses_post($lsx_hp_documentation); ?>" target="_blank"><?php esc_html_e('documentation', 'lsx-health-plan'); ?></a> <?php esc_html_e('page is a great place to start to learn how to configure and customize our plugin. Here are some links to some of the key settings and modules:', 'lsx-health-plan'); ?></p> |
|
27 | 27 | |
28 | 28 | <ul> |
29 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_documentation ); ?>" target="_blank"><?php esc_html_e( 'Getting Started:', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( 'Setup a new Health Plan site from scratch.', 'lsx-health-plan' ); ?></li> |
|
30 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_settings ); ?>" target="_blank"><?php esc_html_e( 'Settings overview:', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( 'A thorough walkthrough of The Health Plan site configuration options and the settings that are available to you.', 'lsx-health-plan' ); ?></li> |
|
31 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_features ); ?>" target="_blank"><?php esc_html_e( 'Features overview:', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( 'A complete look at the features you can expect to see right out of the box as well as how to use them.', 'lsx-health-plan' ); ?></li> |
|
29 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_documentation); ?>" target="_blank"><?php esc_html_e('Getting Started:', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('Setup a new Health Plan site from scratch.', 'lsx-health-plan'); ?></li> |
|
30 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_settings); ?>" target="_blank"><?php esc_html_e('Settings overview:', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('A thorough walkthrough of The Health Plan site configuration options and the settings that are available to you.', 'lsx-health-plan'); ?></li> |
|
31 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_features); ?>" target="_blank"><?php esc_html_e('Features overview:', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('A complete look at the features you can expect to see right out of the box as well as how to use them.', 'lsx-health-plan'); ?></li> |
|
32 | 32 | |
33 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_plans ); ?>" target="_blank"><?php esc_html_e( 'Plans', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Parent Post Type)', 'lsx-health-plan' ); ?></li> |
|
34 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_weeks ); ?>" target="_blank"><?php esc_html_e( 'Weeks', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Global Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
35 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_tips ); ?>" target="_blank"><?php esc_html_e( 'Tips', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Global Post type connected to all other post types)', 'lsx-health-plan' ); ?></li> |
|
36 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_workouts ); ?>" target="_blank"><?php esc_html_e( 'Workouts', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Plans Child Post Type)', 'lsx-health-plan' ); ?></li> |
|
37 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_exercises ); ?>" target="_blank"><?php esc_html_e( 'Exercises', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Workouts Child Post Type)', 'lsx-health-plan' ); ?></li> |
|
38 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_exercises ); ?>" target="_blank"><?php esc_html_e( 'Exercise Types', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Exercises Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
39 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_exercises ); ?>" target="_blank"><?php esc_html_e( 'Equipment', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Exercises Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
40 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_exercises ); ?>" target="_blank"><?php esc_html_e( 'Muscle Group ', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Exercises Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
41 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_meals ); ?>" target="_blank"><?php esc_html_e( 'Meals', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Plans Child Post Type)', 'lsx-health-plan' ); ?></li> |
|
42 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_recipes ); ?>" target="_blank"><?php esc_html_e( 'Recipes', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Meal Plans Child Post Type)', 'lsx-health-plan' ); ?></li> |
|
43 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_recipes ); ?>" target="_blank"><?php esc_html_e( 'Types', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Recipes Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
44 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_recipes ); ?>" target="_blank"><?php esc_html_e( 'Cuisines', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( '(Recipes Taxonomy)', 'lsx-health-plan' ); ?></li> |
|
45 | - <li><strong><a href="<?php echo wp_kses_post( $lsx_hp_shortcodes ); ?>" target="_blank"><?php esc_html_e( 'Shortcodes:', 'lsx-health-plan' ); ?></a></strong> <?php esc_html_e( 'Insert content blocks for any content type.', 'lsx-health-plan' ); ?></li> |
|
33 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_plans); ?>" target="_blank"><?php esc_html_e('Plans', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Parent Post Type)', 'lsx-health-plan'); ?></li> |
|
34 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_weeks); ?>" target="_blank"><?php esc_html_e('Weeks', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Global Taxonomy)', 'lsx-health-plan'); ?></li> |
|
35 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_tips); ?>" target="_blank"><?php esc_html_e('Tips', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Global Post type connected to all other post types)', 'lsx-health-plan'); ?></li> |
|
36 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_workouts); ?>" target="_blank"><?php esc_html_e('Workouts', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Plans Child Post Type)', 'lsx-health-plan'); ?></li> |
|
37 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_exercises); ?>" target="_blank"><?php esc_html_e('Exercises', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Workouts Child Post Type)', 'lsx-health-plan'); ?></li> |
|
38 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_exercises); ?>" target="_blank"><?php esc_html_e('Exercise Types', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Exercises Taxonomy)', 'lsx-health-plan'); ?></li> |
|
39 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_exercises); ?>" target="_blank"><?php esc_html_e('Equipment', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Exercises Taxonomy)', 'lsx-health-plan'); ?></li> |
|
40 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_exercises); ?>" target="_blank"><?php esc_html_e('Muscle Group ', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Exercises Taxonomy)', 'lsx-health-plan'); ?></li> |
|
41 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_meals); ?>" target="_blank"><?php esc_html_e('Meals', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Plans Child Post Type)', 'lsx-health-plan'); ?></li> |
|
42 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_recipes); ?>" target="_blank"><?php esc_html_e('Recipes', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Meal Plans Child Post Type)', 'lsx-health-plan'); ?></li> |
|
43 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_recipes); ?>" target="_blank"><?php esc_html_e('Types', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Recipes Taxonomy)', 'lsx-health-plan'); ?></li> |
|
44 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_recipes); ?>" target="_blank"><?php esc_html_e('Cuisines', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('(Recipes Taxonomy)', 'lsx-health-plan'); ?></li> |
|
45 | + <li><strong><a href="<?php echo wp_kses_post($lsx_hp_shortcodes); ?>" target="_blank"><?php esc_html_e('Shortcodes:', 'lsx-health-plan'); ?></a></strong> <?php esc_html_e('Insert content blocks for any content type.', 'lsx-health-plan'); ?></li> |
|
46 | 46 | </ul> |
47 | 47 | </div> |
48 | 48 | </div> |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | <div class="row"> |
56 | 56 | <div class="col-md-12"> |
57 | 57 | <div class="box info"> |
58 | - <h2><?php esc_html_e( 'Health Plan', 'lsx-health-plan' ); ?></h2> |
|
58 | + <h2><?php esc_html_e('Health Plan', 'lsx-health-plan'); ?></h2> |
|
59 | 59 | |
60 | 60 | <ul> |
61 | - <li><strong><?php esc_html_e( 'Latest Version:', 'lsx-health-plan' ); ?></strong> <?php echo esc_attr( $version ); ?></li> |
|
62 | - <li><strong><?php esc_html_e( 'Requires:', 'lsx-health-plan' ); ?></strong> <?php esc_html_e( 'WordPress 5.0+', 'lsx-health-plan' ); ?></li> |
|
63 | - <li><strong><?php esc_html_e( 'Tested up to:', 'lsx-health-plan' ); ?></strong> <?php esc_html_e( 'WordPress 5.0', 'lsx-health-plan' ); ?></li> |
|
61 | + <li><strong><?php esc_html_e('Latest Version:', 'lsx-health-plan'); ?></strong> <?php echo esc_attr($version); ?></li> |
|
62 | + <li><strong><?php esc_html_e('Requires:', 'lsx-health-plan'); ?></strong> <?php esc_html_e('WordPress 5.0+', 'lsx-health-plan'); ?></li> |
|
63 | + <li><strong><?php esc_html_e('Tested up to:', 'lsx-health-plan'); ?></strong> <?php esc_html_e('WordPress 5.0', 'lsx-health-plan'); ?></li> |
|
64 | 64 | </ul> |
65 | 65 | |
66 | 66 | <div class="more-button"> |
67 | - <a href="<?php echo wp_kses_post( $health_plan_link ); ?>" target="_blank" class="button button-primary"> |
|
68 | - <?php esc_html_e( 'Visit plugin website', 'lsx-health-plan' ); ?> |
|
67 | + <a href="<?php echo wp_kses_post($health_plan_link); ?>" target="_blank" class="button button-primary"> |
|
68 | + <?php esc_html_e('Visit plugin website', 'lsx-health-plan'); ?> |
|
69 | 69 | </a> |
70 | 70 | </div> |
71 | 71 | </div> |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | <div class="row"> |
76 | 76 | <div class="col-md-12"> |
77 | 77 | <div class="box news"> |
78 | - <h3><?php esc_html_e( 'Support', 'lsx-health-plan' ); ?></h3> |
|
79 | - <p><?php esc_html_e( 'If the documentation is not getting you where you need to be, you can contact us directly for support and assistance.', 'lsx-health-plan' ); ?></p> |
|
80 | - <p><?php esc_html_e( 'You can contact us for support at', 'lsx-health-plan' ); ?> <a href="mailto:[email protected]"><?php esc_html_e( '[email protected].', 'lsx-health-plan' ); ?></a></p> |
|
78 | + <h3><?php esc_html_e('Support', 'lsx-health-plan'); ?></h3> |
|
79 | + <p><?php esc_html_e('If the documentation is not getting you where you need to be, you can contact us directly for support and assistance.', 'lsx-health-plan'); ?></p> |
|
80 | + <p><?php esc_html_e('You can contact us for support at', 'lsx-health-plan'); ?> <a href="mailto:[email protected]"><?php esc_html_e('[email protected].', 'lsx-health-plan'); ?></a></p> |
|
81 | 81 | </div> |
82 | 82 | </div> |
83 | 83 | </div> |
@@ -12,134 +12,134 @@ |
||
12 | 12 | */ |
13 | 13 | class Help_Page { |
14 | 14 | |
15 | - /** |
|
16 | - * Holds class instance |
|
17 | - * |
|
18 | - * @since 1.0.0 |
|
19 | - * |
|
20 | - * @var object \lsx_health_plan\classes\admin\Help_Page() |
|
21 | - */ |
|
22 | - protected static $instance = null; |
|
23 | - |
|
24 | - /** |
|
25 | - * Option key, and option page slug |
|
26 | - * |
|
27 | - * @var string |
|
28 | - */ |
|
29 | - protected $screen_id = 'lsx_hp_help'; |
|
30 | - |
|
31 | - /** |
|
32 | - * Constructor |
|
33 | - */ |
|
34 | - public function __construct() { |
|
35 | - add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); |
|
36 | - add_action( 'admin_menu', array( $this, 'register_menu' ) ); |
|
37 | - add_action( 'lsx_hp_help', array( $this, 'header' ), 10 ); |
|
38 | - add_action( 'lsx_hp_help', array( $this, 'body' ), 20 ); |
|
39 | - add_action( 'lsx_hp_help', array( $this, 'footer' ), 30 ); |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * Return an instance of this class. |
|
44 | - * |
|
45 | - * @since 1.0.0 |
|
46 | - * |
|
47 | - * @return object \lsx_health_plan\classes\admin\Help_Page() A single instance of this class. |
|
48 | - */ |
|
49 | - public static function get_instance() { |
|
50 | - // If the single instance hasn't been set, set it now. |
|
51 | - if ( null === self::$instance ) { |
|
52 | - self::$instance = new self(); |
|
53 | - } |
|
54 | - return self::$instance; |
|
55 | - } |
|
56 | - |
|
57 | - |
|
58 | - |
|
59 | - /** |
|
60 | - * Load hp_help screen css. |
|
61 | - * |
|
62 | - * @package lsx |
|
63 | - * @subpackage hp-help-page |
|
64 | - * |
|
65 | - * @param string $hook_suffix the current page hook suffix. |
|
66 | - */ |
|
67 | - public function assets( $hook_suffix ) { |
|
68 | - if ( 'plan_page_help' === $hook_suffix ) { |
|
69 | - wp_enqueue_style( 'lsx-hp-help-screen', LSX_HEALTH_PLAN_URL . 'assets/css/help.css', array(), LSX_HEALTH_PLAN_VER ); |
|
70 | - wp_style_add_data( 'lsx-hp-help-screen', 'rtl', 'replace' ); |
|
71 | - } |
|
72 | - } |
|
73 | - |
|
74 | - /** |
|
75 | - * Creates the dashboard page. |
|
76 | - * |
|
77 | - * @package lsx |
|
78 | - * @subpackage hp-help-page |
|
79 | - */ |
|
80 | - public function register_menu() { |
|
81 | - add_submenu_page( 'edit.php?post_type=plan', __( 'Help', 'lsx-health-plan' ), __( 'Help', 'lsx-health-plan' ), 'manage_options', 'help', array( $this, 'screen' ) ); |
|
82 | - } |
|
83 | - |
|
84 | - |
|
85 | - /** |
|
86 | - * The help screen. |
|
87 | - * |
|
88 | - * @package lsx |
|
89 | - * @subpackage hp-help-page |
|
90 | - */ |
|
91 | - public function screen() { |
|
92 | - require_once ABSPATH . 'wp-load.php'; |
|
93 | - require_once ABSPATH . 'wp-admin/admin.php'; |
|
94 | - require_once ABSPATH . 'wp-admin/admin-header.php'; |
|
95 | - ?> |
|
15 | + /** |
|
16 | + * Holds class instance |
|
17 | + * |
|
18 | + * @since 1.0.0 |
|
19 | + * |
|
20 | + * @var object \lsx_health_plan\classes\admin\Help_Page() |
|
21 | + */ |
|
22 | + protected static $instance = null; |
|
23 | + |
|
24 | + /** |
|
25 | + * Option key, and option page slug |
|
26 | + * |
|
27 | + * @var string |
|
28 | + */ |
|
29 | + protected $screen_id = 'lsx_hp_help'; |
|
30 | + |
|
31 | + /** |
|
32 | + * Constructor |
|
33 | + */ |
|
34 | + public function __construct() { |
|
35 | + add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); |
|
36 | + add_action( 'admin_menu', array( $this, 'register_menu' ) ); |
|
37 | + add_action( 'lsx_hp_help', array( $this, 'header' ), 10 ); |
|
38 | + add_action( 'lsx_hp_help', array( $this, 'body' ), 20 ); |
|
39 | + add_action( 'lsx_hp_help', array( $this, 'footer' ), 30 ); |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * Return an instance of this class. |
|
44 | + * |
|
45 | + * @since 1.0.0 |
|
46 | + * |
|
47 | + * @return object \lsx_health_plan\classes\admin\Help_Page() A single instance of this class. |
|
48 | + */ |
|
49 | + public static function get_instance() { |
|
50 | + // If the single instance hasn't been set, set it now. |
|
51 | + if ( null === self::$instance ) { |
|
52 | + self::$instance = new self(); |
|
53 | + } |
|
54 | + return self::$instance; |
|
55 | + } |
|
56 | + |
|
57 | + |
|
58 | + |
|
59 | + /** |
|
60 | + * Load hp_help screen css. |
|
61 | + * |
|
62 | + * @package lsx |
|
63 | + * @subpackage hp-help-page |
|
64 | + * |
|
65 | + * @param string $hook_suffix the current page hook suffix. |
|
66 | + */ |
|
67 | + public function assets( $hook_suffix ) { |
|
68 | + if ( 'plan_page_help' === $hook_suffix ) { |
|
69 | + wp_enqueue_style( 'lsx-hp-help-screen', LSX_HEALTH_PLAN_URL . 'assets/css/help.css', array(), LSX_HEALTH_PLAN_VER ); |
|
70 | + wp_style_add_data( 'lsx-hp-help-screen', 'rtl', 'replace' ); |
|
71 | + } |
|
72 | + } |
|
73 | + |
|
74 | + /** |
|
75 | + * Creates the dashboard page. |
|
76 | + * |
|
77 | + * @package lsx |
|
78 | + * @subpackage hp-help-page |
|
79 | + */ |
|
80 | + public function register_menu() { |
|
81 | + add_submenu_page( 'edit.php?post_type=plan', __( 'Help', 'lsx-health-plan' ), __( 'Help', 'lsx-health-plan' ), 'manage_options', 'help', array( $this, 'screen' ) ); |
|
82 | + } |
|
83 | + |
|
84 | + |
|
85 | + /** |
|
86 | + * The help screen. |
|
87 | + * |
|
88 | + * @package lsx |
|
89 | + * @subpackage hp-help-page |
|
90 | + */ |
|
91 | + public function screen() { |
|
92 | + require_once ABSPATH . 'wp-load.php'; |
|
93 | + require_once ABSPATH . 'wp-admin/admin.php'; |
|
94 | + require_once ABSPATH . 'wp-admin/admin-header.php'; |
|
95 | + ?> |
|
96 | 96 | <div class="wrap about-wrap"> |
97 | 97 | <?php |
98 | - /** |
|
99 | - * Functions hooked into lsx_hp_help action |
|
100 | - * |
|
101 | - * @hooked lsx_hp_help_header - 10 |
|
102 | - * @hooked lsx_hp_help_body - 20 |
|
103 | - * @hooked lsx_hp_help_footer - 30 |
|
104 | - */ |
|
105 | - do_action( 'lsx_hp_help' ); |
|
106 | - ?> |
|
98 | + /** |
|
99 | + * Functions hooked into lsx_hp_help action |
|
100 | + * |
|
101 | + * @hooked lsx_hp_help_header - 10 |
|
102 | + * @hooked lsx_hp_help_body - 20 |
|
103 | + * @hooked lsx_hp_help_footer - 30 |
|
104 | + */ |
|
105 | + do_action( 'lsx_hp_help' ); |
|
106 | + ?> |
|
107 | 107 | </div> |
108 | 108 | <?php |
109 | - } |
|
110 | - |
|
111 | - /** |
|
112 | - * Help screen intro. |
|
113 | - * |
|
114 | - * @package lsx |
|
115 | - * @subpackage hp-help-page |
|
116 | - */ |
|
117 | - public function header() { |
|
118 | - ?> |
|
109 | + } |
|
110 | + |
|
111 | + /** |
|
112 | + * Help screen intro. |
|
113 | + * |
|
114 | + * @package lsx |
|
115 | + * @subpackage hp-help-page |
|
116 | + */ |
|
117 | + public function header() { |
|
118 | + ?> |
|
119 | 119 | <div class="enrich"> |
120 | 120 | <h2><?php esc_html_e( 'LightSpeed’s LSX Health Plugin', 'lsx-health-plan' ); ?></h2> |
121 | 121 | <p><?php esc_html_e( "Thank you for using the LSX Health plugin. All of us here at LightSpeed appreciate your ongoing support and we can't wait to see what people create with the plugin. We're committed to ensuring you have all the help you need to make the most of the plugin.", 'lsx-health-plan' ); ?></p> |
122 | 122 | </div> |
123 | 123 | <?php |
124 | - } |
|
125 | - |
|
126 | - /** |
|
127 | - * Help screen body section. |
|
128 | - * |
|
129 | - * @package lsx |
|
130 | - * @subpackage hp-help-page |
|
131 | - */ |
|
132 | - public function body() { |
|
133 | - include LSX_HEALTH_PLAN_PATH . 'templates/partials/help.php'; |
|
134 | - } |
|
135 | - |
|
136 | - /** |
|
137 | - * Help screen contribute section. |
|
138 | - * |
|
139 | - * @package lsx |
|
140 | - * @subpackage hp-help-page |
|
141 | - */ |
|
142 | - public function footer() { |
|
143 | - |
|
144 | - } |
|
124 | + } |
|
125 | + |
|
126 | + /** |
|
127 | + * Help screen body section. |
|
128 | + * |
|
129 | + * @package lsx |
|
130 | + * @subpackage hp-help-page |
|
131 | + */ |
|
132 | + public function body() { |
|
133 | + include LSX_HEALTH_PLAN_PATH . 'templates/partials/help.php'; |
|
134 | + } |
|
135 | + |
|
136 | + /** |
|
137 | + * Help screen contribute section. |
|
138 | + * |
|
139 | + * @package lsx |
|
140 | + * @subpackage hp-help-page |
|
141 | + */ |
|
142 | + public function footer() { |
|
143 | + |
|
144 | + } |
|
145 | 145 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * Constructor |
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | - add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); |
|
36 | - add_action( 'admin_menu', array( $this, 'register_menu' ) ); |
|
37 | - add_action( 'lsx_hp_help', array( $this, 'header' ), 10 ); |
|
38 | - add_action( 'lsx_hp_help', array( $this, 'body' ), 20 ); |
|
39 | - add_action( 'lsx_hp_help', array( $this, 'footer' ), 30 ); |
|
35 | + add_action('admin_enqueue_scripts', array($this, 'assets')); |
|
36 | + add_action('admin_menu', array($this, 'register_menu')); |
|
37 | + add_action('lsx_hp_help', array($this, 'header'), 10); |
|
38 | + add_action('lsx_hp_help', array($this, 'body'), 20); |
|
39 | + add_action('lsx_hp_help', array($this, 'footer'), 30); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public static function get_instance() { |
50 | 50 | // If the single instance hasn't been set, set it now. |
51 | - if ( null === self::$instance ) { |
|
51 | + if (null === self::$instance) { |
|
52 | 52 | self::$instance = new self(); |
53 | 53 | } |
54 | 54 | return self::$instance; |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @param string $hook_suffix the current page hook suffix. |
66 | 66 | */ |
67 | - public function assets( $hook_suffix ) { |
|
68 | - if ( 'plan_page_help' === $hook_suffix ) { |
|
69 | - wp_enqueue_style( 'lsx-hp-help-screen', LSX_HEALTH_PLAN_URL . 'assets/css/help.css', array(), LSX_HEALTH_PLAN_VER ); |
|
70 | - wp_style_add_data( 'lsx-hp-help-screen', 'rtl', 'replace' ); |
|
67 | + public function assets($hook_suffix) { |
|
68 | + if ('plan_page_help' === $hook_suffix) { |
|
69 | + wp_enqueue_style('lsx-hp-help-screen', LSX_HEALTH_PLAN_URL . 'assets/css/help.css', array(), LSX_HEALTH_PLAN_VER); |
|
70 | + wp_style_add_data('lsx-hp-help-screen', 'rtl', 'replace'); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @subpackage hp-help-page |
79 | 79 | */ |
80 | 80 | public function register_menu() { |
81 | - add_submenu_page( 'edit.php?post_type=plan', __( 'Help', 'lsx-health-plan' ), __( 'Help', 'lsx-health-plan' ), 'manage_options', 'help', array( $this, 'screen' ) ); |
|
81 | + add_submenu_page('edit.php?post_type=plan', __('Help', 'lsx-health-plan'), __('Help', 'lsx-health-plan'), 'manage_options', 'help', array($this, 'screen')); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @hooked lsx_hp_help_body - 20 |
103 | 103 | * @hooked lsx_hp_help_footer - 30 |
104 | 104 | */ |
105 | - do_action( 'lsx_hp_help' ); |
|
105 | + do_action('lsx_hp_help'); |
|
106 | 106 | ?> |
107 | 107 | </div> |
108 | 108 | <?php |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | public function header() { |
118 | 118 | ?> |
119 | 119 | <div class="enrich"> |
120 | - <h2><?php esc_html_e( 'LightSpeed’s LSX Health Plugin', 'lsx-health-plan' ); ?></h2> |
|
121 | - <p><?php esc_html_e( "Thank you for using the LSX Health plugin. All of us here at LightSpeed appreciate your ongoing support and we can't wait to see what people create with the plugin. We're committed to ensuring you have all the help you need to make the most of the plugin.", 'lsx-health-plan' ); ?></p> |
|
120 | + <h2><?php esc_html_e('LightSpeed’s LSX Health Plugin', 'lsx-health-plan'); ?></h2> |
|
121 | + <p><?php esc_html_e("Thank you for using the LSX Health plugin. All of us here at LightSpeed appreciate your ongoing support and we can't wait to see what people create with the plugin. We're committed to ensuring you have all the help you need to make the most of the plugin.", 'lsx-health-plan'); ?></p> |
|
122 | 122 | </div> |
123 | 123 | <?php |
124 | 124 | } |