lightspeeddevelopment /
lsx-health-plan
| 1 | <?php |
||||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||
| 2 | namespace lsx_health_plan\shortcodes; |
||||
| 3 | |||||
| 4 | /** |
||||
| 5 | * LSX Health Plan Conditional Helpers. |
||||
| 6 | * |
||||
| 7 | * @package lsx-health-plan |
||||
| 8 | */ |
||||
| 9 | |||||
| 10 | /** |
||||
| 11 | * Only display the my account page is the user is logged out. |
||||
| 12 | * |
||||
| 13 | * @return string |
||||
| 14 | */ |
||||
| 15 | function restricted_content() { |
||||
|
0 ignored issues
–
show
|
|||||
| 16 | $content = ''; |
||||
| 17 | if ( ! is_user_logged_in() ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 18 | ob_start(); |
||||
| 19 | echo do_shortcode( '[woocommerce_my_account]' ); |
||||
| 20 | $content = ob_get_clean(); |
||||
| 21 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 22 | return $content; |
||||
| 23 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 24 | |||||
| 25 | /** |
||||
| 26 | * Outputs the my profile tabs on the frontpage, |
||||
| 27 | * |
||||
| 28 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 29 | */ |
||||
| 30 | function my_profile_tabs() { |
||||
| 31 | ob_start(); |
||||
| 32 | echo lsx_health_plan_my_profile_tabs(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_my_profile_tabs() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 33 | $content = ob_get_clean(); |
||||
| 34 | return $content; |
||||
| 35 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 36 | |||||
| 37 | /** |
||||
| 38 | * Outputs the my profile box on the frontpage. |
||||
| 39 | * |
||||
| 40 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 41 | */ |
||||
| 42 | function my_profile_box() { |
||||
| 43 | ob_start(); |
||||
| 44 | echo lsx_health_plan_my_profile_box(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_my_profile_box() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 45 | $content = ob_get_clean(); |
||||
| 46 | return $content; |
||||
| 47 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 48 | |||||
| 49 | /** |
||||
|
0 ignored issues
–
show
|
|||||
| 50 | * Outputs all the plans on the frontpage. |
||||
| 51 | * |
||||
| 52 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 53 | */ |
||||
| 54 | function all_plans_box( $args = array() ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 55 | |||||
| 56 | ob_start(); |
||||
| 57 | echo lsx_health_plan_all_plans_block(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_all_plans_block() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 58 | $content = ob_get_clean(); |
||||
| 59 | return $content; |
||||
| 60 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 61 | |||||
| 62 | /** |
||||
|
0 ignored issues
–
show
|
|||||
| 63 | * Outputs the my profile box on the frontpage. |
||||
| 64 | * |
||||
| 65 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 66 | */ |
||||
| 67 | function day_plan_box( $args = array() ) { |
||||
| 68 | $defaults = array( |
||||
| 69 | 'week_view' => false, |
||||
| 70 | 'show_downloads' => false, |
||||
| 71 | 'plan' => '', |
||||
| 72 | ); |
||||
| 73 | $args = wp_parse_args( $args, $defaults ); |
||||
| 74 | ob_start(); |
||||
| 75 | if ( false === $args['week_view'] ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 76 | echo lsx_health_plan_day_plan_block( $args ); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_day_plan_block($args) of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 77 | } else { |
||||
| 78 | echo lsx_health_plan_week_plan_block( $args ); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_week_plan_block($args) of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 79 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 80 | $content = ob_get_clean(); |
||||
| 81 | return $content; |
||||
| 82 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 83 | |||||
| 84 | /** |
||||
| 85 | * Outputs the my exercise shortcode box on the frontpage |
||||
| 86 | * |
||||
| 87 | * @param array $args |
||||
|
0 ignored issues
–
show
|
|||||
| 88 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 89 | */ |
||||
| 90 | function exercise_box( $args = array() ) { |
||||
| 91 | $defaults = array( |
||||
| 92 | 'include' => '', |
||||
| 93 | 'term' => '', |
||||
| 94 | 'taxonomy' => '', |
||||
| 95 | 'view_more' => false, |
||||
| 96 | 'columns' => 3, |
||||
| 97 | 'limit' => 4, |
||||
| 98 | 'post_type' => 'exercise', |
||||
| 99 | 'orderby' => 'date', |
||||
| 100 | 'order' => 'DESC', |
||||
| 101 | 'description' => 'none', |
||||
| 102 | 'link' => 'item', |
||||
| 103 | 'link_class' => 'btn border-btn', |
||||
| 104 | 'layout' => 'grid', |
||||
| 105 | 'image_size' => 'lsx-thumbnail-square', |
||||
| 106 | 'parent' => false, |
||||
| 107 | 'modal_content' => 'excerpt', |
||||
| 108 | ); |
||||
| 109 | $args = wp_parse_args( $args, $defaults ); |
||||
| 110 | ob_start(); |
||||
| 111 | echo lsx_health_plan_items( $args ); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_items($args) of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 112 | $content = ob_get_clean(); |
||||
| 113 | return $content; |
||||
| 114 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 115 | |||||
| 116 | /** |
||||
| 117 | * Outputs the my featured video box on the frontpage. |
||||
| 118 | * |
||||
| 119 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 120 | */ |
||||
| 121 | function feature_video_box() { |
||||
| 122 | ob_start(); |
||||
| 123 | echo lsx_health_plan_featured_video_block(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_featured_video_block() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 124 | $content = ob_get_clean(); |
||||
| 125 | |||||
| 126 | wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 127 | wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 128 | return $content; |
||||
| 129 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 130 | |||||
| 131 | /** |
||||
| 132 | * Outputs the my featured recipes box on the frontpage. |
||||
| 133 | * |
||||
| 134 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 135 | */ |
||||
| 136 | function feature_recipes_box() { |
||||
| 137 | ob_start(); |
||||
| 138 | echo lsx_health_plan_featured_recipes_block(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_featured_recipes_block() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 139 | $content = ob_get_clean(); |
||||
| 140 | wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 141 | wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 142 | return $content; |
||||
| 143 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 144 | |||||
| 145 | /** |
||||
| 146 | * Outputs the my featured tips box on the frontpage. |
||||
| 147 | * |
||||
| 148 | * @return void |
||||
|
0 ignored issues
–
show
|
|||||
| 149 | */ |
||||
| 150 | function feature_tips_box() { |
||||
| 151 | ob_start(); |
||||
| 152 | echo lsx_health_plan_featured_tips_block(); // WPCS: XSS OK. |
||||
|
0 ignored issues
–
show
Are you sure
lsx_health_plan_featured_tips_block() of type void can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 153 | $content = ob_get_clean(); |
||||
| 154 | wp_enqueue_script( 'slick', LSX_HEALTH_PLAN_URL . 'assets/js/slick.min.js', array( 'jquery' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 155 | wp_enqueue_script( 'lsx-health-plan-slider', LSX_HEALTH_PLAN_URL . 'assets/js/lsx-health-plan-slider.min.js', array( 'slick' ), LSX_HEALTH_PLAN_VER, true ); |
||||
| 156 | return $content; |
||||
| 157 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 158 | |||||
| 159 | /** |
||||
| 160 | * Prints out the WooCommerce My Account Notices. |
||||
| 161 | * |
||||
| 162 | * @return string |
||||
| 163 | */ |
||||
| 164 | function account_notices() { |
||||
| 165 | $content = ''; |
||||
| 166 | if ( function_exists( 'wc_print_notices' ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 167 | $content = wc_print_notices( true ); |
||||
| 168 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 169 | return $content; |
||||
| 170 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 171 |