WC_Template_Loader::unsupported_theme_title_filter()
Filter the title and insert WooCommerce content on the shop page.
For non-WC themes, this will setup the main shop page to be shortcode based to improve default appearance.
Метод класса: WC_Template_Loader{}
Хуков нет.
Возвращает
Строку
.
Использование
$result = WC_Template_Loader::unsupported_theme_title_filter( $title, $id );
- $title(строка) (обязательный)
- Existing title.
- $id(int) (обязательный)
- ID of the post being filtered.
Список изменений
С версии 3.3.0 | Введена. |
Код WC_Template_Loader::unsupported_theme_title_filter() WC Template Loader::unsupported theme title filter WC 8.7.0
public static function unsupported_theme_title_filter( $title, $id ) { if ( self::$theme_support || ! $id !== self::$shop_page_id ) { return $title; } if ( is_page( self::$shop_page_id ) || ( is_home() && 'page' === get_option( 'show_on_front' ) && absint( get_option( 'page_on_front' ) ) === self::$shop_page_id ) ) { $args = self::get_current_shop_view_args(); $title_suffix = array(); if ( $args->page > 1 ) { /* translators: %d: Page number. */ $title_suffix[] = sprintf( esc_html__( 'Page %d', 'woocommerce' ), $args->page ); } if ( $title_suffix ) { $title = $title . ' – ' . implode( ', ', $title_suffix ); } } return $title; }