@@ -8,104 +8,104 @@ |
||
| 8 | 8 | global $group_name; |
| 9 | 9 | $groups = get_post_meta( get_the_ID(), $group_name, true ); |
| 10 | 10 | if ( is_singular( 'workout' ) ) { |
| 11 | - $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
| 11 | + $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
| 12 | 12 | } |
| 13 | 13 | if ( ! empty( $groups ) ) { |
| 14 | - ?> |
|
| 14 | + ?> |
|
| 15 | 15 | <div class="set-table"> |
| 16 | 16 | <table class="workout-table"> |
| 17 | 17 | <?php |
| 18 | - $table_headers = array(); |
|
| 19 | - $table_body = array(); |
|
| 18 | + $table_headers = array(); |
|
| 19 | + $table_body = array(); |
|
| 20 | 20 | |
| 21 | - foreach ( $groups as $group ) { |
|
| 22 | - $this_row = array(); |
|
| 21 | + foreach ( $groups as $group ) { |
|
| 22 | + $this_row = array(); |
|
| 23 | 23 | |
| 24 | - $this_row[] = '<tr>'; |
|
| 24 | + $this_row[] = '<tr>'; |
|
| 25 | 25 | |
| 26 | - // Getting the connected exercise. |
|
| 27 | - if ( post_type_exists( 'exercise' ) ) { |
|
| 28 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 29 | - $exercise = $group['connected_exercises']; |
|
| 30 | - $exercise_id = get_post( $exercise ); |
|
| 31 | - } |
|
| 32 | - } else { |
|
| 33 | - $exercise = false; |
|
| 34 | - $exercise_id = false; |
|
| 35 | - } |
|
| 26 | + // Getting the connected exercise. |
|
| 27 | + if ( post_type_exists( 'exercise' ) ) { |
|
| 28 | + if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 29 | + $exercise = $group['connected_exercises']; |
|
| 30 | + $exercise_id = get_post( $exercise ); |
|
| 31 | + } |
|
| 32 | + } else { |
|
| 33 | + $exercise = false; |
|
| 34 | + $exercise_id = false; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - if ( false !== $exercise && '' !== $exercise ) { |
|
| 38 | - $exercise_name = get_the_title( $exercise_id ); |
|
| 39 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>'; |
|
| 40 | - $table_headers['name'] = true; |
|
| 41 | - } else { |
|
| 42 | - if ( isset( $group['name'] ) && '' !== $group['name'] ) { |
|
| 43 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>'; |
|
| 44 | - $table_headers['name'] = true; |
|
| 45 | - } |
|
| 46 | - } |
|
| 47 | - // Only display this is exercise is disabled. |
|
| 48 | - if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) { |
|
| 49 | - $this_row[] = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>'; |
|
| 50 | - $table_headers['description'] = true; |
|
| 51 | - } |
|
| 37 | + if ( false !== $exercise && '' !== $exercise ) { |
|
| 38 | + $exercise_name = get_the_title( $exercise_id ); |
|
| 39 | + $this_row[] = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>'; |
|
| 40 | + $table_headers['name'] = true; |
|
| 41 | + } else { |
|
| 42 | + if ( isset( $group['name'] ) && '' !== $group['name'] ) { |
|
| 43 | + $this_row[] = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>'; |
|
| 44 | + $table_headers['name'] = true; |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | + // Only display this is exercise is disabled. |
|
| 48 | + if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) { |
|
| 49 | + $this_row[] = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>'; |
|
| 50 | + $table_headers['description'] = true; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
| 54 | - $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>'; |
|
| 55 | - $table_headers['reps'] = true; |
|
| 56 | - } |
|
| 53 | + if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
| 54 | + $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>'; |
|
| 55 | + $table_headers['reps'] = true; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - // Only display this is exercise is disabled. |
|
| 59 | - if ( false === $exercise ) { |
|
| 60 | - if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) { |
|
| 61 | - $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>'; |
|
| 62 | - $table_headers['equipment'] = true; |
|
| 63 | - } |
|
| 64 | - if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) { |
|
| 65 | - $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>'; |
|
| 66 | - $table_headers['muscle'] = true; |
|
| 67 | - } |
|
| 68 | - } |
|
| 69 | - if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) { |
|
| 70 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>'; |
|
| 71 | - $table_headers['video'] = true; |
|
| 72 | - } |
|
| 73 | - if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 74 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>'; |
|
| 75 | - $table_headers['exercise'] = true; |
|
| 76 | - } |
|
| 77 | - $this_row[] = '</tr>'; |
|
| 58 | + // Only display this is exercise is disabled. |
|
| 59 | + if ( false === $exercise ) { |
|
| 60 | + if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) { |
|
| 61 | + $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>'; |
|
| 62 | + $table_headers['equipment'] = true; |
|
| 63 | + } |
|
| 64 | + if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) { |
|
| 65 | + $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>'; |
|
| 66 | + $table_headers['muscle'] = true; |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | + if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) { |
|
| 70 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>'; |
|
| 71 | + $table_headers['video'] = true; |
|
| 72 | + } |
|
| 73 | + if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 74 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>'; |
|
| 75 | + $table_headers['exercise'] = true; |
|
| 76 | + } |
|
| 77 | + $this_row[] = '</tr>'; |
|
| 78 | 78 | |
| 79 | - $table_body[] = implode( '', $this_row ); |
|
| 80 | - $m++; |
|
| 81 | - } |
|
| 79 | + $table_body[] = implode( '', $this_row ); |
|
| 80 | + $m++; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - // Now we build the table header. |
|
| 84 | - $table_header = array(); |
|
| 85 | - $table_header[] = '<tr>'; |
|
| 86 | - if ( isset( $table_headers['name'] ) ) { |
|
| 87 | - $table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>'; |
|
| 88 | - } |
|
| 89 | - if ( isset( $table_headers['description'] ) ) { |
|
| 90 | - $table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>'; |
|
| 91 | - } |
|
| 92 | - if ( isset( $table_headers['reps'] ) ) { |
|
| 93 | - $table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>'; |
|
| 94 | - } |
|
| 95 | - if ( isset( $table_headers['equipment'] ) ) { |
|
| 96 | - $table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>'; |
|
| 97 | - } |
|
| 98 | - if ( isset( $table_headers['muscle'] ) ) { |
|
| 99 | - $table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>'; |
|
| 100 | - } |
|
| 101 | - if ( isset( $table_headers['video'] ) ) { |
|
| 102 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 103 | - } |
|
| 104 | - if ( isset( $table_headers['exercise'] ) ) { |
|
| 105 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 106 | - } |
|
| 107 | - $table_header[] = '</tr>'; |
|
| 108 | - ?> |
|
| 83 | + // Now we build the table header. |
|
| 84 | + $table_header = array(); |
|
| 85 | + $table_header[] = '<tr>'; |
|
| 86 | + if ( isset( $table_headers['name'] ) ) { |
|
| 87 | + $table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>'; |
|
| 88 | + } |
|
| 89 | + if ( isset( $table_headers['description'] ) ) { |
|
| 90 | + $table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>'; |
|
| 91 | + } |
|
| 92 | + if ( isset( $table_headers['reps'] ) ) { |
|
| 93 | + $table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>'; |
|
| 94 | + } |
|
| 95 | + if ( isset( $table_headers['equipment'] ) ) { |
|
| 96 | + $table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>'; |
|
| 97 | + } |
|
| 98 | + if ( isset( $table_headers['muscle'] ) ) { |
|
| 99 | + $table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>'; |
|
| 100 | + } |
|
| 101 | + if ( isset( $table_headers['video'] ) ) { |
|
| 102 | + $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 103 | + } |
|
| 104 | + if ( isset( $table_headers['exercise'] ) ) { |
|
| 105 | + $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 106 | + } |
|
| 107 | + $table_header[] = '</tr>'; |
|
| 108 | + ?> |
|
| 109 | 109 | <thead> |
| 110 | 110 | <?php echo wp_kses_post( implode( '', $table_header ) ); ?> |
| 111 | 111 | </thead> |
@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | global $group_name; |
| 9 | -$groups = get_post_meta( get_the_ID(), $group_name, true ); |
|
| 10 | -if ( is_singular( 'workout' ) ) { |
|
| 11 | - $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
| 9 | +$groups = get_post_meta(get_the_ID(), $group_name, true); |
|
| 10 | +if (is_singular('workout')) { |
|
| 11 | + $groups = get_post_meta(get_queried_object_id(), $group_name, true); |
|
| 12 | 12 | } |
| 13 | -if ( ! empty( $groups ) ) { |
|
| 13 | +if ( ! empty($groups)) { |
|
| 14 | 14 | ?> |
| 15 | 15 | <div class="set-table"> |
| 16 | 16 | <table class="workout-table"> |
@@ -18,99 +18,99 @@ discard block |
||
| 18 | 18 | $table_headers = array(); |
| 19 | 19 | $table_body = array(); |
| 20 | 20 | |
| 21 | - foreach ( $groups as $group ) { |
|
| 21 | + foreach ($groups as $group) { |
|
| 22 | 22 | $this_row = array(); |
| 23 | 23 | |
| 24 | 24 | $this_row[] = '<tr>'; |
| 25 | 25 | |
| 26 | 26 | // Getting the connected exercise. |
| 27 | - if ( post_type_exists( 'exercise' ) ) { |
|
| 28 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 27 | + if (post_type_exists('exercise')) { |
|
| 28 | + if (isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) { |
|
| 29 | 29 | $exercise = $group['connected_exercises']; |
| 30 | - $exercise_id = get_post( $exercise ); |
|
| 30 | + $exercise_id = get_post($exercise); |
|
| 31 | 31 | } |
| 32 | 32 | } else { |
| 33 | 33 | $exercise = false; |
| 34 | 34 | $exercise_id = false; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ( false !== $exercise && '' !== $exercise ) { |
|
| 38 | - $exercise_name = get_the_title( $exercise_id ); |
|
| 39 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $exercise_name ) . '</td>'; |
|
| 37 | + if (false !== $exercise && '' !== $exercise) { |
|
| 38 | + $exercise_name = get_the_title($exercise_id); |
|
| 39 | + $this_row[] = '<td class="workout-title-item">' . esc_html($exercise_name) . '</td>'; |
|
| 40 | 40 | $table_headers['name'] = true; |
| 41 | 41 | } else { |
| 42 | - if ( isset( $group['name'] ) && '' !== $group['name'] ) { |
|
| 43 | - $this_row[] = '<td class="workout-title-item">' . esc_html( $group['name'] ) . '</td>'; |
|
| 42 | + if (isset($group['name']) && '' !== $group['name']) { |
|
| 43 | + $this_row[] = '<td class="workout-title-item">' . esc_html($group['name']) . '</td>'; |
|
| 44 | 44 | $table_headers['name'] = true; |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | // Only display this is exercise is disabled. |
| 48 | - if ( false === $exercise && isset( $group['description'] ) && '' !== $group['description'] ) { |
|
| 49 | - $this_row[] = '<td class="workout-desc-item"><p>' . esc_html( $group['description'] ) . '</td>'; |
|
| 48 | + if (false === $exercise && isset($group['description']) && '' !== $group['description']) { |
|
| 49 | + $this_row[] = '<td class="workout-desc-item"><p>' . esc_html($group['description']) . '</td>'; |
|
| 50 | 50 | $table_headers['description'] = true; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
| 54 | - $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html( $group['reps'] ) . '</td>'; |
|
| 53 | + if (isset($group['reps']) && '' !== $group['reps']) { |
|
| 54 | + $this_row[] = '<td class="reps-field-item center-mobile">' . esc_html($group['reps']) . '</td>'; |
|
| 55 | 55 | $table_headers['reps'] = true; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Only display this is exercise is disabled. |
| 59 | - if ( false === $exercise ) { |
|
| 60 | - if ( isset( $group['equipment'] ) && '' !== $group['equipment'] ) { |
|
| 61 | - $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html( $group['equipment'] ) . '</td>'; |
|
| 59 | + if (false === $exercise) { |
|
| 60 | + if (isset($group['equipment']) && '' !== $group['equipment']) { |
|
| 61 | + $this_row[] = '<td class="equipment-field-item center-mobile">' . esc_html($group['equipment']) . '</td>'; |
|
| 62 | 62 | $table_headers['equipment'] = true; |
| 63 | 63 | } |
| 64 | - if ( isset( $group['muscle'] ) && '' !== $group['muscle'] ) { |
|
| 65 | - $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html( $group['muscle'] ) . '</td>'; |
|
| 64 | + if (isset($group['muscle']) && '' !== $group['muscle']) { |
|
| 65 | + $this_row[] = '<td class="muscle-field-item center-mobile">' . esc_html($group['muscle']) . '</td>'; |
|
| 66 | 66 | $table_headers['muscle'] = true; |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | - if ( post_type_exists( 'video' ) && isset( $group['connected_videos'] ) && '' !== $group['connected_videos'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_videos'] ) ) ) ) { |
|
| 70 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button( $m, $group, false ) . '</td>'; |
|
| 69 | + if (post_type_exists('video') && isset($group['connected_videos']) && '' !== $group['connected_videos'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_videos'])))) { |
|
| 70 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_video_play_button($m, $group, false) . '</td>'; |
|
| 71 | 71 | $table_headers['video'] = true; |
| 72 | 72 | } |
| 73 | - if ( post_type_exists( 'exercise' ) && isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] && ! empty( \lsx_health_plan\functions\check_posts_exist( array( $group['connected_exercises'] ) ) ) ) { |
|
| 74 | - $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button( $m, $group, false ) . '</td>'; |
|
| 73 | + if (post_type_exists('exercise') && isset($group['connected_exercises']) && '' !== $group['connected_exercises'] && ! empty(\lsx_health_plan\functions\check_posts_exist(array($group['connected_exercises'])))) { |
|
| 74 | + $this_row[] = '<td class="video-button-item center-mobile">' . lsx_health_plan_workout_exercise_button($m, $group, false) . '</td>'; |
|
| 75 | 75 | $table_headers['exercise'] = true; |
| 76 | 76 | } |
| 77 | 77 | $this_row[] = '</tr>'; |
| 78 | 78 | |
| 79 | - $table_body[] = implode( '', $this_row ); |
|
| 79 | + $table_body[] = implode('', $this_row); |
|
| 80 | 80 | $m++; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Now we build the table header. |
| 84 | 84 | $table_header = array(); |
| 85 | 85 | $table_header[] = '<tr>'; |
| 86 | - if ( isset( $table_headers['name'] ) ) { |
|
| 87 | - $table_header[] = '<th class="center-mobile">' . __( 'Workout', 'lsx-health-plan' ) . '</th>'; |
|
| 86 | + if (isset($table_headers['name'])) { |
|
| 87 | + $table_header[] = '<th class="center-mobile">' . __('Workout', 'lsx-health-plan') . '</th>'; |
|
| 88 | 88 | } |
| 89 | - if ( isset( $table_headers['description'] ) ) { |
|
| 90 | - $table_header[] = '<th class="center-mobile">' . __( 'Description', 'lsx-health-plan' ) . '</th>'; |
|
| 89 | + if (isset($table_headers['description'])) { |
|
| 90 | + $table_header[] = '<th class="center-mobile">' . __('Description', 'lsx-health-plan') . '</th>'; |
|
| 91 | 91 | } |
| 92 | - if ( isset( $table_headers['reps'] ) ) { |
|
| 93 | - $table_header[] = '<th class="center-mobile">' . __( 'Reps / Time / Distance', 'lsx-health-plan' ) . '</th>'; |
|
| 92 | + if (isset($table_headers['reps'])) { |
|
| 93 | + $table_header[] = '<th class="center-mobile">' . __('Reps / Time / Distance', 'lsx-health-plan') . '</th>'; |
|
| 94 | 94 | } |
| 95 | - if ( isset( $table_headers['equipment'] ) ) { |
|
| 96 | - $table_header[] = '<th class="center-mobile">' . __( 'Equipment', 'lsx-health-plan' ) . '</th>'; |
|
| 95 | + if (isset($table_headers['equipment'])) { |
|
| 96 | + $table_header[] = '<th class="center-mobile">' . __('Equipment', 'lsx-health-plan') . '</th>'; |
|
| 97 | 97 | } |
| 98 | - if ( isset( $table_headers['muscle'] ) ) { |
|
| 99 | - $table_header[] = '<th class="center-mobile">' . __( 'Muscle', 'lsx-health-plan' ) . '</th>'; |
|
| 98 | + if (isset($table_headers['muscle'])) { |
|
| 99 | + $table_header[] = '<th class="center-mobile">' . __('Muscle', 'lsx-health-plan') . '</th>'; |
|
| 100 | 100 | } |
| 101 | - if ( isset( $table_headers['video'] ) ) { |
|
| 102 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 101 | + if (isset($table_headers['video'])) { |
|
| 102 | + $table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>'; |
|
| 103 | 103 | } |
| 104 | - if ( isset( $table_headers['exercise'] ) ) { |
|
| 105 | - $table_header[] = '<th class="center-mobile">' . __( 'How To', 'lsx-health-plan' ) . '</th>'; |
|
| 104 | + if (isset($table_headers['exercise'])) { |
|
| 105 | + $table_header[] = '<th class="center-mobile">' . __('How To', 'lsx-health-plan') . '</th>'; |
|
| 106 | 106 | } |
| 107 | 107 | $table_header[] = '</tr>'; |
| 108 | 108 | ?> |
| 109 | 109 | <thead> |
| 110 | - <?php echo wp_kses_post( implode( '', $table_header ) ); ?> |
|
| 110 | + <?php echo wp_kses_post(implode('', $table_header)); ?> |
|
| 111 | 111 | </thead> |
| 112 | 112 | <tbody> |
| 113 | - <?php echo wp_kses_post( implode( '', $table_body ) ); ?> |
|
| 113 | + <?php echo wp_kses_post(implode('', $table_body)); ?> |
|
| 114 | 114 | </tbody> |
| 115 | 115 | </table> |
| 116 | 116 | <?php |
@@ -9,47 +9,47 @@ |
||
| 9 | 9 | <table class="exercise-table"> |
| 10 | 10 | <tbody> |
| 11 | 11 | <?php |
| 12 | - if ( ! empty( $type ) ) { |
|
| 13 | - ?> |
|
| 12 | + if ( ! empty( $type ) ) { |
|
| 13 | + ?> |
|
| 14 | 14 | <tr class="types"> |
| 15 | 15 | <td><?php esc_html_e( 'Type:', 'lsx-health-plan' ); ?> </td> |
| 16 | 16 | <td> |
| 17 | 17 | <?php |
| 18 | - echo wp_kses_post( $type ); |
|
| 19 | - ?> |
|
| 18 | + echo wp_kses_post( $type ); |
|
| 19 | + ?> |
|
| 20 | 20 | </td> |
| 21 | 21 | </tr> |
| 22 | 22 | <?php |
| 23 | - } |
|
| 24 | - ?> |
|
| 23 | + } |
|
| 24 | + ?> |
|
| 25 | 25 | <?php |
| 26 | - if ( ! empty( $muscle_group ) ) { |
|
| 27 | - ?> |
|
| 26 | + if ( ! empty( $muscle_group ) ) { |
|
| 27 | + ?> |
|
| 28 | 28 | <tr class="muscle-group"> |
| 29 | 29 | <td><?php esc_html_e( 'Muscle:', 'lsx-health-plan' ); ?> </td> |
| 30 | 30 | <td> |
| 31 | 31 | <?php |
| 32 | - echo wp_kses_post( $muscle_group ); |
|
| 33 | - ?> |
|
| 32 | + echo wp_kses_post( $muscle_group ); |
|
| 33 | + ?> |
|
| 34 | 34 | </td> |
| 35 | 35 | </tr> |
| 36 | 36 | <?php |
| 37 | - } |
|
| 38 | - ?> |
|
| 37 | + } |
|
| 38 | + ?> |
|
| 39 | 39 | <?php |
| 40 | - if ( ! empty( $equipment ) ) { |
|
| 41 | - ?> |
|
| 40 | + if ( ! empty( $equipment ) ) { |
|
| 41 | + ?> |
|
| 42 | 42 | <tr class="equipment"> |
| 43 | 43 | <td><?php esc_html_e( 'Equipment:', 'lsx-health-plan' ); ?> </td> |
| 44 | 44 | <td> |
| 45 | 45 | <?php |
| 46 | - echo wp_kses_post( $equipment ); |
|
| 47 | - ?> |
|
| 46 | + echo wp_kses_post( $equipment ); |
|
| 47 | + ?> |
|
| 48 | 48 | </td> |
| 49 | 49 | </tr> |
| 50 | 50 | <?php |
| 51 | - } |
|
| 52 | - ?> |
|
| 51 | + } |
|
| 52 | + ?> |
|
| 53 | 53 | </tbody> |
| 54 | 54 | </table> |
| 55 | 55 | <?php } ?> |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $muscle_group = lsx_health_plan_muscle_group_equipment(); |
| 6 | 6 | |
| 7 | 7 | ?> |
| 8 | -<?php if ( ( ! empty( $type ) ) || ( ! empty( $equipment ) ) || ( ! empty( $muscle_group ) ) ) { ?> |
|
| 8 | +<?php if (( ! empty($type)) || ( ! empty($equipment)) || ( ! empty($muscle_group))) { ?> |
|
| 9 | 9 | <table class="exercise-table"> |
| 10 | 10 | <tbody> |
| 11 | 11 | <?php |
| 12 | - if ( ! empty( $type ) ) { |
|
| 12 | + if ( ! empty($type)) { |
|
| 13 | 13 | ?> |
| 14 | 14 | <tr class="types"> |
| 15 | - <td><?php esc_html_e( 'Type:', 'lsx-health-plan' ); ?> </td> |
|
| 15 | + <td><?php esc_html_e('Type:', 'lsx-health-plan'); ?> </td> |
|
| 16 | 16 | <td> |
| 17 | 17 | <?php |
| 18 | - echo wp_kses_post( $type ); |
|
| 18 | + echo wp_kses_post($type); |
|
| 19 | 19 | ?> |
| 20 | 20 | </td> |
| 21 | 21 | </tr> |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | ?> |
| 25 | 25 | <?php |
| 26 | - if ( ! empty( $muscle_group ) ) { |
|
| 26 | + if ( ! empty($muscle_group)) { |
|
| 27 | 27 | ?> |
| 28 | 28 | <tr class="muscle-group"> |
| 29 | - <td><?php esc_html_e( 'Muscle:', 'lsx-health-plan' ); ?> </td> |
|
| 29 | + <td><?php esc_html_e('Muscle:', 'lsx-health-plan'); ?> </td> |
|
| 30 | 30 | <td> |
| 31 | 31 | <?php |
| 32 | - echo wp_kses_post( $muscle_group ); |
|
| 32 | + echo wp_kses_post($muscle_group); |
|
| 33 | 33 | ?> |
| 34 | 34 | </td> |
| 35 | 35 | </tr> |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | ?> |
| 39 | 39 | <?php |
| 40 | - if ( ! empty( $equipment ) ) { |
|
| 40 | + if ( ! empty($equipment)) { |
|
| 41 | 41 | ?> |
| 42 | 42 | <tr class="equipment"> |
| 43 | - <td><?php esc_html_e( 'Equipment:', 'lsx-health-plan' ); ?> </td> |
|
| 43 | + <td><?php esc_html_e('Equipment:', 'lsx-health-plan'); ?> </td> |
|
| 44 | 44 | <td> |
| 45 | 45 | <?php |
| 46 | - echo wp_kses_post( $equipment ); |
|
| 46 | + echo wp_kses_post($equipment); |
|
| 47 | 47 | ?> |
| 48 | 48 | </td> |
| 49 | 49 | </tr> |
@@ -11,10 +11,10 @@ discard block |
||
| 11 | 11 | * @return exercise_type |
| 12 | 12 | */ |
| 13 | 13 | function lsx_health_plan_exercise_type() { |
| 14 | - $term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' ); |
|
| 15 | - if ( ! empty( $term_obj_list ) ) { |
|
| 16 | - return $term_obj_list; |
|
| 17 | - } |
|
| 14 | + $term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' ); |
|
| 15 | + if ( ! empty( $term_obj_list ) ) { |
|
| 16 | + return $term_obj_list; |
|
| 17 | + } |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | * @return muscle_group_equipment |
| 24 | 24 | */ |
| 25 | 25 | function lsx_health_plan_muscle_group_equipment() { |
| 26 | - $term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' ); |
|
| 27 | - if ( ! empty( $term_obj_list ) ) { |
|
| 28 | - return $term_obj_list; |
|
| 29 | - } |
|
| 26 | + $term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' ); |
|
| 27 | + if ( ! empty( $term_obj_list ) ) { |
|
| 28 | + return $term_obj_list; |
|
| 29 | + } |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | * @return exercise_equipment |
| 36 | 36 | */ |
| 37 | 37 | function lsx_health_plan_exercise_equipment() { |
| 38 | - $term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' ); |
|
| 39 | - if ( ! empty( $term_obj_list ) ) { |
|
| 40 | - return $term_obj_list; |
|
| 41 | - } |
|
| 38 | + $term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' ); |
|
| 39 | + if ( ! empty( $term_obj_list ) ) { |
|
| 40 | + return $term_obj_list; |
|
| 41 | + } |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -47,81 +47,81 @@ discard block |
||
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | 49 | function lsx_health_plan_exercise_data() { |
| 50 | - include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php'; |
|
| 50 | + include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php'; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) { |
| 54 | - $defaults = array( |
|
| 55 | - 'modal_trigger' => 'button', |
|
| 56 | - 'modal_content' => 'excerpt', |
|
| 57 | - ); |
|
| 58 | - $args = wp_parse_args( $args, $defaults ); |
|
| 54 | + $defaults = array( |
|
| 55 | + 'modal_trigger' => 'button', |
|
| 56 | + 'modal_content' => 'excerpt', |
|
| 57 | + ); |
|
| 58 | + $args = wp_parse_args( $args, $defaults ); |
|
| 59 | 59 | |
| 60 | - $exercise_id = ''; |
|
| 61 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 62 | - $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 63 | - $content = get_post_field( 'post_content', $exercise_id ); |
|
| 64 | - $url = get_permalink( $exercise_id ); |
|
| 65 | - $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 66 | - $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 67 | - $lsx_hp = lsx_health_plan(); |
|
| 60 | + $exercise_id = ''; |
|
| 61 | + if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 62 | + $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 63 | + $content = get_post_field( 'post_content', $exercise_id ); |
|
| 64 | + $url = get_permalink( $exercise_id ); |
|
| 65 | + $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 66 | + $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 67 | + $lsx_hp = lsx_health_plan(); |
|
| 68 | 68 | |
| 69 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 70 | - $content = wp_trim_words( $content, 40 ); |
|
| 71 | - } |
|
| 69 | + if ( 'excerpt' === $args['modal_content'] ) { |
|
| 70 | + $content = wp_trim_words( $content, 40 ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - if ( 'link' ) { |
|
| 74 | - $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 75 | - } else { |
|
| 76 | - $play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 77 | - } |
|
| 73 | + if ( 'link' ) { |
|
| 74 | + $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 75 | + } else { |
|
| 76 | + $play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - $modal_body = ''; |
|
| 79 | + $modal_body = ''; |
|
| 80 | 80 | |
| 81 | - if ( '' !== $alt_image && ! empty( $alt_image ) ) { |
|
| 82 | - $modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>'; |
|
| 83 | - } else { |
|
| 84 | - if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 85 | - $gallery_args = array( |
|
| 86 | - 'css_class' => 'modal-slider', |
|
| 87 | - ); |
|
| 88 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 89 | - } else { |
|
| 90 | - $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 91 | - } |
|
| 92 | - } |
|
| 81 | + if ( '' !== $alt_image && ! empty( $alt_image ) ) { |
|
| 82 | + $modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>'; |
|
| 83 | + } else { |
|
| 84 | + if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 85 | + $gallery_args = array( |
|
| 86 | + 'css_class' => 'modal-slider', |
|
| 87 | + ); |
|
| 88 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 89 | + } else { |
|
| 90 | + $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - if ( '' !== $alt_title ) { |
|
| 95 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>'; |
|
| 96 | - } else { |
|
| 97 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 98 | - } |
|
| 94 | + if ( '' !== $alt_title ) { |
|
| 95 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>'; |
|
| 96 | + } else { |
|
| 97 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - if ( ! empty( $equipment_group ) ) { |
|
| 101 | - $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
|
| 102 | - } |
|
| 103 | - if ( ! empty( $muscle_group ) ) { |
|
| 104 | - $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
|
| 105 | - } |
|
| 106 | - $modal_body .= '</div>'; |
|
| 107 | - if ( '' !== $args['modal_content'] ) { |
|
| 108 | - if ( '' !== $alt_description ) { |
|
| 109 | - $modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>'; |
|
| 110 | - } else { |
|
| 111 | - $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
|
| 112 | - } |
|
| 113 | - } |
|
| 114 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 115 | - $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>'; |
|
| 116 | - } |
|
| 117 | - \lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body ); |
|
| 100 | + if ( ! empty( $equipment_group ) ) { |
|
| 101 | + $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
|
| 102 | + } |
|
| 103 | + if ( ! empty( $muscle_group ) ) { |
|
| 104 | + $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
|
| 105 | + } |
|
| 106 | + $modal_body .= '</div>'; |
|
| 107 | + if ( '' !== $args['modal_content'] ) { |
|
| 108 | + if ( '' !== $alt_description ) { |
|
| 109 | + $modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>'; |
|
| 110 | + } else { |
|
| 111 | + $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
|
| 112 | + } |
|
| 113 | + } |
|
| 114 | + if ( 'excerpt' === $args['modal_content'] ) { |
|
| 115 | + $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>'; |
|
| 116 | + } |
|
| 117 | + \lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body ); |
|
| 118 | 118 | |
| 119 | - if ( true === $echo ) { |
|
| 120 | - echo wp_kses_post( $play_button ); |
|
| 121 | - } else { |
|
| 122 | - return $play_button; |
|
| 123 | - } |
|
| 124 | - } |
|
| 119 | + if ( true === $echo ) { |
|
| 120 | + echo wp_kses_post( $play_button ); |
|
| 121 | + } else { |
|
| 122 | + return $play_button; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -134,65 +134,65 @@ discard block |
||
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | 136 | function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) { |
| 137 | - $defaults = array( |
|
| 138 | - 'modal_trigger' => 'button', |
|
| 139 | - 'modal_content' => 'excerpt', |
|
| 140 | - ); |
|
| 141 | - $args = wp_parse_args( $args, $defaults ); |
|
| 137 | + $defaults = array( |
|
| 138 | + 'modal_trigger' => 'button', |
|
| 139 | + 'modal_content' => 'excerpt', |
|
| 140 | + ); |
|
| 141 | + $args = wp_parse_args( $args, $defaults ); |
|
| 142 | 142 | |
| 143 | - $exercise_id = ''; |
|
| 144 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 145 | - $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 146 | - $content = get_post_field( 'post_content', $exercise_id ); |
|
| 147 | - $url = get_permalink( $exercise_id ); |
|
| 148 | - $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 149 | - $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 150 | - $lsx_hp = lsx_health_plan(); |
|
| 143 | + $exercise_id = ''; |
|
| 144 | + if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 145 | + $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 146 | + $content = get_post_field( 'post_content', $exercise_id ); |
|
| 147 | + $url = get_permalink( $exercise_id ); |
|
| 148 | + $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 149 | + $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 150 | + $lsx_hp = lsx_health_plan(); |
|
| 151 | 151 | |
| 152 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 153 | - $content = wp_trim_words( $content, 40 ); |
|
| 154 | - } |
|
| 152 | + if ( 'excerpt' === $args['modal_content'] ) { |
|
| 153 | + $content = wp_trim_words( $content, 40 ); |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | - if ( 'link' ) { |
|
| 157 | - $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 158 | - } else { |
|
| 159 | - $play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 160 | - } |
|
| 156 | + if ( 'link' ) { |
|
| 157 | + $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 158 | + } else { |
|
| 159 | + $play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - $modal_body = ''; |
|
| 162 | + $modal_body = ''; |
|
| 163 | 163 | |
| 164 | - if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 165 | - $gallery_args = array( |
|
| 166 | - 'css_class' => 'modal-slider', |
|
| 167 | - ); |
|
| 168 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 169 | - } else { |
|
| 170 | - $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 171 | - } |
|
| 164 | + if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 165 | + $gallery_args = array( |
|
| 166 | + 'css_class' => 'modal-slider', |
|
| 167 | + ); |
|
| 168 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 169 | + } else { |
|
| 170 | + $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 173 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 174 | 174 | |
| 175 | - if ( ! empty( $equipment_group ) ) { |
|
| 176 | - $modal_body .= '<span class="equipment-terms">' . __( 'Equipment', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>'; |
|
| 177 | - } |
|
| 178 | - if ( ! empty( $muscle_group ) ) { |
|
| 179 | - $modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $muscle_group . '</span>'; |
|
| 180 | - } |
|
| 181 | - $modal_body .= '</div>'; |
|
| 182 | - if ( '' !== $args['modal_content'] ) { |
|
| 183 | - $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
|
| 184 | - } |
|
| 185 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 186 | - $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-health-plan' ) . '</a>'; |
|
| 187 | - } |
|
| 188 | - \lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body ); |
|
| 175 | + if ( ! empty( $equipment_group ) ) { |
|
| 176 | + $modal_body .= '<span class="equipment-terms">' . __( 'Equipment', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>'; |
|
| 177 | + } |
|
| 178 | + if ( ! empty( $muscle_group ) ) { |
|
| 179 | + $modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $muscle_group . '</span>'; |
|
| 180 | + } |
|
| 181 | + $modal_body .= '</div>'; |
|
| 182 | + if ( '' !== $args['modal_content'] ) { |
|
| 183 | + $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
|
| 184 | + } |
|
| 185 | + if ( 'excerpt' === $args['modal_content'] ) { |
|
| 186 | + $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-health-plan' ) . '</a>'; |
|
| 187 | + } |
|
| 188 | + \lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body ); |
|
| 189 | 189 | |
| 190 | - if ( true === $echo ) { |
|
| 191 | - echo wp_kses_post( $play_button ); |
|
| 192 | - } else { |
|
| 193 | - return $play_button; |
|
| 194 | - } |
|
| 195 | - } |
|
| 190 | + if ( true === $echo ) { |
|
| 191 | + echo wp_kses_post( $play_button ); |
|
| 192 | + } else { |
|
| 193 | + return $play_button; |
|
| 194 | + } |
|
| 195 | + } |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -203,38 +203,38 @@ discard block |
||
| 203 | 203 | * @return void |
| 204 | 204 | */ |
| 205 | 205 | function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) { |
| 206 | - $equipment_group = get_the_term_list( $m, 'equipment', '', ', ' ); |
|
| 207 | - $muscle_group = get_the_term_list( $m, 'muscle-group', '', ', ' ); |
|
| 208 | - $title = get_the_title(); |
|
| 209 | - $lsx_hp = lsx_health_plan(); |
|
| 210 | - $button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>'; |
|
| 206 | + $equipment_group = get_the_term_list( $m, 'equipment', '', ', ' ); |
|
| 207 | + $muscle_group = get_the_term_list( $m, 'muscle-group', '', ', ' ); |
|
| 208 | + $title = get_the_title(); |
|
| 209 | + $lsx_hp = lsx_health_plan(); |
|
| 210 | + $button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>'; |
|
| 211 | 211 | |
| 212 | - if ( true === $content ) { |
|
| 213 | - $content = get_the_content(); |
|
| 214 | - } |
|
| 212 | + if ( true === $content ) { |
|
| 213 | + $content = get_the_content(); |
|
| 214 | + } |
|
| 215 | 215 | |
| 216 | - $modal_body = ''; |
|
| 217 | - if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) { |
|
| 218 | - $gallery_args = array( |
|
| 219 | - 'css_class' => 'modal-slider', |
|
| 220 | - ); |
|
| 221 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 222 | - } else { |
|
| 223 | - $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>'; |
|
| 224 | - } |
|
| 225 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>'; |
|
| 216 | + $modal_body = ''; |
|
| 217 | + if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) { |
|
| 218 | + $gallery_args = array( |
|
| 219 | + 'css_class' => 'modal-slider', |
|
| 220 | + ); |
|
| 221 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 222 | + } else { |
|
| 223 | + $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>'; |
|
| 224 | + } |
|
| 225 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>'; |
|
| 226 | 226 | |
| 227 | - if ( ! empty( $equipment_group ) ) { |
|
| 228 | - $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
|
| 229 | - } |
|
| 230 | - if ( ! empty( $muscle_group ) ) { |
|
| 231 | - $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
|
| 232 | - } |
|
| 233 | - $modal_body .= '</div>'; |
|
| 234 | - $modal_body .= $content; |
|
| 235 | - \lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body ); |
|
| 227 | + if ( ! empty( $equipment_group ) ) { |
|
| 228 | + $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
|
| 229 | + } |
|
| 230 | + if ( ! empty( $muscle_group ) ) { |
|
| 231 | + $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
|
| 232 | + } |
|
| 233 | + $modal_body .= '</div>'; |
|
| 234 | + $modal_body .= $content; |
|
| 235 | + \lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body ); |
|
| 236 | 236 | |
| 237 | - return ( $button ); |
|
| 237 | + return ( $button ); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -246,25 +246,25 @@ discard block |
||
| 246 | 246 | * @return string |
| 247 | 247 | */ |
| 248 | 248 | function lsx_health_plan_exercise_title( $before = '', $after = '', $url = true, $echo = true, $exercise_id = false ) { |
| 249 | - if ( false === $exercise_id ) { |
|
| 250 | - $exercise_id = get_the_ID(); |
|
| 251 | - } |
|
| 252 | - $link = get_the_permalink( $exercise_id ); |
|
| 253 | - $title = get_the_title( $exercise_id ); |
|
| 254 | - $side = get_post_meta( $exercise_id, 'exercise_side', true ); |
|
| 255 | - if ( '' !== $side ) { |
|
| 256 | - $title .= ' - ' . ucwords( $side ); |
|
| 257 | - } |
|
| 258 | - $link_before = ''; |
|
| 259 | - $link_after = ''; |
|
| 260 | - if ( true === $url ) { |
|
| 261 | - $link_before = '<a href="' . $link . '">'; |
|
| 262 | - $link_after = '</a>'; |
|
| 263 | - } |
|
| 264 | - $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before . $title . $link_after . $after, $title, $before, $after, $exercise_id ); |
|
| 265 | - if ( true === $echo ) { |
|
| 266 | - echo wp_kses_post( $title ); |
|
| 267 | - } else { |
|
| 268 | - return $title; |
|
| 269 | - } |
|
| 249 | + if ( false === $exercise_id ) { |
|
| 250 | + $exercise_id = get_the_ID(); |
|
| 251 | + } |
|
| 252 | + $link = get_the_permalink( $exercise_id ); |
|
| 253 | + $title = get_the_title( $exercise_id ); |
|
| 254 | + $side = get_post_meta( $exercise_id, 'exercise_side', true ); |
|
| 255 | + if ( '' !== $side ) { |
|
| 256 | + $title .= ' - ' . ucwords( $side ); |
|
| 257 | + } |
|
| 258 | + $link_before = ''; |
|
| 259 | + $link_after = ''; |
|
| 260 | + if ( true === $url ) { |
|
| 261 | + $link_before = '<a href="' . $link . '">'; |
|
| 262 | + $link_after = '</a>'; |
|
| 263 | + } |
|
| 264 | + $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before . $title . $link_after . $after, $title, $before, $after, $exercise_id ); |
|
| 265 | + if ( true === $echo ) { |
|
| 266 | + echo wp_kses_post( $title ); |
|
| 267 | + } else { |
|
| 268 | + return $title; |
|
| 269 | + } |
|
| 270 | 270 | } |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | * @return exercise_type |
| 12 | 12 | */ |
| 13 | 13 | function lsx_health_plan_exercise_type() { |
| 14 | - $term_obj_list = get_the_term_list( get_the_ID(), 'exercise-type', '', ', ' ); |
|
| 15 | - if ( ! empty( $term_obj_list ) ) { |
|
| 14 | + $term_obj_list = get_the_term_list(get_the_ID(), 'exercise-type', '', ', '); |
|
| 15 | + if ( ! empty($term_obj_list)) { |
|
| 16 | 16 | return $term_obj_list; |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @return muscle_group_equipment |
| 24 | 24 | */ |
| 25 | 25 | function lsx_health_plan_muscle_group_equipment() { |
| 26 | - $term_obj_list = get_the_term_list( get_the_ID(), 'muscle-group', '', ', ' ); |
|
| 27 | - if ( ! empty( $term_obj_list ) ) { |
|
| 26 | + $term_obj_list = get_the_term_list(get_the_ID(), 'muscle-group', '', ', '); |
|
| 27 | + if ( ! empty($term_obj_list)) { |
|
| 28 | 28 | return $term_obj_list; |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | * @return exercise_equipment |
| 36 | 36 | */ |
| 37 | 37 | function lsx_health_plan_exercise_equipment() { |
| 38 | - $term_obj_list = get_the_term_list( get_the_ID(), 'equipment', '', ', ' ); |
|
| 39 | - if ( ! empty( $term_obj_list ) ) { |
|
| 38 | + $term_obj_list = get_the_term_list(get_the_ID(), 'equipment', '', ', '); |
|
| 39 | + if ( ! empty($term_obj_list)) { |
|
| 40 | 40 | return $term_obj_list; |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -50,74 +50,74 @@ discard block |
||
| 50 | 50 | include LSX_HEALTH_PLAN_PATH . '/templates/table-exercise-data.php'; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -function lsx_health_plan_workout_exercise_alt_button( $m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image ) { |
|
| 53 | +function lsx_health_plan_workout_exercise_alt_button($m, $group, $echo = true, $args = array(), $alt_title, $alt_description, $alt_image) { |
|
| 54 | 54 | $defaults = array( |
| 55 | 55 | 'modal_trigger' => 'button', |
| 56 | 56 | 'modal_content' => 'excerpt', |
| 57 | 57 | ); |
| 58 | - $args = wp_parse_args( $args, $defaults ); |
|
| 58 | + $args = wp_parse_args($args, $defaults); |
|
| 59 | 59 | |
| 60 | 60 | $exercise_id = ''; |
| 61 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 62 | - $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 63 | - $content = get_post_field( 'post_content', $exercise_id ); |
|
| 64 | - $url = get_permalink( $exercise_id ); |
|
| 65 | - $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 66 | - $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 61 | + if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) { |
|
| 62 | + $exercise_id = esc_html($group['connected_exercises']); |
|
| 63 | + $content = get_post_field('post_content', $exercise_id); |
|
| 64 | + $url = get_permalink($exercise_id); |
|
| 65 | + $equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', '); |
|
| 66 | + $muscle_group = get_the_term_list($exercise_id, 'muscle-group', '', ', '); |
|
| 67 | 67 | $lsx_hp = lsx_health_plan(); |
| 68 | 68 | |
| 69 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 70 | - $content = wp_trim_words( $content, 40 ); |
|
| 69 | + if ('excerpt' === $args['modal_content']) { |
|
| 70 | + $content = wp_trim_words($content, 40); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ( 'link' ) { |
|
| 74 | - $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 73 | + if ('link') { |
|
| 74 | + $play_button = '<a data-toggle="modal" href="#workout-alt-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>'; |
|
| 75 | 75 | } else { |
| 76 | 76 | $play_button = '<button data-toggle="alt-modal" data-target="#workout-alt-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $modal_body = ''; |
|
| 79 | + $modal_body = ''; |
|
| 80 | 80 | |
| 81 | - if ( '' !== $alt_image && ! empty( $alt_image ) ) { |
|
| 81 | + if ('' !== $alt_image && ! empty($alt_image)) { |
|
| 82 | 82 | $modal_body .= '<div class="modal-image"/><img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '"></div>'; |
| 83 | 83 | } else { |
| 84 | - if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 84 | + if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) { |
|
| 85 | 85 | $gallery_args = array( |
| 86 | 86 | 'css_class' => 'modal-slider', |
| 87 | 87 | ); |
| 88 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 88 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args); |
|
| 89 | 89 | } else { |
| 90 | - $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 90 | + $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>'; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if ( '' !== $alt_title ) { |
|
| 94 | + if ('' !== $alt_title) { |
|
| 95 | 95 | $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $alt_title . '</h5>'; |
| 96 | 96 | } else { |
| 97 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 97 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>'; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if ( ! empty( $equipment_group ) ) { |
|
| 100 | + if ( ! empty($equipment_group)) { |
|
| 101 | 101 | $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
| 102 | 102 | } |
| 103 | - if ( ! empty( $muscle_group ) ) { |
|
| 103 | + if ( ! empty($muscle_group)) { |
|
| 104 | 104 | $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
| 105 | 105 | } |
| 106 | 106 | $modal_body .= '</div>'; |
| 107 | - if ( '' !== $args['modal_content'] ) { |
|
| 108 | - if ( '' !== $alt_description ) { |
|
| 107 | + if ('' !== $args['modal_content']) { |
|
| 108 | + if ('' !== $alt_description) { |
|
| 109 | 109 | $modal_body .= '<div class="modal-excerpt"/>' . $alt_description . '</div>'; |
| 110 | 110 | } else { |
| 111 | 111 | $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 115 | - $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-heal-plan' ) . '</a>'; |
|
| 114 | + if ('excerpt' === $args['modal_content']) { |
|
| 115 | + $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-heal-plan') . '</a>'; |
|
| 116 | 116 | } |
| 117 | - \lsx_health_plan\functions\register_modal( 'workout-alt-exercise-modal-' . $m, '', $modal_body ); |
|
| 117 | + \lsx_health_plan\functions\register_modal('workout-alt-exercise-modal-' . $m, '', $modal_body); |
|
| 118 | 118 | |
| 119 | - if ( true === $echo ) { |
|
| 120 | - echo wp_kses_post( $play_button ); |
|
| 119 | + if (true === $echo) { |
|
| 120 | + echo wp_kses_post($play_button); |
|
| 121 | 121 | } else { |
| 122 | 122 | return $play_button; |
| 123 | 123 | } |
@@ -133,62 +133,62 @@ discard block |
||
| 133 | 133 | * @param array $args |
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | -function lsx_health_plan_workout_exercise_button( $m, $group, $echo = true, $args = array() ) { |
|
| 136 | +function lsx_health_plan_workout_exercise_button($m, $group, $echo = true, $args = array()) { |
|
| 137 | 137 | $defaults = array( |
| 138 | 138 | 'modal_trigger' => 'button', |
| 139 | 139 | 'modal_content' => 'excerpt', |
| 140 | 140 | ); |
| 141 | - $args = wp_parse_args( $args, $defaults ); |
|
| 141 | + $args = wp_parse_args($args, $defaults); |
|
| 142 | 142 | |
| 143 | 143 | $exercise_id = ''; |
| 144 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 145 | - $exercise_id = esc_html( $group['connected_exercises'] ); |
|
| 146 | - $content = get_post_field( 'post_content', $exercise_id ); |
|
| 147 | - $url = get_permalink( $exercise_id ); |
|
| 148 | - $equipment_group = get_the_term_list( $exercise_id, 'equipment', '', ', ' ); |
|
| 149 | - $muscle_group = get_the_term_list( $exercise_id, 'muscle-group', '', ', ' ); |
|
| 144 | + if (isset($group['connected_exercises']) && '' !== $group['connected_exercises']) { |
|
| 145 | + $exercise_id = esc_html($group['connected_exercises']); |
|
| 146 | + $content = get_post_field('post_content', $exercise_id); |
|
| 147 | + $url = get_permalink($exercise_id); |
|
| 148 | + $equipment_group = get_the_term_list($exercise_id, 'equipment', '', ', '); |
|
| 149 | + $muscle_group = get_the_term_list($exercise_id, 'muscle-group', '', ', '); |
|
| 150 | 150 | $lsx_hp = lsx_health_plan(); |
| 151 | 151 | |
| 152 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 153 | - $content = wp_trim_words( $content, 40 ); |
|
| 152 | + if ('excerpt' === $args['modal_content']) { |
|
| 153 | + $content = wp_trim_words($content, 40); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if ( 'link' ) { |
|
| 157 | - $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title( $exercise_id ) . '</a>'; |
|
| 156 | + if ('link') { |
|
| 157 | + $play_button = '<a data-toggle="modal" href="#workout-exercise-modal-' . $m . '">' . get_the_title($exercise_id) . '</a>'; |
|
| 158 | 158 | } else { |
| 159 | 159 | $play_button = '<button data-toggle="modal" data-target="#workout-exercise-modal-' . $m . '"><span class="fa fa-play-circle"></span></button>'; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - $modal_body = ''; |
|
| 162 | + $modal_body = ''; |
|
| 163 | 163 | |
| 164 | - if ( $lsx_hp->frontend->gallery->has_gallery( $exercise_id ) ) { |
|
| 164 | + if ($lsx_hp->frontend->gallery->has_gallery($exercise_id)) { |
|
| 165 | 165 | $gallery_args = array( |
| 166 | 166 | 'css_class' => 'modal-slider', |
| 167 | 167 | ); |
| 168 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 168 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args); |
|
| 169 | 169 | } else { |
| 170 | - $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail( $exercise_id, 'large' ) . '</div>'; |
|
| 170 | + $modal_body .= '<div class="modal-image"/>' . get_the_post_thumbnail($exercise_id, 'large') . '</div>'; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title( $exercise_id ) . '</h5>'; |
|
| 173 | + $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . get_the_title($exercise_id) . '</h5>'; |
|
| 174 | 174 | |
| 175 | - if ( ! empty( $equipment_group ) ) { |
|
| 176 | - $modal_body .= '<span class="equipment-terms">' . __( 'Equipment', 'lsx-health-plan' ) . ': ' . $equipment_group . '</span>'; |
|
| 175 | + if ( ! empty($equipment_group)) { |
|
| 176 | + $modal_body .= '<span class="equipment-terms">' . __('Equipment', 'lsx-health-plan') . ': ' . $equipment_group . '</span>'; |
|
| 177 | 177 | } |
| 178 | - if ( ! empty( $muscle_group ) ) { |
|
| 179 | - $modal_body .= '<span class="muscle-terms">' . __( 'Muscle', 'lsx-health-plan' ) . ': ' . $muscle_group . '</span>'; |
|
| 178 | + if ( ! empty($muscle_group)) { |
|
| 179 | + $modal_body .= '<span class="muscle-terms">' . __('Muscle', 'lsx-health-plan') . ': ' . $muscle_group . '</span>'; |
|
| 180 | 180 | } |
| 181 | 181 | $modal_body .= '</div>'; |
| 182 | - if ( '' !== $args['modal_content'] ) { |
|
| 182 | + if ('' !== $args['modal_content']) { |
|
| 183 | 183 | $modal_body .= '<div class="modal-excerpt"/>' . $content . '</div>'; |
| 184 | 184 | } |
| 185 | - if ( 'excerpt' === $args['modal_content'] ) { |
|
| 186 | - $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __( 'Read More', 'lsx-health-plan' ) . '</a>'; |
|
| 185 | + if ('excerpt' === $args['modal_content']) { |
|
| 186 | + $modal_body .= '<a class="moretag" target="_blank" href="' . $url . '">' . __('Read More', 'lsx-health-plan') . '</a>'; |
|
| 187 | 187 | } |
| 188 | - \lsx_health_plan\functions\register_modal( 'workout-exercise-modal-' . $m, '', $modal_body ); |
|
| 188 | + \lsx_health_plan\functions\register_modal('workout-exercise-modal-' . $m, '', $modal_body); |
|
| 189 | 189 | |
| 190 | - if ( true === $echo ) { |
|
| 191 | - echo wp_kses_post( $play_button ); |
|
| 190 | + if (true === $echo) { |
|
| 191 | + echo wp_kses_post($play_button); |
|
| 192 | 192 | } else { |
| 193 | 193 | return $play_button; |
| 194 | 194 | } |
@@ -202,39 +202,39 @@ discard block |
||
| 202 | 202 | * @param array $group |
| 203 | 203 | * @return void |
| 204 | 204 | */ |
| 205 | -function lsx_health_plan_shortcode_exercise_button( $m, $content = true ) { |
|
| 206 | - $equipment_group = get_the_term_list( $m, 'equipment', '', ', ' ); |
|
| 207 | - $muscle_group = get_the_term_list( $m, 'muscle-group', '', ', ' ); |
|
| 205 | +function lsx_health_plan_shortcode_exercise_button($m, $content = true) { |
|
| 206 | + $equipment_group = get_the_term_list($m, 'equipment', '', ', '); |
|
| 207 | + $muscle_group = get_the_term_list($m, 'muscle-group', '', ', '); |
|
| 208 | 208 | $title = get_the_title(); |
| 209 | 209 | $lsx_hp = lsx_health_plan(); |
| 210 | - $button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>'; |
|
| 210 | + $button = '<a data-toggle="modal" href="#exercise-modal-' . $m . '" data-target="#exercise-modal-' . $m . '"></a>'; |
|
| 211 | 211 | |
| 212 | - if ( true === $content ) { |
|
| 212 | + if (true === $content) { |
|
| 213 | 213 | $content = get_the_content(); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $modal_body = ''; |
| 217 | - if ( $lsx_hp->frontend->gallery->has_gallery( $m ) ) { |
|
| 217 | + if ($lsx_hp->frontend->gallery->has_gallery($m)) { |
|
| 218 | 218 | $gallery_args = array( |
| 219 | 219 | 'css_class' => 'modal-slider', |
| 220 | 220 | ); |
| 221 | - $modal_body .= $lsx_hp->frontend->gallery->get_gallery( '', '', $gallery_args ); |
|
| 221 | + $modal_body .= $lsx_hp->frontend->gallery->get_gallery('', '', $gallery_args); |
|
| 222 | 222 | } else { |
| 223 | - $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail( $m, 'large' ) . '</div>'; |
|
| 223 | + $modal_body .= '<div class="modal-image">' . get_the_post_thumbnail($m, 'large') . '</div>'; |
|
| 224 | 224 | } |
| 225 | 225 | $modal_body .= '<div class="title-lined exercise-modal"><h5 class="modal-title">' . $title . '</h5>'; |
| 226 | 226 | |
| 227 | - if ( ! empty( $equipment_group ) ) { |
|
| 227 | + if ( ! empty($equipment_group)) { |
|
| 228 | 228 | $modal_body .= '<span class="equipment-terms">Equipment: ' . $equipment_group . '</span>'; |
| 229 | 229 | } |
| 230 | - if ( ! empty( $muscle_group ) ) { |
|
| 230 | + if ( ! empty($muscle_group)) { |
|
| 231 | 231 | $modal_body .= '<span class="muscle-terms">Muscle: ' . $muscle_group . '</span>'; |
| 232 | 232 | } |
| 233 | 233 | $modal_body .= '</div>'; |
| 234 | 234 | $modal_body .= $content; |
| 235 | - \lsx_health_plan\functions\register_modal( 'exercise-modal-' . $m, '', $modal_body ); |
|
| 235 | + \lsx_health_plan\functions\register_modal('exercise-modal-' . $m, '', $modal_body); |
|
| 236 | 236 | |
| 237 | - return ( $button ); |
|
| 237 | + return ($button); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -245,25 +245,25 @@ discard block |
||
| 245 | 245 | * @param boolean $echo |
| 246 | 246 | * @return string |
| 247 | 247 | */ |
| 248 | -function lsx_health_plan_exercise_title( $before = '', $after = '', $url = true, $echo = true, $exercise_id = false ) { |
|
| 249 | - if ( false === $exercise_id ) { |
|
| 248 | +function lsx_health_plan_exercise_title($before = '', $after = '', $url = true, $echo = true, $exercise_id = false) { |
|
| 249 | + if (false === $exercise_id) { |
|
| 250 | 250 | $exercise_id = get_the_ID(); |
| 251 | 251 | } |
| 252 | - $link = get_the_permalink( $exercise_id ); |
|
| 253 | - $title = get_the_title( $exercise_id ); |
|
| 254 | - $side = get_post_meta( $exercise_id, 'exercise_side', true ); |
|
| 255 | - if ( '' !== $side ) { |
|
| 256 | - $title .= ' - ' . ucwords( $side ); |
|
| 252 | + $link = get_the_permalink($exercise_id); |
|
| 253 | + $title = get_the_title($exercise_id); |
|
| 254 | + $side = get_post_meta($exercise_id, 'exercise_side', true); |
|
| 255 | + if ('' !== $side) { |
|
| 256 | + $title .= ' - ' . ucwords($side); |
|
| 257 | 257 | } |
| 258 | 258 | $link_before = ''; |
| 259 | 259 | $link_after = ''; |
| 260 | - if ( true === $url ) { |
|
| 260 | + if (true === $url) { |
|
| 261 | 261 | $link_before = '<a href="' . $link . '">'; |
| 262 | 262 | $link_after = '</a>'; |
| 263 | 263 | } |
| 264 | - $title = apply_filters( 'lsx_health_plan_exercise_title', $before . $link_before . $title . $link_after . $after, $title, $before, $after, $exercise_id ); |
|
| 265 | - if ( true === $echo ) { |
|
| 266 | - echo wp_kses_post( $title ); |
|
| 264 | + $title = apply_filters('lsx_health_plan_exercise_title', $before . $link_before . $title . $link_after . $after, $title, $before, $after, $exercise_id); |
|
| 265 | + if (true === $echo) { |
|
| 266 | + echo wp_kses_post($title); |
|
| 267 | 267 | } else { |
| 268 | 268 | return $title; |
| 269 | 269 | } |