lightspeeddevelopment /
lsx-health-plan
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * Template used to display post content on widgets and archive pages. |
||||
| 4 | * |
||||
| 5 | * @package lsx-health-plan |
||||
| 6 | */ |
||||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||
| 7 | global $shortcode_args; |
||||
| 8 | |||||
| 9 | ?> |
||||
| 10 | |||||
| 11 | <?php lsx_entry_before(); ?> |
||||
| 12 | |||||
| 13 | <?php |
||||
| 14 | $content_setting = 'excerpt'; |
||||
| 15 | $column_class = '4'; |
||||
| 16 | $link_html = ''; |
||||
| 17 | $link_close = ''; |
||||
| 18 | |||||
| 19 | // Check for shortcode overrides. |
||||
| 20 | if ( null !== $shortcode_args ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 21 | if ( isset( $shortcode_args['columns'] ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 22 | $column_class = $shortcode_args['columns']; |
||||
| 23 | $column_class = \lsx_health_plan\functions\column_class( $column_class ); |
||||
| 24 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 25 | if ( isset( $shortcode_args['link'] ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 26 | $link_setting = $shortcode_args['link']; |
||||
| 27 | // Setup our link and content. |
||||
| 28 | switch ( $link_setting ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 29 | case 'single': |
||||
| 30 | $link_html = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">'; |
||||
|
0 ignored issues
–
show
Are you sure
get_permalink($group['connected_exercises']) of type false|string can be used in concatenation?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 31 | $link_close = '</a>'; |
||||
| 32 | break; |
||||
| 33 | |||||
| 34 | case 'modal': |
||||
| 35 | $link_html = '<a class="btn border-btn" data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">'; |
||||
| 36 | $link_close = '</a>'; |
||||
|
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. Loading history...
|
|||||
| 37 | $modal_content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_modal_content', 'excerpt' ); |
||||
| 38 | $modal_args = array( |
||||
| 39 | 'modal_content' => $modal_content_setting, |
||||
| 40 | ); |
||||
| 41 | // We call the button to register the modal, but we do not output it. |
||||
| 42 | lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
||||
| 43 | break; |
||||
| 44 | |||||
| 45 | case 'none': |
||||
| 46 | default: |
||||
| 47 | $link_html = ''; |
||||
| 48 | $link_close = ''; |
||||
| 49 | break; |
||||
| 50 | } |
||||
| 51 | } |
||||
|
0 ignored issues
–
show
|
|||||
| 52 | if ( isset( $shortcode_args['description'] ) ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 53 | $content_setting = $shortcode_args['description']; |
||||
| 54 | } |
||||
| 55 | } |
||||
| 56 | |||||
| 57 | ?> |
||||
| 58 | |||||
| 59 | <div class="col-xs-12 col-sm-6 col-md-<?php echo esc_attr( $column_class ); ?> has-content-<?php echo esc_attr( $content_setting ); ?>"> |
||||
| 60 | <article class="lsx-slot box-shadow"> |
||||
| 61 | <?php lsx_entry_top(); ?> |
||||
| 62 | |||||
| 63 | <div class="exercise-feature-img"> |
||||
| 64 | <a href="<?php echo esc_url( get_permalink() ); ?>"> |
||||
| 65 | <?php |
||||
| 66 | $featured_image = get_the_post_thumbnail(); |
||||
| 67 | if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
||||
| 68 | the_post_thumbnail( 'lsx-thumbnail-square', array( |
||||
| 69 | 'class' => 'aligncenter', |
||||
| 70 | ) ); |
||||
| 71 | } else { |
||||
| 72 | ?> |
||||
| 73 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
||||
| 74 | <?php |
||||
| 75 | } |
||||
| 76 | ?> |
||||
| 77 | </a> |
||||
| 78 | </div> |
||||
| 79 | <div class="content-box exercise-content-box white-bg"> |
||||
| 80 | <div class="title-lined"> |
||||
| 81 | <?php lsx_health_plan_exercise_title( '<h3 class="exercise-title">', '</h3>' ); ?> |
||||
| 82 | <?php lsx_health_plan_exercise_data(); ?> |
||||
| 83 | </div> |
||||
| 84 | <?php |
||||
| 85 | if ( '' !== $content_setting && 'excerpt' === $content_setting ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 86 | if ( ! has_excerpt() ) { |
||||
|
0 ignored issues
–
show
|
|||||
| 87 | $content = wp_trim_words( get_the_content(), 20 ); |
||||
| 88 | $content = '<p>' . $content . '</p>'; |
||||
| 89 | } else { |
||||
| 90 | $content = apply_filters( 'the_excerpt', get_the_excerpt() ); |
||||
| 91 | } |
||||
| 92 | echo wp_kses_post( $content ); |
||||
| 93 | } |
||||
| 94 | if ( '' !== $content_setting && 'full' === $content_setting ) { |
||||
| 95 | the_content(); |
||||
| 96 | } |
||||
| 97 | ?> |
||||
| 98 | <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn border-btn"><?php esc_html_e( 'See exercise', 'lsx-health-plan' ); ?></a> |
||||
| 99 | </div> |
||||
| 100 | <?php lsx_entry_bottom(); ?> |
||||
| 101 | </article> |
||||
| 102 | </div> |
||||
| 103 | |||||
| 104 | <?php |
||||
| 105 | lsx_entry_after(); |
||||
| 106 |