Yoast_Plugin_Conflict::get_conflicting_plugins_as_string()publicYoast 1.0

Устарела с версии 7.7. Больше не поддерживается и может быть удалена. Используйте d and will be removed in future.

Getting all the conflicting plugins and return them as a string.

This method will loop through all conflicting plugins to get the details of each plugin. The plugin name will be taken from the details to parse a comma separated string, which can be use for by example a notice

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

Хуков нет.

Возвращает

Строку.

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

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

Список изменений

Устарела с 17.7 This method is unused and will be removed in the future

Код Yoast_Plugin_Conflict::get_conflicting_plugins_as_string() Yoast 19.11

public function get_conflicting_plugins_as_string( $plugin_section ) {
	if ( ! \function_exists( 'get_plugin_data' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	// Getting the active plugins by given section.
	$plugins = $this->active_conflicting_plugins[ $plugin_section ];

	$plugin_names = [];
	foreach ( $plugins as $plugin ) {
		$name = $this->get_plugin_name( $plugin );
		if ( ! empty( $name ) ) {
			$plugin_names[] = '<em>' . $name . '</em>';
		}
	}
	unset( $plugins, $plugin );

	if ( ! empty( $plugin_names ) ) {
		return \implode( ' &amp; ', $plugin_names );
	}
}