Alphabet.php
2 weeks ago
BackToTop.php
2 weeks ago
ColumnGap.php
2 weeks ago
ColumnWidth.php
2 weeks ago
Columns.php
2 weeks ago
CssLengthCommon.php
2 weeks ago
ExcludePosts.php
2 weeks ago
ExcludeTerms.php
2 weeks ago
GroupBy.php
2 weeks ago
HideEmptyTerms.php
2 weeks ago
HideEmpty_Deprecated.php
2 weeks ago
InstanceId.php
2 weeks ago
ParentPost.php
2 weeks ago
ParentTermCommon.php
2 weeks ago
ParentTermId.php
2 weeks ago
ParentTermSlugOrId.php
2 weeks ago
PostType.php
2 weeks ago
PostsTerms.php
2 weeks ago
SymbolsFirst.php
2 weeks ago
Taxonomy.php
2 weeks ago
TermsCommon.php
2 weeks ago
TermsTerms.php
2 weeks ago
HideEmpty_Deprecated.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Deprecated Hide Empty Terms Query Part. |
| 4 | * |
| 5 | * @package alphalisting |
| 6 | */ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace eslin87\AlphaListing\Shortcode\QueryParts; |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Deprecated Hide Empty Terms Query Part extension. |
| 18 | * |
| 19 | * Handles the legacy `hide-empty` attribute. The behavior is identical to |
| 20 | * `hide-empty-terms`, so only the attribute name differs. |
| 21 | * |
| 22 | * @since 4.0.0 deprecated in favor of the `hide-empty-terms` attribute. |
| 23 | */ |
| 24 | class HideEmpty_Deprecated extends HideEmptyTerms { |
| 25 | /** |
| 26 | * The attribute for this Query Part. |
| 27 | * |
| 28 | * @since 4.0.0 |
| 29 | * @var string |
| 30 | */ |
| 31 | public $attribute_name = 'hide-empty'; |
| 32 | |
| 33 | /** |
| 34 | * Update the query with this extension's additional configuration. |
| 35 | * |
| 36 | * @param \eslin87\AlphaListing\Query $query The query. |
| 37 | * @param string $display The display/query type. |
| 38 | * @param string $key The name of the attribute. |
| 39 | * @param mixed $value The shortcode attribute value. |
| 40 | * @param array $attributes The complete set of shortcode attributes. |
| 41 | * @return mixed The updated query. |
| 42 | */ |
| 43 | public function shortcode_query_for_display_and_attribute( $query, string $display, string $key, $value, array $attributes ) { |
| 44 | _deprecated_argument( 'hide-empty', '4.0.0', 'Use the hide-empty-terms attribute instead.' ); |
| 45 | |
| 46 | return parent::shortcode_query_for_display_and_attribute( $query, $display, $key, $value, $attributes ); |
| 47 | } |
| 48 | } |
| 49 |