Yoast_Plugin_Conflict::check_for_conflicts()publicYoast 1.0

Check if there are conflicting plugins for given $plugin_section.

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

Хуков нет.

Возвращает

true|false.

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

$Yoast_Plugin_Conflict = new Yoast_Plugin_Conflict();
$Yoast_Plugin_Conflict->check_for_conflicts( $plugin_section );
$plugin_section(строка) (обязательный)
Type of plugin conflict (such as Open Graph or sitemap).

Код Yoast_Plugin_Conflict::check_for_conflicts() Yoast 22.4

public function check_for_conflicts( $plugin_section ) {

	static $sections_checked;

	// Return early if there are no active conflicting plugins at all.
	if ( empty( $this->active_conflicting_plugins ) ) {
		return false;
	}

	if ( $sections_checked === null ) {
		$sections_checked = [];
	}

	if ( ! in_array( $plugin_section, $sections_checked, true ) ) {
		$sections_checked[] = $plugin_section;
		return ( ! empty( $this->active_conflicting_plugins[ $plugin_section ] ) );
	}

	return false;
}