| Line | |
|---|
| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Item title template. |
|---|
| 4 | * |
|---|
| 5 | * @var $args |
|---|
| 6 | * @var $opts |
|---|
| 7 | * @var $allow_links |
|---|
| 8 | * |
|---|
| 9 | * @package visual-portfolio |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
|---|
| 13 | |
|---|
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
|---|
| 15 | exit; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | if ( ! $opts['show_title'] || ! $args['title'] ) { |
|---|
| 19 | return; |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | $title_tag = $opts['title_tag'] ?? 'h2'; |
|---|
| 23 | $allow_links = isset( $allow_links ) ? $allow_links : false; |
|---|
| 24 | $link_data = array( |
|---|
| 25 | 'href' => $allow_links ? $args['url'] : false, |
|---|
| 26 | 'target' => $args['url_target'], |
|---|
| 27 | 'rel' => $args['url_rel'], |
|---|
| 28 | ); |
|---|
| 29 | |
|---|
| 30 | ?> |
|---|
| 31 | |
|---|
| 32 | <<?php echo tag_escape( $title_tag ); ?> class="vp-portfolio__item-meta-title"> |
|---|
| 33 | <?php |
|---|
| 34 | visual_portfolio()->include_template( 'global/link-start', $link_data ); |
|---|
| 35 | echo wp_kses_post( $args['title'] ); |
|---|
| 36 | visual_portfolio()->include_template( 'global/link-end', $link_data ); |
|---|
| 37 | ?> |
|---|
| 38 | </<?php echo tag_escape( $title_tag ); ?>> |
|---|
Note: See
TracBrowser
for help on using the repository browser.