WPSEO_Meta_Columns::set_post_type_hooks()privateYoast 1.0

Sets up the hooks for the post_types.

Метод класса: WPSEO_Meta_Columns{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->set_post_type_hooks();

Код WPSEO_Meta_Columns::set_post_type_hooks() Yoast 22.3

private function set_post_type_hooks() {
	$post_types = WPSEO_Post_Type::get_accessible_post_types();

	if ( ! is_array( $post_types ) || $post_types === [] ) {
		return;
	}

	foreach ( $post_types as $post_type ) {
		if ( $this->display_metabox( $post_type ) === false ) {
			continue;
		}

		add_filter( 'manage_' . $post_type . '_posts_columns', [ $this, 'column_heading' ], 10, 1 );
		add_action( 'manage_' . $post_type . '_posts_custom_column', [ $this, 'column_content' ], 10, 2 );
		add_action( 'manage_edit-' . $post_type . '_sortable_columns', [ $this, 'column_sort' ], 10, 2 );
	}

	unset( $post_type );
}