wp_plugin_dependencies_slug хук-фильтрWC 9.0.0

Это хук WordPress - wp_plugin_dependencies_slug. Плагин его просто использует.

Filters a plugin dependency’s slug before matching to the WordPress.org slug format.

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

add_filter( 'wp_plugin_dependencies_slug', 'wp_kama_plugin_dependencies_slug_filter' );

/**
 * Function for `wp_plugin_dependencies_slug` filter-hook.
 * 
 * @param string $slug The slug.
 *
 * @return string
 */
function wp_kama_plugin_dependencies_slug_filter( $slug ){

	// filter...
	return $slug;
}
$slug(строка)
The slug.

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

С версии 9.0.0 Введена.

Где вызывается хук

PluginVersionRuleProcessor::process()
wp_plugin_dependencies_slug
Init::get_installed_wp_org_plugins()
wp_plugin_dependencies_slug
woocommerce/src/Admin/RemoteSpecs/RuleProcessors/PluginVersionRuleProcessor.php 55
$plugin_name = apply_filters( 'wp_plugin_dependencies_slug', $rule->plugin );
woocommerce/src/Admin/Features/Blueprint/Init.php 276
$slug = apply_filters( 'wp_plugin_dependencies_slug', $slug ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment

Где используется хук в WooCommerce

woocommerce/includes/class-woocommerce.php 333
add_filter( 'wp_plugin_dependencies_slug', array( $this, 'convert_woocommerce_slug' ) );