@@ -8,46 +8,46 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | class WP_User_Avatar { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * Holds class instance |
|
| 13 | - * |
|
| 14 | - * @since 1.0.0 |
|
| 15 | - * |
|
| 16 | - * @var object \lsx_health_plan\classes\Woocommerce() |
|
| 17 | - */ |
|
| 18 | - protected static $instance = null; |
|
| 11 | + /** |
|
| 12 | + * Holds class instance |
|
| 13 | + * |
|
| 14 | + * @since 1.0.0 |
|
| 15 | + * |
|
| 16 | + * @var object \lsx_health_plan\classes\Woocommerce() |
|
| 17 | + */ |
|
| 18 | + protected static $instance = null; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Constructor |
|
| 22 | - */ |
|
| 23 | - public function __construct() { |
|
| 24 | - add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
| 25 | - } |
|
| 20 | + /** |
|
| 21 | + * Constructor |
|
| 22 | + */ |
|
| 23 | + public function __construct() { |
|
| 24 | + add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Return an instance of this class. |
|
| 29 | - * |
|
| 30 | - * @since 1.0.0 |
|
| 31 | - * |
|
| 32 | - * @return object \lsx_health_plan\classes\Woocommerce() A single instance of this class. |
|
| 33 | - */ |
|
| 34 | - public static function get_instance() { |
|
| 35 | - // If the single instance hasn't been set, set it now. |
|
| 36 | - if ( null === self::$instance ) { |
|
| 37 | - self::$instance = new self(); |
|
| 38 | - } |
|
| 39 | - return self::$instance; |
|
| 40 | - } |
|
| 27 | + /** |
|
| 28 | + * Return an instance of this class. |
|
| 29 | + * |
|
| 30 | + * @since 1.0.0 |
|
| 31 | + * |
|
| 32 | + * @return object \lsx_health_plan\classes\Woocommerce() A single instance of this class. |
|
| 33 | + */ |
|
| 34 | + public static function get_instance() { |
|
| 35 | + // If the single instance hasn't been set, set it now. |
|
| 36 | + if ( null === self::$instance ) { |
|
| 37 | + self::$instance = new self(); |
|
| 38 | + } |
|
| 39 | + return self::$instance; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Changes the profile title |
|
| 44 | - * |
|
| 45 | - * @param string $title |
|
| 46 | - * @return string |
|
| 47 | - */ |
|
| 48 | - public function profile_title( $title ) { |
|
| 49 | - $title = '<h3>' . __( 'My Profile', 'lsx-health-plan' ) . '</h3>'; |
|
| 50 | - $title .= '<p class="tagline">' . __( 'Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan' ) . '</p>'; |
|
| 51 | - return $title; |
|
| 52 | - } |
|
| 42 | + /** |
|
| 43 | + * Changes the profile title |
|
| 44 | + * |
|
| 45 | + * @param string $title |
|
| 46 | + * @return string |
|
| 47 | + */ |
|
| 48 | + public function profile_title( $title ) { |
|
| 49 | + $title = '<h3>' . __( 'My Profile', 'lsx-health-plan' ) . '</h3>'; |
|
| 50 | + $title .= '<p class="tagline">' . __( 'Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan' ) . '</p>'; |
|
| 51 | + return $title; |
|
| 52 | + } |
|
| 53 | 53 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * Constructor |
| 22 | 22 | */ |
| 23 | 23 | public function __construct() { |
| 24 | - add_filter( 'wpua_profile_title', array( $this, 'profile_title' ), 10, 1 ); |
|
| 24 | + add_filter('wpua_profile_title', array($this, 'profile_title'), 10, 1); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public static function get_instance() { |
| 35 | 35 | // If the single instance hasn't been set, set it now. |
| 36 | - if ( null === self::$instance ) { |
|
| 36 | + if (null === self::$instance) { |
|
| 37 | 37 | self::$instance = new self(); |
| 38 | 38 | } |
| 39 | 39 | return self::$instance; |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | * @param string $title |
| 46 | 46 | * @return string |
| 47 | 47 | */ |
| 48 | - public function profile_title( $title ) { |
|
| 49 | - $title = '<h3>' . __( 'My Profile', 'lsx-health-plan' ) . '</h3>'; |
|
| 50 | - $title .= '<p class="tagline">' . __( 'Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan' ) . '</p>'; |
|
| 48 | + public function profile_title($title) { |
|
| 49 | + $title = '<h3>' . __('My Profile', 'lsx-health-plan') . '</h3>'; |
|
| 50 | + $title .= '<p class="tagline">' . __('Please upload an image of yourself in .jpeg format. Images should be square, to best fit the cropping area, and files sizes kept below 500kb.', 'lsx-health-plan') . '</p>'; |
|
| 51 | 51 | return $title; |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -10,186 +10,186 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | class Settings_Theme { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Holds class instance |
|
| 15 | - * |
|
| 16 | - * @since 1.0.0 |
|
| 17 | - * |
|
| 18 | - * @var object \lsx_health_plan\classes\admin\Settings_Theme() |
|
| 19 | - */ |
|
| 20 | - protected static $instance = null; |
|
| 13 | + /** |
|
| 14 | + * Holds class instance |
|
| 15 | + * |
|
| 16 | + * @since 1.0.0 |
|
| 17 | + * |
|
| 18 | + * @var object \lsx_health_plan\classes\admin\Settings_Theme() |
|
| 19 | + */ |
|
| 20 | + protected static $instance = null; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Will return true if this is the LSX Search settings page. |
|
| 24 | - * |
|
| 25 | - * @var array |
|
| 26 | - */ |
|
| 27 | - public $is_options_page = false; |
|
| 22 | + /** |
|
| 23 | + * Will return true if this is the LSX Search settings page. |
|
| 24 | + * |
|
| 25 | + * @var array |
|
| 26 | + */ |
|
| 27 | + public $is_options_page = false; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Holds the id and labels for the navigation. |
|
| 31 | - * |
|
| 32 | - * @var array |
|
| 33 | - */ |
|
| 34 | - public $navigation = array(); |
|
| 29 | + /** |
|
| 30 | + * Holds the id and labels for the navigation. |
|
| 31 | + * |
|
| 32 | + * @var array |
|
| 33 | + */ |
|
| 34 | + public $navigation = array(); |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Constructor |
|
| 38 | - */ |
|
| 39 | - public function __construct() { |
|
| 40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
| 41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
| 42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
| 43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
| 44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
| 45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
| 46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
| 47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
| 48 | - } |
|
| 36 | + /** |
|
| 37 | + * Constructor |
|
| 38 | + */ |
|
| 39 | + public function __construct() { |
|
| 40 | + add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
| 41 | + add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
| 42 | + add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
| 43 | + add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
| 44 | + add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
| 45 | + add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
| 46 | + add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
| 47 | + add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Return an instance of this class. |
|
| 52 | - * |
|
| 53 | - * @since 1.0.0 |
|
| 54 | - * |
|
| 55 | - * @return object \lsx_health_plan\classes\admin\Settings_Theme() A single instance of this class. |
|
| 56 | - */ |
|
| 57 | - public static function get_instance() { |
|
| 58 | - // If the single instance hasn't been set, set it now. |
|
| 59 | - if ( null == self::$instance ) { |
|
| 60 | - self::$instance = new self(); |
|
| 61 | - } |
|
| 62 | - return self::$instance; |
|
| 63 | - } |
|
| 50 | + /** |
|
| 51 | + * Return an instance of this class. |
|
| 52 | + * |
|
| 53 | + * @since 1.0.0 |
|
| 54 | + * |
|
| 55 | + * @return object \lsx_health_plan\classes\admin\Settings_Theme() A single instance of this class. |
|
| 56 | + */ |
|
| 57 | + public static function get_instance() { |
|
| 58 | + // If the single instance hasn't been set, set it now. |
|
| 59 | + if ( null == self::$instance ) { |
|
| 60 | + self::$instance = new self(); |
|
| 61 | + } |
|
| 62 | + return self::$instance; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Disable CMB2 styles on front end forms. |
|
| 67 | - * |
|
| 68 | - * @return bool $enabled Whether to enable (enqueue) styles. |
|
| 69 | - */ |
|
| 70 | - public function disable_cmb2_styles( $enabled ) { |
|
| 71 | - if ( is_admin() ) { |
|
| 72 | - $current_screen = get_current_screen(); |
|
| 73 | - if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
| 74 | - $enabled = false; |
|
| 75 | - } |
|
| 76 | - } |
|
| 77 | - return $enabled; |
|
| 78 | - } |
|
| 65 | + /** |
|
| 66 | + * Disable CMB2 styles on front end forms. |
|
| 67 | + * |
|
| 68 | + * @return bool $enabled Whether to enable (enqueue) styles. |
|
| 69 | + */ |
|
| 70 | + public function disable_cmb2_styles( $enabled ) { |
|
| 71 | + if ( is_admin() ) { |
|
| 72 | + $current_screen = get_current_screen(); |
|
| 73 | + if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
| 74 | + $enabled = false; |
|
| 75 | + } |
|
| 76 | + } |
|
| 77 | + return $enabled; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * Generates the tabbed navigation for the settings page. |
|
| 82 | - * |
|
| 83 | - * @param string $cmb_id |
|
| 84 | - * @param string $object_id |
|
| 85 | - * @param string $object_type |
|
| 86 | - * @param object $cmb2_obj |
|
| 87 | - * @return void |
|
| 88 | - */ |
|
| 89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 90 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 91 | - $this->navigation = array(); |
|
| 92 | - $this->is_options_page = true; |
|
| 93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
| 94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
| 95 | - if ( 'title' === $field['type'] ) { |
|
| 96 | - $this->navigation[ $field_index ] = $field['name']; |
|
| 97 | - } |
|
| 98 | - } |
|
| 99 | - } |
|
| 100 | - $this->output_navigation(); |
|
| 101 | - } |
|
| 102 | - } |
|
| 80 | + /** |
|
| 81 | + * Generates the tabbed navigation for the settings page. |
|
| 82 | + * |
|
| 83 | + * @param string $cmb_id |
|
| 84 | + * @param string $object_id |
|
| 85 | + * @param string $object_type |
|
| 86 | + * @param object $cmb2_obj |
|
| 87 | + * @return void |
|
| 88 | + */ |
|
| 89 | + public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 90 | + if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 91 | + $this->navigation = array(); |
|
| 92 | + $this->is_options_page = true; |
|
| 93 | + if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
| 94 | + foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
| 95 | + if ( 'title' === $field['type'] ) { |
|
| 96 | + $this->navigation[ $field_index ] = $field['name']; |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | + } |
|
| 100 | + $this->output_navigation(); |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Outputs the WP style navigation for the Settings page. |
|
| 106 | - * |
|
| 107 | - * @return void |
|
| 108 | - */ |
|
| 109 | - public function output_navigation() { |
|
| 110 | - if ( ! empty( $this->navigation ) ) { |
|
| 111 | - ?> |
|
| 104 | + /** |
|
| 105 | + * Outputs the WP style navigation for the Settings page. |
|
| 106 | + * |
|
| 107 | + * @return void |
|
| 108 | + */ |
|
| 109 | + public function output_navigation() { |
|
| 110 | + if ( ! empty( $this->navigation ) ) { |
|
| 111 | + ?> |
|
| 112 | 112 | <div class="wp-filter hide-if-no-js"> |
| 113 | 113 | <ul class="filter-links"> |
| 114 | 114 | <?php |
| 115 | - $first_tab = true; |
|
| 116 | - $total = count( $this->navigation ); |
|
| 117 | - $count = 0; |
|
| 118 | - $separator = ' |'; |
|
| 119 | - $selected_tab = ''; |
|
| 120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
| 121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
| 122 | - $selected_tab = 'settings_' . $selected_tab; |
|
| 123 | - } |
|
| 124 | - foreach ( $this->navigation as $key => $label ) { |
|
| 125 | - $count++; |
|
| 126 | - $current_css = ''; |
|
| 127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
| 128 | - $first_tab = false; |
|
| 129 | - $current_css = 'current'; |
|
| 130 | - } |
|
| 131 | - if ( $count === $total ) { |
|
| 132 | - $separator = ''; |
|
| 133 | - } |
|
| 134 | - ?> |
|
| 115 | + $first_tab = true; |
|
| 116 | + $total = count( $this->navigation ); |
|
| 117 | + $count = 0; |
|
| 118 | + $separator = ' |'; |
|
| 119 | + $selected_tab = ''; |
|
| 120 | + if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
| 121 | + $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
| 122 | + $selected_tab = 'settings_' . $selected_tab; |
|
| 123 | + } |
|
| 124 | + foreach ( $this->navigation as $key => $label ) { |
|
| 125 | + $count++; |
|
| 126 | + $current_css = ''; |
|
| 127 | + if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
| 128 | + $first_tab = false; |
|
| 129 | + $current_css = 'current'; |
|
| 130 | + } |
|
| 131 | + if ( $count === $total ) { |
|
| 132 | + $separator = ''; |
|
| 133 | + } |
|
| 134 | + ?> |
|
| 135 | 135 | <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
| 136 | 136 | <?php |
| 137 | - } |
|
| 138 | - ?> |
|
| 137 | + } |
|
| 138 | + ?> |
|
| 139 | 139 | </ul> |
| 140 | 140 | </div> |
| 141 | 141 | <?php |
| 142 | - } |
|
| 143 | - } |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - /** |
|
| 146 | - * Outputs the opening tab div. |
|
| 147 | - * |
|
| 148 | - * @param object $field CMB2_Field(); |
|
| 149 | - * @return void |
|
| 150 | - */ |
|
| 151 | - public function output_tab_open_div( $field ) { |
|
| 152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
| 153 | - ?> |
|
| 145 | + /** |
|
| 146 | + * Outputs the opening tab div. |
|
| 147 | + * |
|
| 148 | + * @param object $field CMB2_Field(); |
|
| 149 | + * @return void |
|
| 150 | + */ |
|
| 151 | + public function output_tab_open_div( $field ) { |
|
| 152 | + if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
| 153 | + ?> |
|
| 154 | 154 | <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
| 155 | 155 | <?php |
| 156 | - } |
|
| 157 | - } |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | 158 | |
| 159 | - /** |
|
| 160 | - * Outputs the opening closing div. |
|
| 161 | - * |
|
| 162 | - * @param object $field CMB2_Field(); |
|
| 163 | - * @return void |
|
| 164 | - */ |
|
| 165 | - public function output_tab_closing_div( $field ) { |
|
| 166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
| 167 | - ?> |
|
| 159 | + /** |
|
| 160 | + * Outputs the opening closing div. |
|
| 161 | + * |
|
| 162 | + * @param object $field CMB2_Field(); |
|
| 163 | + * @return void |
|
| 164 | + */ |
|
| 165 | + public function output_tab_closing_div( $field ) { |
|
| 166 | + if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
| 167 | + ?> |
|
| 168 | 168 | </div> |
| 169 | 169 | <?php |
| 170 | - } |
|
| 171 | - } |
|
| 170 | + } |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
| 174 | - return; |
|
| 175 | - } |
|
| 173 | + public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
| 174 | + return; |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
| 178 | - return ''; |
|
| 179 | - } |
|
| 177 | + public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
| 178 | + return ''; |
|
| 179 | + } |
|
| 180 | 180 | |
| 181 | - /** |
|
| 182 | - * Outputs the Script for the tabbed navigation. |
|
| 183 | - * |
|
| 184 | - * @param string $cmb_id |
|
| 185 | - * @param string $object_id |
|
| 186 | - * @param string $object_type |
|
| 187 | - * @param object $cmb2_obj |
|
| 188 | - * @return void |
|
| 189 | - */ |
|
| 190 | - public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 191 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 192 | - ?> |
|
| 181 | + /** |
|
| 182 | + * Outputs the Script for the tabbed navigation. |
|
| 183 | + * |
|
| 184 | + * @param string $cmb_id |
|
| 185 | + * @param string $object_id |
|
| 186 | + * @param string $object_type |
|
| 187 | + * @param object $cmb2_obj |
|
| 188 | + * @return void |
|
| 189 | + */ |
|
| 190 | + public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 191 | + if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 192 | + ?> |
|
| 193 | 193 | <script> |
| 194 | 194 | var LSX_HP_CMB2 = Object.create( null ); |
| 195 | 195 | |
@@ -261,25 +261,25 @@ discard block |
||
| 261 | 261 | } )( jQuery, window, document ); |
| 262 | 262 | </script> |
| 263 | 263 | <?php |
| 264 | - } |
|
| 265 | - } |
|
| 264 | + } |
|
| 265 | + } |
|
| 266 | 266 | |
| 267 | - /** |
|
| 268 | - * This will add the tab selection to the url. |
|
| 269 | - * |
|
| 270 | - * @param string $url |
|
| 271 | - * @return void |
|
| 272 | - */ |
|
| 273 | - public function add_tab_argument( $url ) { |
|
| 274 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
| 275 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
| 276 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
| 277 | - if ( 'single' !== $tab_selection ) { |
|
| 278 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
| 279 | - } else { |
|
| 280 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
| 281 | - } |
|
| 282 | - } |
|
| 283 | - return $url; |
|
| 284 | - } |
|
| 267 | + /** |
|
| 268 | + * This will add the tab selection to the url. |
|
| 269 | + * |
|
| 270 | + * @param string $url |
|
| 271 | + * @return void |
|
| 272 | + */ |
|
| 273 | + public function add_tab_argument( $url ) { |
|
| 274 | + if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
| 275 | + $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
| 276 | + $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
| 277 | + if ( 'single' !== $tab_selection ) { |
|
| 278 | + $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
| 279 | + } else { |
|
| 280 | + $url = remove_query_arg( 'cmb_tab', $url ); |
|
| 281 | + } |
|
| 282 | + } |
|
| 283 | + return $url; |
|
| 284 | + } |
|
| 285 | 285 | } |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | * Constructor |
| 38 | 38 | */ |
| 39 | 39 | public function __construct() { |
| 40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
| 41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
| 42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
| 43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
| 44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
| 45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
| 46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
| 47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
| 40 | + add_filter('cmb2_enqueue_css', array($this, 'disable_cmb2_styles'), 1, 1); |
|
| 41 | + add_action('cmb2_before_form', array($this, 'generate_navigation'), 10, 4); |
|
| 42 | + add_action('cmb2_before_title_field_row', array($this, 'output_tab_open_div'), 10, 1); |
|
| 43 | + add_action('cmb2_after_tab_closing_field_row', array($this, 'output_tab_closing_div'), 10, 1); |
|
| 44 | + add_action('cmb2_render_tab_closing', array($this, 'cmb2_render_callback_for_tab_closing'), 10, 5); |
|
| 45 | + add_filter('cmb2_sanitize_tab_closing', array($this, 'cmb2_sanitize_tab_closing_callback'), 10, 2); |
|
| 46 | + add_action('cmb2_after_form', array($this, 'navigation_js'), 10, 4); |
|
| 47 | + add_filter('cmb2_options_page_redirect_url', array($this, 'add_tab_argument'), 10, 1); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function get_instance() { |
| 58 | 58 | // If the single instance hasn't been set, set it now. |
| 59 | - if ( null == self::$instance ) { |
|
| 59 | + if (null == self::$instance) { |
|
| 60 | 60 | self::$instance = new self(); |
| 61 | 61 | } |
| 62 | 62 | return self::$instance; |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return bool $enabled Whether to enable (enqueue) styles. |
| 69 | 69 | */ |
| 70 | - public function disable_cmb2_styles( $enabled ) { |
|
| 71 | - if ( is_admin() ) { |
|
| 70 | + public function disable_cmb2_styles($enabled) { |
|
| 71 | + if (is_admin()) { |
|
| 72 | 72 | $current_screen = get_current_screen(); |
| 73 | - if ( is_object( $current_screen ) && 'plan_page_lsx_health_plan_options' === $current_screen->id ) { |
|
| 73 | + if (is_object($current_screen) && 'plan_page_lsx_health_plan_options' === $current_screen->id) { |
|
| 74 | 74 | $enabled = false; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | * @param object $cmb2_obj |
| 87 | 87 | * @return void |
| 88 | 88 | */ |
| 89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 90 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 89 | + public function generate_navigation($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
| 90 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
| 91 | 91 | $this->navigation = array(); |
| 92 | 92 | $this->is_options_page = true; |
| 93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
| 94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
| 95 | - if ( 'title' === $field['type'] ) { |
|
| 96 | - $this->navigation[ $field_index ] = $field['name']; |
|
| 93 | + if (isset($cmb2_obj->meta_box['fields']) && ! empty($cmb2_obj->meta_box['fields'])) { |
|
| 94 | + foreach ($cmb2_obj->meta_box['fields'] as $field_index => $field) { |
|
| 95 | + if ('title' === $field['type']) { |
|
| 96 | + $this->navigation[$field_index] = $field['name']; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -107,32 +107,32 @@ discard block |
||
| 107 | 107 | * @return void |
| 108 | 108 | */ |
| 109 | 109 | public function output_navigation() { |
| 110 | - if ( ! empty( $this->navigation ) ) { |
|
| 110 | + if ( ! empty($this->navigation)) { |
|
| 111 | 111 | ?> |
| 112 | 112 | <div class="wp-filter hide-if-no-js"> |
| 113 | 113 | <ul class="filter-links"> |
| 114 | 114 | <?php |
| 115 | 115 | $first_tab = true; |
| 116 | - $total = count( $this->navigation ); |
|
| 116 | + $total = count($this->navigation); |
|
| 117 | 117 | $count = 0; |
| 118 | 118 | $separator = ' |'; |
| 119 | 119 | $selected_tab = ''; |
| 120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
| 121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
| 120 | + if (isset($_GET['cmb_tab']) && '' !== $_GET['cmb_tab']) { |
|
| 121 | + $selected_tab = sanitize_text_field($_GET['cmb_tab']); |
|
| 122 | 122 | $selected_tab = 'settings_' . $selected_tab; |
| 123 | 123 | } |
| 124 | - foreach ( $this->navigation as $key => $label ) { |
|
| 124 | + foreach ($this->navigation as $key => $label) { |
|
| 125 | 125 | $count++; |
| 126 | 126 | $current_css = ''; |
| 127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
| 127 | + if ((true === $first_tab && '' === $selected_tab) || $key === $selected_tab) { |
|
| 128 | 128 | $first_tab = false; |
| 129 | 129 | $current_css = 'current'; |
| 130 | 130 | } |
| 131 | - if ( $count === $total ) { |
|
| 131 | + if ($count === $total) { |
|
| 132 | 132 | $separator = ''; |
| 133 | 133 | } |
| 134 | 134 | ?> |
| 135 | - <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
|
| 135 | + <li><a href="#" class="<?php echo esc_attr($current_css); ?>" data-sort="<?php echo esc_attr($key); ?>_tab"><?php echo esc_attr($label); ?></a><?php echo esc_attr($separator); ?></li> |
|
| 136 | 136 | <?php |
| 137 | 137 | } |
| 138 | 138 | ?> |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | * @param object $field CMB2_Field(); |
| 149 | 149 | * @return void |
| 150 | 150 | */ |
| 151 | - public function output_tab_open_div( $field ) { |
|
| 152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
| 151 | + public function output_tab_open_div($field) { |
|
| 152 | + if (true === $this->is_options_page && isset($field->args['type']) && 'title' === $field->args['type']) { |
|
| 153 | 153 | ?> |
| 154 | - <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
|
| 154 | + <div id="<?php echo esc_attr($field->args['id']); ?>_tab" class="tab tab-nav hidden"> |
|
| 155 | 155 | <?php |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -162,19 +162,19 @@ discard block |
||
| 162 | 162 | * @param object $field CMB2_Field(); |
| 163 | 163 | * @return void |
| 164 | 164 | */ |
| 165 | - public function output_tab_closing_div( $field ) { |
|
| 166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
| 165 | + public function output_tab_closing_div($field) { |
|
| 166 | + if (true === $this->is_options_page && isset($field->args['type']) && 'tab_closing' === $field->args['type']) { |
|
| 167 | 167 | ?> |
| 168 | 168 | </div> |
| 169 | 169 | <?php |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
| 173 | + public function cmb2_render_callback_for_tab_closing($field, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
| 174 | 174 | return; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
| 177 | + public function cmb2_sanitize_tab_closing_callback($override_value, $value) { |
|
| 178 | 178 | return ''; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | * @param object $cmb2_obj |
| 188 | 188 | * @return void |
| 189 | 189 | */ |
| 190 | - public function navigation_js( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
| 191 | - if ( 'lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type ) { |
|
| 190 | + public function navigation_js($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
| 191 | + if ('lsx_health_plan_settings' === $cmb_id && 'lsx_health_plan_options' === $object_id && 'options-page' === $object_type) { |
|
| 192 | 192 | ?> |
| 193 | 193 | <script> |
| 194 | 194 | var LSX_HP_CMB2 = Object.create( null ); |
@@ -270,14 +270,14 @@ discard block |
||
| 270 | 270 | * @param string $url |
| 271 | 271 | * @return void |
| 272 | 272 | */ |
| 273 | - public function add_tab_argument( $url ) { |
|
| 274 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
| 275 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
| 276 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
| 277 | - if ( 'single' !== $tab_selection ) { |
|
| 278 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
| 273 | + public function add_tab_argument($url) { |
|
| 274 | + if (isset($_POST['cmb_tab']) && '' !== $_POST['cmb_tab']) { // @codingStandardsIgnoreLine |
|
| 275 | + $tab_selection = sanitize_text_field($_POST['cmb_tab']); // @codingStandardsIgnoreLine |
|
| 276 | + $tab_selection = str_replace(array('settings_', '_tab'), '', $tab_selection); // @codingStandardsIgnoreLine |
|
| 277 | + if ('single' !== $tab_selection) { |
|
| 278 | + $url = add_query_arg('cmb_tab', $tab_selection, $url); |
|
| 279 | 279 | } else { |
| 280 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
| 280 | + $url = remove_query_arg('cmb_tab', $url); |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | return $url; |
@@ -12,125 +12,125 @@ discard block |
||
| 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', get_template_directory_uri() . '/assets/css/admin/help.css', array(), LSX_VERSION ); |
|
| 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', get_template_directory_uri() . '/assets/css/admin/help.css', array(), LSX_VERSION ); |
|
| 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="box enrich"> |
| 120 | 120 | <h2><?php esc_html_e( 'Built to enrich your WordPress experience.', 'lsx-health-plan' ); ?></h2> |
| 121 | 121 | <p><?php esc_html_e( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris iaculis feugiat consectetur. Integer mollis ex lacus, sed ultrices felis mollis vitae.', '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 | - ?> |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * Help screen body section. |
|
| 128 | + * |
|
| 129 | + * @package lsx |
|
| 130 | + * @subpackage hp-help-page |
|
| 131 | + */ |
|
| 132 | + public function body() { |
|
| 133 | + ?> |
|
| 134 | 134 | <div> |
| 135 | 135 | <ul> |
| 136 | 136 | <li>Getting started: Setup a new Health Plan site from scratch.</li> |
@@ -153,15 +153,15 @@ discard block |
||
| 153 | 153 | </ul> |
| 154 | 154 | </div> |
| 155 | 155 | <?php |
| 156 | - } |
|
| 156 | + } |
|
| 157 | 157 | |
| 158 | - /** |
|
| 159 | - * Help screen contribute section. |
|
| 160 | - * |
|
| 161 | - * @package lsx |
|
| 162 | - * @subpackage hp-help-page |
|
| 163 | - */ |
|
| 164 | - public function footer() { |
|
| 158 | + /** |
|
| 159 | + * Help screen contribute section. |
|
| 160 | + * |
|
| 161 | + * @package lsx |
|
| 162 | + * @subpackage hp-help-page |
|
| 163 | + */ |
|
| 164 | + public function footer() { |
|
| 165 | 165 | |
| 166 | - } |
|
| 166 | + } |
|
| 167 | 167 | } |
@@ -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', get_template_directory_uri() . '/assets/css/admin/help.css', array(), LSX_VERSION ); |
|
| 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', get_template_directory_uri() . '/assets/css/admin/help.css', array(), LSX_VERSION); |
|
| 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="box enrich"> |
| 120 | - <h2><?php esc_html_e( 'Built to enrich your WordPress experience.', 'lsx-health-plan' ); ?></h2> |
|
| 121 | - <p><?php esc_html_e( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris iaculis feugiat consectetur. Integer mollis ex lacus, sed ultrices felis mollis vitae.', 'lsx-health-plan' ); ?></p> |
|
| 120 | + <h2><?php esc_html_e('Built to enrich your WordPress experience.', 'lsx-health-plan'); ?></h2> |
|
| 121 | + <p><?php esc_html_e('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris iaculis feugiat consectetur. Integer mollis ex lacus, sed ultrices felis mollis vitae.', 'lsx-health-plan'); ?></p> |
|
| 122 | 122 | </div> |
| 123 | 123 | <?php |
| 124 | 124 | } |
@@ -12,52 +12,52 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Exercise { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Holds class instance |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - * |
|
| 20 | - * @var object \lsx_health_plan\classes\admin\Exercise() |
|
| 21 | - */ |
|
| 22 | - protected static $instance = null; |
|
| 15 | + /** |
|
| 16 | + * Holds class instance |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + * |
|
| 20 | + * @var object \lsx_health_plan\classes\admin\Exercise() |
|
| 21 | + */ |
|
| 22 | + protected static $instance = null; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Constructor |
|
| 26 | - */ |
|
| 27 | - public function __construct() { |
|
| 28 | - add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | - } |
|
| 24 | + /** |
|
| 25 | + * Constructor |
|
| 26 | + */ |
|
| 27 | + public function __construct() { |
|
| 28 | + add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Return an instance of this class. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.0 |
|
| 35 | - * |
|
| 36 | - * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
| 37 | - */ |
|
| 38 | - public static function get_instance() { |
|
| 39 | - // If the single instance hasn't been set, set it now. |
|
| 40 | - if ( null === self::$instance ) { |
|
| 41 | - self::$instance = new self(); |
|
| 42 | - } |
|
| 43 | - return self::$instance; |
|
| 44 | - } |
|
| 31 | + /** |
|
| 32 | + * Return an instance of this class. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.0 |
|
| 35 | + * |
|
| 36 | + * @return object \lsx_health_plan\classes\admin\Exercise() A single instance of this class. |
|
| 37 | + */ |
|
| 38 | + public static function get_instance() { |
|
| 39 | + // If the single instance hasn't been set, set it now. |
|
| 40 | + if ( null === self::$instance ) { |
|
| 41 | + self::$instance = new self(); |
|
| 42 | + } |
|
| 43 | + return self::$instance; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Registers the general settings. |
|
| 48 | - * |
|
| 49 | - * @param object $cmb new_cmb2_box(). |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function settings( $cmb ) { |
|
| 53 | - $cmb->add_field( |
|
| 54 | - array( |
|
| 55 | - 'id' => 'exercise_archive_description', |
|
| 56 | - 'type' => 'wysiwyg', |
|
| 57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 59 | - ) |
|
| 60 | - ); |
|
| 61 | - } |
|
| 46 | + /** |
|
| 47 | + * Registers the general settings. |
|
| 48 | + * |
|
| 49 | + * @param object $cmb new_cmb2_box(). |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function settings( $cmb ) { |
|
| 53 | + $cmb->add_field( |
|
| 54 | + array( |
|
| 55 | + 'id' => 'exercise_archive_description', |
|
| 56 | + 'type' => 'wysiwyg', |
|
| 57 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 59 | + ) |
|
| 60 | + ); |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | Exercise::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * Constructor |
| 26 | 26 | */ |
| 27 | 27 | public function __construct() { |
| 28 | - add_action( 'lsx_hp_settings_page_exercise_top', array( $this, 'settings' ), 1, 1 ); |
|
| 28 | + add_action('lsx_hp_settings_page_exercise_top', array($this, 'settings'), 1, 1); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function get_instance() { |
| 39 | 39 | // If the single instance hasn't been set, set it now. |
| 40 | - if ( null === self::$instance ) { |
|
| 40 | + if (null === self::$instance) { |
|
| 41 | 41 | self::$instance = new self(); |
| 42 | 42 | } |
| 43 | 43 | return self::$instance; |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | * @param object $cmb new_cmb2_box(). |
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | - public function settings( $cmb ) { |
|
| 52 | + public function settings($cmb) { |
|
| 53 | 53 | $cmb->add_field( |
| 54 | 54 | array( |
| 55 | 55 | 'id' => 'exercise_archive_description', |
| 56 | 56 | 'type' => 'wysiwyg', |
| 57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 57 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
| 58 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
| 59 | 59 | ) |
| 60 | 60 | ); |
| 61 | 61 | } |
@@ -12,115 +12,115 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Workout { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Holds class instance |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - * |
|
| 20 | - * @var object \lsx_health_plan\classes\admin\Workout() |
|
| 21 | - */ |
|
| 22 | - protected static $instance = null; |
|
| 15 | + /** |
|
| 16 | + * Holds class instance |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + * |
|
| 20 | + * @var object \lsx_health_plan\classes\admin\Workout() |
|
| 21 | + */ |
|
| 22 | + protected static $instance = null; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Constructor |
|
| 26 | - */ |
|
| 27 | - public function __construct() { |
|
| 28 | - add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | - } |
|
| 24 | + /** |
|
| 25 | + * Constructor |
|
| 26 | + */ |
|
| 27 | + public function __construct() { |
|
| 28 | + add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Return an instance of this class. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.0 |
|
| 35 | - * |
|
| 36 | - * @return object \lsx_health_plan\classes\admin\Workout() A single instance of this class. |
|
| 37 | - */ |
|
| 38 | - public static function get_instance() { |
|
| 39 | - // If the single instance hasn't been set, set it now. |
|
| 40 | - if ( null === self::$instance ) { |
|
| 41 | - self::$instance = new self(); |
|
| 42 | - } |
|
| 43 | - return self::$instance; |
|
| 44 | - } |
|
| 31 | + /** |
|
| 32 | + * Return an instance of this class. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.0 |
|
| 35 | + * |
|
| 36 | + * @return object \lsx_health_plan\classes\admin\Workout() A single instance of this class. |
|
| 37 | + */ |
|
| 38 | + public static function get_instance() { |
|
| 39 | + // If the single instance hasn't been set, set it now. |
|
| 40 | + if ( null === self::$instance ) { |
|
| 41 | + self::$instance = new self(); |
|
| 42 | + } |
|
| 43 | + return self::$instance; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Registers the general settings. |
|
| 48 | - * |
|
| 49 | - * @param object $cmb new_cmb2_box(). |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function settings( $cmb ) { |
|
| 53 | - $cmb->add_field( |
|
| 54 | - array( |
|
| 55 | - 'id' => 'workout_tab_layout', |
|
| 56 | - 'type' => 'select', |
|
| 57 | - 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
| 59 | - 'options' => array( |
|
| 60 | - 'table' => __( 'Table', 'lsx-health-plan' ), |
|
| 61 | - 'list' => __( 'List', 'lsx-health-plan' ), |
|
| 62 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
| 63 | - ), |
|
| 64 | - ) |
|
| 65 | - ); |
|
| 66 | - $cmb->add_field( |
|
| 67 | - array( |
|
| 68 | - 'id' => 'workout_tab_link', |
|
| 69 | - 'type' => 'select', |
|
| 70 | - 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
| 71 | - 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
| 72 | - 'options' => array( |
|
| 73 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 74 | - 'single' => __( 'Single', 'lsx-health-plan' ), |
|
| 75 | - 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
| 76 | - ), |
|
| 77 | - 'default' => 'modal', |
|
| 78 | - ) |
|
| 79 | - ); |
|
| 80 | - $cmb->add_field( |
|
| 81 | - array( |
|
| 82 | - 'id' => 'workout_tab_modal_content', |
|
| 83 | - 'type' => 'select', |
|
| 84 | - 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
| 85 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
| 86 | - 'options' => array( |
|
| 87 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 88 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 89 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 90 | - ), |
|
| 91 | - 'default' => '', |
|
| 92 | - ) |
|
| 93 | - ); |
|
| 94 | - $cmb->add_field( |
|
| 95 | - array( |
|
| 96 | - 'id' => 'workout_tab_columns', |
|
| 97 | - 'type' => 'select', |
|
| 98 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
| 99 | - 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
| 100 | - 'options' => array( |
|
| 101 | - '12' => __( '1', 'lsx-health-plan' ), |
|
| 102 | - '6' => __( '2', 'lsx-health-plan' ), |
|
| 103 | - '4' => __( '3', 'lsx-health-plan' ), |
|
| 104 | - '3' => __( '4', 'lsx-health-plan' ), |
|
| 105 | - '2' => __( '6', 'lsx-health-plan' ), |
|
| 106 | - ), |
|
| 107 | - 'default' => '4', |
|
| 108 | - ) |
|
| 109 | - ); |
|
| 110 | - $cmb->add_field( |
|
| 111 | - array( |
|
| 112 | - 'id' => 'workout_tab_content', |
|
| 113 | - 'type' => 'select', |
|
| 114 | - 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
| 115 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
| 116 | - 'options' => array( |
|
| 117 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 118 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 119 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 120 | - ), |
|
| 121 | - 'default' => '', |
|
| 122 | - ) |
|
| 123 | - ); |
|
| 124 | - } |
|
| 46 | + /** |
|
| 47 | + * Registers the general settings. |
|
| 48 | + * |
|
| 49 | + * @param object $cmb new_cmb2_box(). |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function settings( $cmb ) { |
|
| 53 | + $cmb->add_field( |
|
| 54 | + array( |
|
| 55 | + 'id' => 'workout_tab_layout', |
|
| 56 | + 'type' => 'select', |
|
| 57 | + 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
| 58 | + 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
| 59 | + 'options' => array( |
|
| 60 | + 'table' => __( 'Table', 'lsx-health-plan' ), |
|
| 61 | + 'list' => __( 'List', 'lsx-health-plan' ), |
|
| 62 | + 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
| 63 | + ), |
|
| 64 | + ) |
|
| 65 | + ); |
|
| 66 | + $cmb->add_field( |
|
| 67 | + array( |
|
| 68 | + 'id' => 'workout_tab_link', |
|
| 69 | + 'type' => 'select', |
|
| 70 | + 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
| 71 | + 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
| 72 | + 'options' => array( |
|
| 73 | + '' => __( 'None', 'lsx-health-plan' ), |
|
| 74 | + 'single' => __( 'Single', 'lsx-health-plan' ), |
|
| 75 | + 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
| 76 | + ), |
|
| 77 | + 'default' => 'modal', |
|
| 78 | + ) |
|
| 79 | + ); |
|
| 80 | + $cmb->add_field( |
|
| 81 | + array( |
|
| 82 | + 'id' => 'workout_tab_modal_content', |
|
| 83 | + 'type' => 'select', |
|
| 84 | + 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
| 85 | + 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
| 86 | + 'options' => array( |
|
| 87 | + '' => __( 'None', 'lsx-health-plan' ), |
|
| 88 | + 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 89 | + 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 90 | + ), |
|
| 91 | + 'default' => '', |
|
| 92 | + ) |
|
| 93 | + ); |
|
| 94 | + $cmb->add_field( |
|
| 95 | + array( |
|
| 96 | + 'id' => 'workout_tab_columns', |
|
| 97 | + 'type' => 'select', |
|
| 98 | + 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
| 99 | + 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
| 100 | + 'options' => array( |
|
| 101 | + '12' => __( '1', 'lsx-health-plan' ), |
|
| 102 | + '6' => __( '2', 'lsx-health-plan' ), |
|
| 103 | + '4' => __( '3', 'lsx-health-plan' ), |
|
| 104 | + '3' => __( '4', 'lsx-health-plan' ), |
|
| 105 | + '2' => __( '6', 'lsx-health-plan' ), |
|
| 106 | + ), |
|
| 107 | + 'default' => '4', |
|
| 108 | + ) |
|
| 109 | + ); |
|
| 110 | + $cmb->add_field( |
|
| 111 | + array( |
|
| 112 | + 'id' => 'workout_tab_content', |
|
| 113 | + 'type' => 'select', |
|
| 114 | + 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
| 115 | + 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
| 116 | + 'options' => array( |
|
| 117 | + '' => __( 'None', 'lsx-health-plan' ), |
|
| 118 | + 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 119 | + 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 120 | + ), |
|
| 121 | + 'default' => '', |
|
| 122 | + ) |
|
| 123 | + ); |
|
| 124 | + } |
|
| 125 | 125 | } |
| 126 | 126 | Workout::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * Constructor |
| 26 | 26 | */ |
| 27 | 27 | public function __construct() { |
| 28 | - add_action( 'lsx_hp_settings_page_workout_top', array( $this, 'settings' ), 1, 1 ); |
|
| 28 | + add_action('lsx_hp_settings_page_workout_top', array($this, 'settings'), 1, 1); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function get_instance() { |
| 39 | 39 | // If the single instance hasn't been set, set it now. |
| 40 | - if ( null === self::$instance ) { |
|
| 40 | + if (null === self::$instance) { |
|
| 41 | 41 | self::$instance = new self(); |
| 42 | 42 | } |
| 43 | 43 | return self::$instance; |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | * @param object $cmb new_cmb2_box(). |
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | - public function settings( $cmb ) { |
|
| 52 | + public function settings($cmb) { |
|
| 53 | 53 | $cmb->add_field( |
| 54 | 54 | array( |
| 55 | 55 | 'id' => 'workout_tab_layout', |
| 56 | 56 | 'type' => 'select', |
| 57 | - 'name' => __( 'Workout Tab Layout', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'Choose the layout for the workouts.', 'lsx-health-plan' ), |
|
| 57 | + 'name' => __('Workout Tab Layout', 'lsx-health-plan'), |
|
| 58 | + 'description' => __('Choose the layout for the workouts.', 'lsx-health-plan'), |
|
| 59 | 59 | 'options' => array( |
| 60 | - 'table' => __( 'Table', 'lsx-health-plan' ), |
|
| 61 | - 'list' => __( 'List', 'lsx-health-plan' ), |
|
| 62 | - 'grid' => __( 'Grid', 'lsx-health-plan' ), |
|
| 60 | + 'table' => __('Table', 'lsx-health-plan'), |
|
| 61 | + 'list' => __('List', 'lsx-health-plan'), |
|
| 62 | + 'grid' => __('Grid', 'lsx-health-plan'), |
|
| 63 | 63 | ), |
| 64 | 64 | ) |
| 65 | 65 | ); |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | array( |
| 68 | 68 | 'id' => 'workout_tab_link', |
| 69 | 69 | 'type' => 'select', |
| 70 | - 'name' => __( 'Workout Tab Link', 'lsx-health-plan' ), |
|
| 71 | - 'description' => __( 'Choose to show the excerpt, full content or nothing.', 'lsx-health-plan' ), |
|
| 70 | + 'name' => __('Workout Tab Link', 'lsx-health-plan'), |
|
| 71 | + 'description' => __('Choose to show the excerpt, full content or nothing.', 'lsx-health-plan'), |
|
| 72 | 72 | 'options' => array( |
| 73 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 74 | - 'single' => __( 'Single', 'lsx-health-plan' ), |
|
| 75 | - 'modal' => __( 'Modal', 'lsx-health-plan' ), |
|
| 73 | + '' => __('None', 'lsx-health-plan'), |
|
| 74 | + 'single' => __('Single', 'lsx-health-plan'), |
|
| 75 | + 'modal' => __('Modal', 'lsx-health-plan'), |
|
| 76 | 76 | ), |
| 77 | 77 | 'default' => 'modal', |
| 78 | 78 | ) |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | array( |
| 82 | 82 | 'id' => 'workout_tab_modal_content', |
| 83 | 83 | 'type' => 'select', |
| 84 | - 'name' => __( 'Modal Content', 'lsx-health-plan' ), |
|
| 85 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan' ), |
|
| 84 | + 'name' => __('Modal Content', 'lsx-health-plan'), |
|
| 85 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the modal content only', 'lsx-health-plan'), |
|
| 86 | 86 | 'options' => array( |
| 87 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 88 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 89 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 87 | + '' => __('None', 'lsx-health-plan'), |
|
| 88 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
| 89 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
| 90 | 90 | ), |
| 91 | 91 | 'default' => '', |
| 92 | 92 | ) |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | array( |
| 96 | 96 | 'id' => 'workout_tab_columns', |
| 97 | 97 | 'type' => 'select', |
| 98 | - 'name' => __( 'Grid Columns', 'lsx-health-plan' ), |
|
| 99 | - 'description' => __( 'If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan' ), |
|
| 98 | + 'name' => __('Grid Columns', 'lsx-health-plan'), |
|
| 99 | + 'description' => __('If you are displaying a grid, set the amount of columns you want to use.', 'lsx-health-plan'), |
|
| 100 | 100 | 'options' => array( |
| 101 | - '12' => __( '1', 'lsx-health-plan' ), |
|
| 102 | - '6' => __( '2', 'lsx-health-plan' ), |
|
| 103 | - '4' => __( '3', 'lsx-health-plan' ), |
|
| 104 | - '3' => __( '4', 'lsx-health-plan' ), |
|
| 105 | - '2' => __( '6', 'lsx-health-plan' ), |
|
| 101 | + '12' => __('1', 'lsx-health-plan'), |
|
| 102 | + '6' => __('2', 'lsx-health-plan'), |
|
| 103 | + '4' => __('3', 'lsx-health-plan'), |
|
| 104 | + '3' => __('4', 'lsx-health-plan'), |
|
| 105 | + '2' => __('6', 'lsx-health-plan'), |
|
| 106 | 106 | ), |
| 107 | 107 | 'default' => '4', |
| 108 | 108 | ) |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | array( |
| 112 | 112 | 'id' => 'workout_tab_content', |
| 113 | 113 | 'type' => 'select', |
| 114 | - 'name' => __( 'Grid Content', 'lsx-health-plan' ), |
|
| 115 | - 'description' => __( 'Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan' ), |
|
| 114 | + 'name' => __('Grid Content', 'lsx-health-plan'), |
|
| 115 | + 'description' => __('Choose to show the excerpt, full content or nothing. For the grid layout only', 'lsx-health-plan'), |
|
| 116 | 116 | 'options' => array( |
| 117 | - '' => __( 'None', 'lsx-health-plan' ), |
|
| 118 | - 'excerpt' => __( 'Excerpt', 'lsx-health-plan' ), |
|
| 119 | - 'full' => __( 'Full Content', 'lsx-health-plan' ), |
|
| 117 | + '' => __('None', 'lsx-health-plan'), |
|
| 118 | + 'excerpt' => __('Excerpt', 'lsx-health-plan'), |
|
| 119 | + 'full' => __('Full Content', 'lsx-health-plan'), |
|
| 120 | 120 | ), |
| 121 | 121 | 'default' => '', |
| 122 | 122 | ) |
@@ -12,52 +12,52 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Recipe { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Holds class instance |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - * |
|
| 20 | - * @var object \lsx_health_plan\classes\admin\Recipe() |
|
| 21 | - */ |
|
| 22 | - protected static $instance = null; |
|
| 15 | + /** |
|
| 16 | + * Holds class instance |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + * |
|
| 20 | + * @var object \lsx_health_plan\classes\admin\Recipe() |
|
| 21 | + */ |
|
| 22 | + protected static $instance = null; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Constructor |
|
| 26 | - */ |
|
| 27 | - public function __construct() { |
|
| 28 | - add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | - } |
|
| 24 | + /** |
|
| 25 | + * Constructor |
|
| 26 | + */ |
|
| 27 | + public function __construct() { |
|
| 28 | + add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Return an instance of this class. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.0 |
|
| 35 | - * |
|
| 36 | - * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
| 37 | - */ |
|
| 38 | - public static function get_instance() { |
|
| 39 | - // If the single instance hasn't been set, set it now. |
|
| 40 | - if ( null === self::$instance ) { |
|
| 41 | - self::$instance = new self(); |
|
| 42 | - } |
|
| 43 | - return self::$instance; |
|
| 44 | - } |
|
| 31 | + /** |
|
| 32 | + * Return an instance of this class. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.0 |
|
| 35 | + * |
|
| 36 | + * @return object \lsx_health_plan\classes\admin\Recipe() A single instance of this class. |
|
| 37 | + */ |
|
| 38 | + public static function get_instance() { |
|
| 39 | + // If the single instance hasn't been set, set it now. |
|
| 40 | + if ( null === self::$instance ) { |
|
| 41 | + self::$instance = new self(); |
|
| 42 | + } |
|
| 43 | + return self::$instance; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Registers the general settings. |
|
| 48 | - * |
|
| 49 | - * @param object $cmb new_cmb2_box(). |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function settings( $cmb ) { |
|
| 53 | - $cmb->add_field( |
|
| 54 | - array( |
|
| 55 | - 'id' => 'recipe_archive_description', |
|
| 56 | - 'type' => 'wysiwyg', |
|
| 57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 59 | - ) |
|
| 60 | - ); |
|
| 61 | - } |
|
| 46 | + /** |
|
| 47 | + * Registers the general settings. |
|
| 48 | + * |
|
| 49 | + * @param object $cmb new_cmb2_box(). |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function settings( $cmb ) { |
|
| 53 | + $cmb->add_field( |
|
| 54 | + array( |
|
| 55 | + 'id' => 'recipe_archive_description', |
|
| 56 | + 'type' => 'wysiwyg', |
|
| 57 | + 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | + 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 59 | + ) |
|
| 60 | + ); |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | Recipe::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * Constructor |
| 26 | 26 | */ |
| 27 | 27 | public function __construct() { |
| 28 | - add_action( 'lsx_hp_settings_page_recipe_top', array( $this, 'settings' ), 1, 1 ); |
|
| 28 | + add_action('lsx_hp_settings_page_recipe_top', array($this, 'settings'), 1, 1); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function get_instance() { |
| 39 | 39 | // If the single instance hasn't been set, set it now. |
| 40 | - if ( null === self::$instance ) { |
|
| 40 | + if (null === self::$instance) { |
|
| 41 | 41 | self::$instance = new self(); |
| 42 | 42 | } |
| 43 | 43 | return self::$instance; |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | * @param object $cmb new_cmb2_box(). |
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | - public function settings( $cmb ) { |
|
| 52 | + public function settings($cmb) { |
|
| 53 | 53 | $cmb->add_field( |
| 54 | 54 | array( |
| 55 | 55 | 'id' => 'recipe_archive_description', |
| 56 | 56 | 'type' => 'wysiwyg', |
| 57 | - 'name' => __( 'Archive Description', 'lsx-health-plan' ), |
|
| 58 | - 'description' => __( 'This will show up on the post type archive.', 'lsx-health-plan' ), |
|
| 57 | + 'name' => __('Archive Description', 'lsx-health-plan'), |
|
| 58 | + 'description' => __('This will show up on the post type archive.', 'lsx-health-plan'), |
|
| 59 | 59 | ) |
| 60 | 60 | ); |
| 61 | 61 | } |
@@ -12,54 +12,54 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Plan { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Holds class instance |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - * |
|
| 20 | - * @var object \lsx_health_plan\classes\admin\Plan() |
|
| 21 | - */ |
|
| 22 | - protected static $instance = null; |
|
| 15 | + /** |
|
| 16 | + * Holds class instance |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + * |
|
| 20 | + * @var object \lsx_health_plan\classes\admin\Plan() |
|
| 21 | + */ |
|
| 22 | + protected static $instance = null; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Constructor |
|
| 26 | - */ |
|
| 27 | - public function __construct() { |
|
| 28 | - add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | - } |
|
| 24 | + /** |
|
| 25 | + * Constructor |
|
| 26 | + */ |
|
| 27 | + public function __construct() { |
|
| 28 | + add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Return an instance of this class. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.0 |
|
| 35 | - * |
|
| 36 | - * @return object \lsx_health_plan\classes\admin\Plan() A single instance of this class. |
|
| 37 | - */ |
|
| 38 | - public static function get_instance() { |
|
| 39 | - // If the single instance hasn't been set, set it now. |
|
| 40 | - if ( null === self::$instance ) { |
|
| 41 | - self::$instance = new self(); |
|
| 42 | - } |
|
| 43 | - return self::$instance; |
|
| 44 | - } |
|
| 31 | + /** |
|
| 32 | + * Return an instance of this class. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.0 |
|
| 35 | + * |
|
| 36 | + * @return object \lsx_health_plan\classes\admin\Plan() A single instance of this class. |
|
| 37 | + */ |
|
| 38 | + public static function get_instance() { |
|
| 39 | + // If the single instance hasn't been set, set it now. |
|
| 40 | + if ( null === self::$instance ) { |
|
| 41 | + self::$instance = new self(); |
|
| 42 | + } |
|
| 43 | + return self::$instance; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Registers the general settings. |
|
| 48 | - * |
|
| 49 | - * @param object $cmb new_cmb2_box(). |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function settings( $cmb ) { |
|
| 53 | - $cmb->add_field( |
|
| 54 | - array( |
|
| 55 | - 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
| 56 | - 'id' => 'plan_filters_disabled', |
|
| 57 | - 'type' => 'checkbox', |
|
| 58 | - 'value' => 1, |
|
| 59 | - 'default' => 0, |
|
| 60 | - 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
| 61 | - ) |
|
| 62 | - ); |
|
| 63 | - } |
|
| 46 | + /** |
|
| 47 | + * Registers the general settings. |
|
| 48 | + * |
|
| 49 | + * @param object $cmb new_cmb2_box(). |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function settings( $cmb ) { |
|
| 53 | + $cmb->add_field( |
|
| 54 | + array( |
|
| 55 | + 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
| 56 | + 'id' => 'plan_filters_disabled', |
|
| 57 | + 'type' => 'checkbox', |
|
| 58 | + 'value' => 1, |
|
| 59 | + 'default' => 0, |
|
| 60 | + 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
| 61 | + ) |
|
| 62 | + ); |
|
| 63 | + } |
|
| 64 | 64 | } |
| 65 | 65 | Plan::get_instance(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * Constructor |
| 26 | 26 | */ |
| 27 | 27 | public function __construct() { |
| 28 | - add_action( 'lsx_hp_settings_page_plan_top', array( $this, 'settings' ), 1, 1 ); |
|
| 28 | + add_action('lsx_hp_settings_page_plan_top', array($this, 'settings'), 1, 1); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function get_instance() { |
| 39 | 39 | // If the single instance hasn't been set, set it now. |
| 40 | - if ( null === self::$instance ) { |
|
| 40 | + if (null === self::$instance) { |
|
| 41 | 41 | self::$instance = new self(); |
| 42 | 42 | } |
| 43 | 43 | return self::$instance; |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | * @param object $cmb new_cmb2_box(). |
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | - public function settings( $cmb ) { |
|
| 52 | + public function settings($cmb) { |
|
| 53 | 53 | $cmb->add_field( |
| 54 | 54 | array( |
| 55 | - 'name' => __( 'Plan Filters', 'lsx-health-plan' ), |
|
| 55 | + 'name' => __('Plan Filters', 'lsx-health-plan'), |
|
| 56 | 56 | 'id' => 'plan_filters_disabled', |
| 57 | 57 | 'type' => 'checkbox', |
| 58 | 58 | 'value' => 1, |
| 59 | 59 | 'default' => 0, |
| 60 | - 'description' => __( 'Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan' ), |
|
| 60 | + 'description' => __('Toggle the display of the tab filters on the post type archive.', 'lsx-health-plan'), |
|
| 61 | 61 | ) |
| 62 | 62 | ); |
| 63 | 63 | } |
@@ -8,86 +8,86 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | class Setup { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * Holds class instance |
|
| 13 | - * |
|
| 14 | - * @since 1.0.0 |
|
| 15 | - * |
|
| 16 | - * @var object \lsx_health_plan\classes\Setup() |
|
| 17 | - */ |
|
| 18 | - protected static $instance = null; |
|
| 11 | + /** |
|
| 12 | + * Holds class instance |
|
| 13 | + * |
|
| 14 | + * @since 1.0.0 |
|
| 15 | + * |
|
| 16 | + * @var object \lsx_health_plan\classes\Setup() |
|
| 17 | + */ |
|
| 18 | + protected static $instance = null; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @var object \lsx_health_plan\classes\Post_Type(); |
|
| 22 | - */ |
|
| 23 | - public $post_types; |
|
| 20 | + /** |
|
| 21 | + * @var object \lsx_health_plan\classes\Post_Type(); |
|
| 22 | + */ |
|
| 23 | + public $post_types; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Constructor |
|
| 27 | - */ |
|
| 28 | - public function __construct() { |
|
| 29 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 30 | - add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
| 31 | - $this->load_classes(); |
|
| 32 | - } |
|
| 25 | + /** |
|
| 26 | + * Constructor |
|
| 27 | + */ |
|
| 28 | + public function __construct() { |
|
| 29 | + add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 30 | + add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
| 31 | + $this->load_classes(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Return an instance of this class. |
|
| 36 | - * |
|
| 37 | - * @since 1.0.0 |
|
| 38 | - * |
|
| 39 | - * @return object \lsx_health_plan\classes\Setup() A single instance of this class. |
|
| 40 | - */ |
|
| 41 | - public static function get_instance() { |
|
| 34 | + /** |
|
| 35 | + * Return an instance of this class. |
|
| 36 | + * |
|
| 37 | + * @since 1.0.0 |
|
| 38 | + * |
|
| 39 | + * @return object \lsx_health_plan\classes\Setup() A single instance of this class. |
|
| 40 | + */ |
|
| 41 | + public static function get_instance() { |
|
| 42 | 42 | |
| 43 | - // If the single instance hasn't been set, set it now. |
|
| 44 | - if ( null === self::$instance ) { |
|
| 45 | - self::$instance = new self(); |
|
| 46 | - } |
|
| 43 | + // If the single instance hasn't been set, set it now. |
|
| 44 | + if ( null === self::$instance ) { |
|
| 45 | + self::$instance = new self(); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - return self::$instance; |
|
| 48 | + return self::$instance; |
|
| 49 | 49 | |
| 50 | - } |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Adds text domain. |
|
| 54 | - */ |
|
| 55 | - public function load_plugin_textdomain() { |
|
| 56 | - load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
| 57 | - } |
|
| 52 | + /** |
|
| 53 | + * Adds text domain. |
|
| 54 | + */ |
|
| 55 | + public function load_plugin_textdomain() { |
|
| 56 | + load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Registers our shortcodes. |
|
| 61 | - * |
|
| 62 | - * @return void |
|
| 63 | - */ |
|
| 64 | - public function load_classes() { |
|
| 65 | - require_once LSX_HEALTH_PLAN_PATH . 'classes/class-post-type.php'; |
|
| 66 | - $this->post_types = Post_Type::get_instance(); |
|
| 67 | - } |
|
| 59 | + /** |
|
| 60 | + * Registers our shortcodes. |
|
| 61 | + * |
|
| 62 | + * @return void |
|
| 63 | + */ |
|
| 64 | + public function load_classes() { |
|
| 65 | + require_once LSX_HEALTH_PLAN_PATH . 'classes/class-post-type.php'; |
|
| 66 | + $this->post_types = Post_Type::get_instance(); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Registers our shortcodes. |
|
| 71 | - * |
|
| 72 | - * @return void |
|
| 73 | - */ |
|
| 74 | - public function load_shortcodes() { |
|
| 75 | - add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
| 76 | - add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
| 77 | - add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
| 78 | - add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
| 79 | - add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
| 80 | - add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
| 69 | + /** |
|
| 70 | + * Registers our shortcodes. |
|
| 71 | + * |
|
| 72 | + * @return void |
|
| 73 | + */ |
|
| 74 | + public function load_shortcodes() { |
|
| 75 | + add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
| 76 | + add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
| 77 | + add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
| 78 | + add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
| 79 | + add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
| 80 | + add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
| 81 | 81 | |
| 82 | - if ( post_type_exists( 'video' ) ) { |
|
| 83 | - add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
| 84 | - } |
|
| 85 | - if ( post_type_exists( 'recipe' ) ) { |
|
| 86 | - add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
| 87 | - } |
|
| 88 | - if ( post_type_exists( 'tip' ) ) { |
|
| 89 | - add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
| 90 | - } |
|
| 91 | - add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
| 92 | - } |
|
| 82 | + if ( post_type_exists( 'video' ) ) { |
|
| 83 | + add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
| 84 | + } |
|
| 85 | + if ( post_type_exists( 'recipe' ) ) { |
|
| 86 | + add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
| 87 | + } |
|
| 88 | + if ( post_type_exists( 'tip' ) ) { |
|
| 89 | + add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
| 90 | + } |
|
| 91 | + add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
| 92 | + } |
|
| 93 | 93 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | * Constructor |
| 27 | 27 | */ |
| 28 | 28 | public function __construct() { |
| 29 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 30 | - add_action( 'wp_head', array( $this, 'load_shortcodes' ) ); |
|
| 29 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
| 30 | + add_action('wp_head', array($this, 'load_shortcodes')); |
|
| 31 | 31 | $this->load_classes(); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public static function get_instance() { |
| 42 | 42 | |
| 43 | 43 | // If the single instance hasn't been set, set it now. |
| 44 | - if ( null === self::$instance ) { |
|
| 44 | + if (null === self::$instance) { |
|
| 45 | 45 | self::$instance = new self(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * Adds text domain. |
| 54 | 54 | */ |
| 55 | 55 | public function load_plugin_textdomain() { |
| 56 | - load_plugin_textdomain( 'lsx-health-plan', false, basename( LSX_HEALTH_PLAN_PATH ) . '/languages' ); |
|
| 56 | + load_plugin_textdomain('lsx-health-plan', false, basename(LSX_HEALTH_PLAN_PATH) . '/languages'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -72,22 +72,22 @@ discard block |
||
| 72 | 72 | * @return void |
| 73 | 73 | */ |
| 74 | 74 | public function load_shortcodes() { |
| 75 | - add_shortcode( 'lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content' ); |
|
| 76 | - add_shortcode( 'lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs' ); |
|
| 77 | - add_shortcode( 'lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box' ); |
|
| 78 | - add_shortcode( 'lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box' ); |
|
| 79 | - add_shortcode( 'lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box' ); |
|
| 80 | - add_shortcode( 'lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices' ); |
|
| 75 | + add_shortcode('lsx_health_plan_restricted_content', '\lsx_health_plan\shortcodes\restricted_content'); |
|
| 76 | + add_shortcode('lsx_health_plan_my_profile_tabs', '\lsx_health_plan\shortcodes\my_profile_tabs'); |
|
| 77 | + add_shortcode('lsx_health_plan_my_profile_block', '\lsx_health_plan\shortcodes\my_profile_box'); |
|
| 78 | + add_shortcode('lsx_health_plan_all_plans_block', '\lsx_health_plan\shortcodes\all_plans_box'); |
|
| 79 | + add_shortcode('lsx_health_plan_day_plan_block', '\lsx_health_plan\shortcodes\day_plan_box'); |
|
| 80 | + add_shortcode('lsx_health_plan_account_notices', '\lsx_health_plan\shortcodes\account_notices'); |
|
| 81 | 81 | |
| 82 | - if ( post_type_exists( 'video' ) ) { |
|
| 83 | - add_shortcode( 'lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box' ); |
|
| 82 | + if (post_type_exists('video')) { |
|
| 83 | + add_shortcode('lsx_health_plan_featured_video_block', '\lsx_health_plan\shortcodes\feature_video_box'); |
|
| 84 | 84 | } |
| 85 | - if ( post_type_exists( 'recipe' ) ) { |
|
| 86 | - add_shortcode( 'lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box' ); |
|
| 85 | + if (post_type_exists('recipe')) { |
|
| 86 | + add_shortcode('lsx_health_plan_featured_recipes_block', '\lsx_health_plan\shortcodes\feature_recipes_box'); |
|
| 87 | 87 | } |
| 88 | - if ( post_type_exists( 'tip' ) ) { |
|
| 89 | - add_shortcode( 'lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box' ); |
|
| 88 | + if (post_type_exists('tip')) { |
|
| 89 | + add_shortcode('lsx_health_plan_featured_tips_block', '\lsx_health_plan\shortcodes\feature_tips_box'); |
|
| 90 | 90 | } |
| 91 | - add_shortcode( 'lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box' ); |
|
| 91 | + add_shortcode('lsx_health_plan_items', '\lsx_health_plan\shortcodes\exercise_box'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -8,169 +8,169 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | class General { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * Holds class instance |
|
| 13 | - * |
|
| 14 | - * @since 1.0.0 |
|
| 15 | - * |
|
| 16 | - * @var object \lsx_health_plan\classes\frontend\General() |
|
| 17 | - */ |
|
| 18 | - protected static $instance = null; |
|
| 19 | - |
|
| 20 | - /** |
|
| 21 | - * Constructor |
|
| 22 | - */ |
|
| 23 | - public function __construct() { |
|
| 24 | - // Before Output. |
|
| 25 | - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
| 26 | - add_filter( 'wp_kses_allowed_html', array( $this, 'allow_html_tags_attributes' ), 100, 2 ); |
|
| 27 | - |
|
| 28 | - // Output. |
|
| 29 | - add_action( 'body_class', array( $this, 'body_classes' ) ); |
|
| 30 | - add_filter( 'lsx_global_header_title', array( $this, 'single_title' ), 200, 1 ); |
|
| 31 | - add_action( 'wp_head', array( $this, 'remove_single_footer' ), 99 ); |
|
| 32 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 9 ); |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Return an instance of this class. |
|
| 37 | - * |
|
| 38 | - * @since 1.0.0 |
|
| 39 | - * |
|
| 40 | - * @return object \lsx_health_plan\classes\frontend\General() A single instance of this class. |
|
| 41 | - */ |
|
| 42 | - public static function get_instance() { |
|
| 43 | - // If the single instance hasn't been set, set it now. |
|
| 44 | - if ( null === self::$instance ) { |
|
| 45 | - self::$instance = new self(); |
|
| 46 | - } |
|
| 47 | - return self::$instance; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * Registers the plugin frontend assets |
|
| 52 | - * |
|
| 53 | - * @return void |
|
| 54 | - */ |
|
| 55 | - public function assets() { |
|
| 56 | - |
|
| 57 | - if ( is_post_type_archive( 'plan' ) && false === \lsx_health_plan\functions\plan\is_filters_disabled() ) { |
|
| 58 | - wp_enqueue_script( 'isotope', LSX_HEALTH_PLAN_URL . 'assets/js/vendor/isotope.pkgd.min.js', array( 'jquery' ), null, LSX_HEALTH_PLAN_URL, true ); |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - wp_enqueue_style( 'lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER ); |
|
| 62 | - wp_style_add_data( 'lsx-health-plan', 'rtl', 'replace' ); |
|
| 63 | - wp_enqueue_script( 'lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array( 'jquery' ) ); |
|
| 64 | - |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Adds the iframe and the progress HTML tags to the allowed WordPress list. |
|
| 69 | - */ |
|
| 70 | - public function allow_html_tags_attributes( $tags, $context ) { |
|
| 71 | - if ( 'post' === $context ) { |
|
| 72 | - $tags['iframe'] = array( |
|
| 73 | - 'src' => true, |
|
| 74 | - 'height' => true, |
|
| 75 | - 'width' => true, |
|
| 76 | - 'frameborder' => true, |
|
| 77 | - 'allowfullscreen' => true, |
|
| 78 | - ); |
|
| 79 | - } |
|
| 80 | - $tags['progress'] = array( |
|
| 81 | - 'id' => true, |
|
| 82 | - 'value' => true, |
|
| 83 | - 'max' => true, |
|
| 84 | - ); |
|
| 85 | - return $tags; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * Add body classes to body. |
|
| 90 | - * |
|
| 91 | - * @param array $classes |
|
| 92 | - * @return void |
|
| 93 | - */ |
|
| 94 | - public function body_classes( $classes = array() ) { |
|
| 95 | - global $post; |
|
| 96 | - |
|
| 97 | - if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'lsx_health_plan_my_profile_block' ) ) { |
|
| 98 | - $classes[] = 'my-plan-shortcode'; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - if ( is_single() && is_singular( 'plan' ) ) { |
|
| 102 | - $args = array( |
|
| 103 | - 'post_parent' => get_the_ID(), |
|
| 104 | - 'post_type' => 'plan', |
|
| 105 | - ); |
|
| 106 | - |
|
| 107 | - $post_id = get_the_ID(); |
|
| 108 | - $has_children = get_children( $args ); |
|
| 109 | - $has_parent = wp_get_post_parent_id( $post_id ); |
|
| 110 | - |
|
| 111 | - if ( ! empty( $has_children ) ) { |
|
| 112 | - $plan_type_class = 'parent-plan-page'; |
|
| 113 | - if ( 0 !== $has_parent ) { |
|
| 114 | - $plan_type_class = 'parent-sub-plan-page'; |
|
| 115 | - } |
|
| 116 | - } else { |
|
| 117 | - $plan_type_class = 'unique-plan-page'; |
|
| 118 | - if ( 0 !== $has_parent ) { |
|
| 119 | - $plan_type_class = 'child-plan-page'; |
|
| 120 | - } |
|
| 121 | - } |
|
| 122 | - $classes[] = $plan_type_class; |
|
| 123 | - } |
|
| 124 | - return $classes; |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * Remove the single recipe and exercise title |
|
| 129 | - */ |
|
| 130 | - public function single_title( $title ) { |
|
| 131 | - |
|
| 132 | - if ( is_single() && is_singular( 'recipe' ) ) { |
|
| 133 | - |
|
| 134 | - $title = __( 'Recipe', 'lsx-health-plan' ); |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - if ( is_single() && is_singular( 'exercise' ) ) { |
|
| 138 | - |
|
| 139 | - $title = __( 'Exercise', 'lsx-health-plan' ); |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - return $title; |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - /** |
|
| 146 | - * Removing footer for HP single pages. |
|
| 147 | - * |
|
| 148 | - * @return void |
|
| 149 | - */ |
|
| 150 | - public function remove_single_footer() { |
|
| 151 | - if ( is_single() && is_singular( array( 'exercise', 'recipe', 'workout', 'meal' ) ) ) { |
|
| 152 | - remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 153 | - } |
|
| 154 | - } |
|
| 155 | - /** |
|
| 156 | - * Remove the "Archives:" from the post type recipes. |
|
| 157 | - * |
|
| 158 | - * @param string $title the term title. |
|
| 159 | - * @return string |
|
| 160 | - */ |
|
| 161 | - public function get_the_archive_title( $title ) { |
|
| 162 | - if ( is_post_type_archive( 'recipe' ) ) { |
|
| 163 | - $title = __( 'Recipes', 'lsx-health-plan' ); |
|
| 164 | - } |
|
| 165 | - if ( is_post_type_archive( 'exercise' ) ) { |
|
| 166 | - $title = __( 'Exercises', 'lsx-health-plan' ); |
|
| 167 | - } |
|
| 168 | - if ( is_tax() ) { |
|
| 169 | - $queried_object = get_queried_object(); |
|
| 170 | - if ( isset( $queried_object->name ) ) { |
|
| 171 | - $title = $queried_object->name; |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - return $title; |
|
| 175 | - } |
|
| 11 | + /** |
|
| 12 | + * Holds class instance |
|
| 13 | + * |
|
| 14 | + * @since 1.0.0 |
|
| 15 | + * |
|
| 16 | + * @var object \lsx_health_plan\classes\frontend\General() |
|
| 17 | + */ |
|
| 18 | + protected static $instance = null; |
|
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * Constructor |
|
| 22 | + */ |
|
| 23 | + public function __construct() { |
|
| 24 | + // Before Output. |
|
| 25 | + add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
| 26 | + add_filter( 'wp_kses_allowed_html', array( $this, 'allow_html_tags_attributes' ), 100, 2 ); |
|
| 27 | + |
|
| 28 | + // Output. |
|
| 29 | + add_action( 'body_class', array( $this, 'body_classes' ) ); |
|
| 30 | + add_filter( 'lsx_global_header_title', array( $this, 'single_title' ), 200, 1 ); |
|
| 31 | + add_action( 'wp_head', array( $this, 'remove_single_footer' ), 99 ); |
|
| 32 | + add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 9 ); |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Return an instance of this class. |
|
| 37 | + * |
|
| 38 | + * @since 1.0.0 |
|
| 39 | + * |
|
| 40 | + * @return object \lsx_health_plan\classes\frontend\General() A single instance of this class. |
|
| 41 | + */ |
|
| 42 | + public static function get_instance() { |
|
| 43 | + // If the single instance hasn't been set, set it now. |
|
| 44 | + if ( null === self::$instance ) { |
|
| 45 | + self::$instance = new self(); |
|
| 46 | + } |
|
| 47 | + return self::$instance; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * Registers the plugin frontend assets |
|
| 52 | + * |
|
| 53 | + * @return void |
|
| 54 | + */ |
|
| 55 | + public function assets() { |
|
| 56 | + |
|
| 57 | + if ( is_post_type_archive( 'plan' ) && false === \lsx_health_plan\functions\plan\is_filters_disabled() ) { |
|
| 58 | + wp_enqueue_script( 'isotope', LSX_HEALTH_PLAN_URL . 'assets/js/vendor/isotope.pkgd.min.js', array( 'jquery' ), null, LSX_HEALTH_PLAN_URL, true ); |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + wp_enqueue_style( 'lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER ); |
|
| 62 | + wp_style_add_data( 'lsx-health-plan', 'rtl', 'replace' ); |
|
| 63 | + wp_enqueue_script( 'lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array( 'jquery' ) ); |
|
| 64 | + |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Adds the iframe and the progress HTML tags to the allowed WordPress list. |
|
| 69 | + */ |
|
| 70 | + public function allow_html_tags_attributes( $tags, $context ) { |
|
| 71 | + if ( 'post' === $context ) { |
|
| 72 | + $tags['iframe'] = array( |
|
| 73 | + 'src' => true, |
|
| 74 | + 'height' => true, |
|
| 75 | + 'width' => true, |
|
| 76 | + 'frameborder' => true, |
|
| 77 | + 'allowfullscreen' => true, |
|
| 78 | + ); |
|
| 79 | + } |
|
| 80 | + $tags['progress'] = array( |
|
| 81 | + 'id' => true, |
|
| 82 | + 'value' => true, |
|
| 83 | + 'max' => true, |
|
| 84 | + ); |
|
| 85 | + return $tags; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * Add body classes to body. |
|
| 90 | + * |
|
| 91 | + * @param array $classes |
|
| 92 | + * @return void |
|
| 93 | + */ |
|
| 94 | + public function body_classes( $classes = array() ) { |
|
| 95 | + global $post; |
|
| 96 | + |
|
| 97 | + if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'lsx_health_plan_my_profile_block' ) ) { |
|
| 98 | + $classes[] = 'my-plan-shortcode'; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + if ( is_single() && is_singular( 'plan' ) ) { |
|
| 102 | + $args = array( |
|
| 103 | + 'post_parent' => get_the_ID(), |
|
| 104 | + 'post_type' => 'plan', |
|
| 105 | + ); |
|
| 106 | + |
|
| 107 | + $post_id = get_the_ID(); |
|
| 108 | + $has_children = get_children( $args ); |
|
| 109 | + $has_parent = wp_get_post_parent_id( $post_id ); |
|
| 110 | + |
|
| 111 | + if ( ! empty( $has_children ) ) { |
|
| 112 | + $plan_type_class = 'parent-plan-page'; |
|
| 113 | + if ( 0 !== $has_parent ) { |
|
| 114 | + $plan_type_class = 'parent-sub-plan-page'; |
|
| 115 | + } |
|
| 116 | + } else { |
|
| 117 | + $plan_type_class = 'unique-plan-page'; |
|
| 118 | + if ( 0 !== $has_parent ) { |
|
| 119 | + $plan_type_class = 'child-plan-page'; |
|
| 120 | + } |
|
| 121 | + } |
|
| 122 | + $classes[] = $plan_type_class; |
|
| 123 | + } |
|
| 124 | + return $classes; |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * Remove the single recipe and exercise title |
|
| 129 | + */ |
|
| 130 | + public function single_title( $title ) { |
|
| 131 | + |
|
| 132 | + if ( is_single() && is_singular( 'recipe' ) ) { |
|
| 133 | + |
|
| 134 | + $title = __( 'Recipe', 'lsx-health-plan' ); |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + if ( is_single() && is_singular( 'exercise' ) ) { |
|
| 138 | + |
|
| 139 | + $title = __( 'Exercise', 'lsx-health-plan' ); |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + return $title; |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * Removing footer for HP single pages. |
|
| 147 | + * |
|
| 148 | + * @return void |
|
| 149 | + */ |
|
| 150 | + public function remove_single_footer() { |
|
| 151 | + if ( is_single() && is_singular( array( 'exercise', 'recipe', 'workout', 'meal' ) ) ) { |
|
| 152 | + remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 153 | + } |
|
| 154 | + } |
|
| 155 | + /** |
|
| 156 | + * Remove the "Archives:" from the post type recipes. |
|
| 157 | + * |
|
| 158 | + * @param string $title the term title. |
|
| 159 | + * @return string |
|
| 160 | + */ |
|
| 161 | + public function get_the_archive_title( $title ) { |
|
| 162 | + if ( is_post_type_archive( 'recipe' ) ) { |
|
| 163 | + $title = __( 'Recipes', 'lsx-health-plan' ); |
|
| 164 | + } |
|
| 165 | + if ( is_post_type_archive( 'exercise' ) ) { |
|
| 166 | + $title = __( 'Exercises', 'lsx-health-plan' ); |
|
| 167 | + } |
|
| 168 | + if ( is_tax() ) { |
|
| 169 | + $queried_object = get_queried_object(); |
|
| 170 | + if ( isset( $queried_object->name ) ) { |
|
| 171 | + $title = $queried_object->name; |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + return $title; |
|
| 175 | + } |
|
| 176 | 176 | } |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct() { |
| 24 | 24 | // Before Output. |
| 25 | - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
| 26 | - add_filter( 'wp_kses_allowed_html', array( $this, 'allow_html_tags_attributes' ), 100, 2 ); |
|
| 25 | + add_action('wp_enqueue_scripts', array($this, 'assets'), 5); |
|
| 26 | + add_filter('wp_kses_allowed_html', array($this, 'allow_html_tags_attributes'), 100, 2); |
|
| 27 | 27 | |
| 28 | 28 | // Output. |
| 29 | - add_action( 'body_class', array( $this, 'body_classes' ) ); |
|
| 30 | - add_filter( 'lsx_global_header_title', array( $this, 'single_title' ), 200, 1 ); |
|
| 31 | - add_action( 'wp_head', array( $this, 'remove_single_footer' ), 99 ); |
|
| 32 | - add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 9 ); |
|
| 29 | + add_action('body_class', array($this, 'body_classes')); |
|
| 30 | + add_filter('lsx_global_header_title', array($this, 'single_title'), 200, 1); |
|
| 31 | + add_action('wp_head', array($this, 'remove_single_footer'), 99); |
|
| 32 | + add_filter('get_the_archive_title', array($this, 'get_the_archive_title'), 9); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public static function get_instance() { |
| 43 | 43 | // If the single instance hasn't been set, set it now. |
| 44 | - if ( null === self::$instance ) { |
|
| 44 | + if (null === self::$instance) { |
|
| 45 | 45 | self::$instance = new self(); |
| 46 | 46 | } |
| 47 | 47 | return self::$instance; |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function assets() { |
| 56 | 56 | |
| 57 | - if ( is_post_type_archive( 'plan' ) && false === \lsx_health_plan\functions\plan\is_filters_disabled() ) { |
|
| 58 | - wp_enqueue_script( 'isotope', LSX_HEALTH_PLAN_URL . 'assets/js/vendor/isotope.pkgd.min.js', array( 'jquery' ), null, LSX_HEALTH_PLAN_URL, true ); |
|
| 57 | + if (is_post_type_archive('plan') && false === \lsx_health_plan\functions\plan\is_filters_disabled()) { |
|
| 58 | + wp_enqueue_script('isotope', LSX_HEALTH_PLAN_URL . 'assets/js/vendor/isotope.pkgd.min.js', array('jquery'), null, LSX_HEALTH_PLAN_URL, true); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - wp_enqueue_style( 'lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER ); |
|
| 62 | - wp_style_add_data( 'lsx-health-plan', 'rtl', 'replace' ); |
|
| 63 | - wp_enqueue_script( 'lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array( 'jquery' ) ); |
|
| 61 | + wp_enqueue_style('lsx-health-plan', LSX_HEALTH_PLAN_URL . 'assets/css/lsx-health-plan.css', array(), LSX_HEALTH_PLAN_VER); |
|
| 62 | + wp_style_add_data('lsx-health-plan', 'rtl', 'replace'); |
|
| 63 | + wp_enqueue_script('lsx-health-plan-scripts', LSX_HEALTH_PLAN_URL . 'assets/js/src/lsx-health-plan-admin.js', array('jquery')); |
|
| 64 | 64 | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Adds the iframe and the progress HTML tags to the allowed WordPress list. |
| 69 | 69 | */ |
| 70 | - public function allow_html_tags_attributes( $tags, $context ) { |
|
| 71 | - if ( 'post' === $context ) { |
|
| 70 | + public function allow_html_tags_attributes($tags, $context) { |
|
| 71 | + if ('post' === $context) { |
|
| 72 | 72 | $tags['iframe'] = array( |
| 73 | 73 | 'src' => true, |
| 74 | 74 | 'height' => true, |
@@ -91,31 +91,31 @@ discard block |
||
| 91 | 91 | * @param array $classes |
| 92 | 92 | * @return void |
| 93 | 93 | */ |
| 94 | - public function body_classes( $classes = array() ) { |
|
| 94 | + public function body_classes($classes = array()) { |
|
| 95 | 95 | global $post; |
| 96 | 96 | |
| 97 | - if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'lsx_health_plan_my_profile_block' ) ) { |
|
| 97 | + if (isset($post->post_content) && has_shortcode($post->post_content, 'lsx_health_plan_my_profile_block')) { |
|
| 98 | 98 | $classes[] = 'my-plan-shortcode'; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if ( is_single() && is_singular( 'plan' ) ) { |
|
| 101 | + if (is_single() && is_singular('plan')) { |
|
| 102 | 102 | $args = array( |
| 103 | 103 | 'post_parent' => get_the_ID(), |
| 104 | 104 | 'post_type' => 'plan', |
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | 107 | $post_id = get_the_ID(); |
| 108 | - $has_children = get_children( $args ); |
|
| 109 | - $has_parent = wp_get_post_parent_id( $post_id ); |
|
| 108 | + $has_children = get_children($args); |
|
| 109 | + $has_parent = wp_get_post_parent_id($post_id); |
|
| 110 | 110 | |
| 111 | - if ( ! empty( $has_children ) ) { |
|
| 111 | + if ( ! empty($has_children)) { |
|
| 112 | 112 | $plan_type_class = 'parent-plan-page'; |
| 113 | - if ( 0 !== $has_parent ) { |
|
| 113 | + if (0 !== $has_parent) { |
|
| 114 | 114 | $plan_type_class = 'parent-sub-plan-page'; |
| 115 | 115 | } |
| 116 | 116 | } else { |
| 117 | 117 | $plan_type_class = 'unique-plan-page'; |
| 118 | - if ( 0 !== $has_parent ) { |
|
| 118 | + if (0 !== $has_parent) { |
|
| 119 | 119 | $plan_type_class = 'child-plan-page'; |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -127,16 +127,16 @@ discard block |
||
| 127 | 127 | /** |
| 128 | 128 | * Remove the single recipe and exercise title |
| 129 | 129 | */ |
| 130 | - public function single_title( $title ) { |
|
| 130 | + public function single_title($title) { |
|
| 131 | 131 | |
| 132 | - if ( is_single() && is_singular( 'recipe' ) ) { |
|
| 132 | + if (is_single() && is_singular('recipe')) { |
|
| 133 | 133 | |
| 134 | - $title = __( 'Recipe', 'lsx-health-plan' ); |
|
| 134 | + $title = __('Recipe', 'lsx-health-plan'); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - if ( is_single() && is_singular( 'exercise' ) ) { |
|
| 137 | + if (is_single() && is_singular('exercise')) { |
|
| 138 | 138 | |
| 139 | - $title = __( 'Exercise', 'lsx-health-plan' ); |
|
| 139 | + $title = __('Exercise', 'lsx-health-plan'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | return $title; |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | * @return void |
| 149 | 149 | */ |
| 150 | 150 | public function remove_single_footer() { |
| 151 | - if ( is_single() && is_singular( array( 'exercise', 'recipe', 'workout', 'meal' ) ) ) { |
|
| 152 | - remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 151 | + if (is_single() && is_singular(array('exercise', 'recipe', 'workout', 'meal'))) { |
|
| 152 | + remove_action('lsx_footer_before', 'lsx_add_footer_sidebar_area'); |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | /** |
@@ -158,16 +158,16 @@ discard block |
||
| 158 | 158 | * @param string $title the term title. |
| 159 | 159 | * @return string |
| 160 | 160 | */ |
| 161 | - public function get_the_archive_title( $title ) { |
|
| 162 | - if ( is_post_type_archive( 'recipe' ) ) { |
|
| 163 | - $title = __( 'Recipes', 'lsx-health-plan' ); |
|
| 161 | + public function get_the_archive_title($title) { |
|
| 162 | + if (is_post_type_archive('recipe')) { |
|
| 163 | + $title = __('Recipes', 'lsx-health-plan'); |
|
| 164 | 164 | } |
| 165 | - if ( is_post_type_archive( 'exercise' ) ) { |
|
| 166 | - $title = __( 'Exercises', 'lsx-health-plan' ); |
|
| 165 | + if (is_post_type_archive('exercise')) { |
|
| 166 | + $title = __('Exercises', 'lsx-health-plan'); |
|
| 167 | 167 | } |
| 168 | - if ( is_tax() ) { |
|
| 168 | + if (is_tax()) { |
|
| 169 | 169 | $queried_object = get_queried_object(); |
| 170 | - if ( isset( $queried_object->name ) ) { |
|
| 170 | + if (isset($queried_object->name)) { |
|
| 171 | 171 | $title = $queried_object->name; |
| 172 | 172 | } |
| 173 | 173 | } |