WPSEO_Post_Type::filter_attachment_post_type
Filters the attachment post type from an array with post_types.
Метод класса: WPSEO_Post_Type{}
Хуков нет.
Возвращает
Массив. The filtered array.
Использование
$result = WPSEO_Post_Type::filter_attachment_post_type( $post_types );
- $post_types(массив) (обязательный)
- The array to filter the attachment post type from.
Код WPSEO_Post_Type::filter_attachment_post_type() WPSEO Post Type::filter attachment post type Yoast 27.6
public static function filter_attachment_post_type( array $post_types ) {
if ( WPSEO_Options::get( 'disable-attachment' ) === true ) {
unset( $post_types['attachment'] );
}
return $post_types;
}