WooCommerce::convert_woocommerce_slug()
Converts the WooCommerce slug to the correct slug for the current version. This ensures that when the plugin is installed in a different folder name, the correct slug is used so that dependent plugins can be installed/activated.
Method of the class: WooCommerce{}
No Hooks.
Return
String
.
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->convert_woocommerce_slug( $slug );
- $slug(string) (required)
- The plugin slug to convert.
Changelog
Since 9.0.0 | Introduced. |
WooCommerce::convert_woocommerce_slug() WooCommerce::convert woocommerce slug code WC 9.2.3
public function convert_woocommerce_slug( $slug ) { if ( 'woocommerce' === $slug ) { $slug = dirname( WC_PLUGIN_BASENAME ); } return $slug; }