WPSEO_Capability_Manager_WP::add()publicYoast 1.0

Adds the capabilities to the roles.

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

Хуков нет.

Возвращает

null. Ничего.

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

$WPSEO_Capability_Manager_WP = new WPSEO_Capability_Manager_WP();
$WPSEO_Capability_Manager_WP->add();

Код WPSEO_Capability_Manager_WP::add() Yoast 19.11

public function add() {
	foreach ( $this->capabilities as $capability => $roles ) {
		$filtered_roles = $this->filter_roles( $capability, $roles );

		$wp_roles = $this->get_wp_roles( $filtered_roles );
		foreach ( $wp_roles as $wp_role ) {
			$wp_role->add_cap( $capability );
		}
	}
}