| @@ -1,22 +1,27 @@ | ||
| 1 | 1 | <?php |
| 2 | - if ( ! $show_button ) { | |
| 3 | - return; | |
| 4 | - } | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 5 | 3 | |
| 6 | - $show_button_icon = isset( $show_button_icon ) ? $show_button_icon : false; | |
| 7 | - $button_icon_position = isset( $button_icon_position ) ? $button_icon_position : ''; | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | +if ( ! $show_button ) { | |
| 8 | + return; | |
| 9 | +} | |
| 10 | + | |
| 11 | + $show_button_icon = isset( $show_button_icon ) ? $show_button_icon : false; | |
| 12 | + $button_icon_position = isset( $button_icon_position ) ? $button_icon_position : ''; | |
| 8 | 13 | ?> |
| 9 | 14 | |
| 10 | -<a class="docs-cat-link-btn betterdocs-category-link-btn" href="<?php esc_attr_e( esc_url( $permalink ) );?>"> | |
| 11 | - <?php | |
| 12 | - if ( $show_button_icon && ( $button_icon_position === 'before' || $button_icon_position === 'left' ) ) { | |
| 13 | - betterdocs()->template_helper->icon( $button_icon, true ); | |
| 14 | - } | |
| 15 | +<a class="docs-cat-link-btn betterdocs-category-link-btn" href="<?php echo esc_attr( esc_url( $permalink ) ); ?>"> | |
| 16 | + <?php | |
| 17 | + if ( $show_button_icon && ( $button_icon_position === 'before' || $button_icon_position === 'left' ) ) { | |
| 18 | + betterdocs()->template_helper->icon( $button_icon, true ); | |
| 19 | + } | |
| 15 | 20 | |
| 16 | - echo wp_kses_post( $button_text ); | |
| 21 | + echo wp_kses_post( $button_text ); | |
| 17 | 22 | |
| 18 | - if ( $show_button_icon && ( $button_icon_position === 'after' || $button_icon_position === 'right' ) ) { | |
| 19 | - betterdocs()->template_helper->icon( $button_icon, true ); | |
| 20 | - } | |
| 21 | - ?> | |
| 23 | + if ( $show_button_icon && ( $button_icon_position === 'after' || $button_icon_position === 'right' ) ) { | |
| 24 | + betterdocs()->template_helper->icon( $button_icon, true ); | |
| 25 | + } | |
| 26 | + ?> | |
| 22 | 27 | </a> |