astra_customizer_search_post_types_choices()
Get formatted live search post types.
Description
Return
(array)
Source
File: inc/extras.php
function astra_customizer_search_post_types_choices() { $all_post_types = astra_customizer_live_search_posttypes(); $post_type_choices = array(); foreach ( $all_post_types as $post_type ) { $post_type_object = get_post_type_object( $post_type ); /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $post_type_choices[ $post_type ] = ! empty( $post_type_object->labels->name ) ? $post_type_object->labels->name : $post_type; /** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } return $post_type_choices; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |