Skip to main content

PHP Actions

ShopWP comes with action hooks that can be used to customize the plugin. Simply add these to your WordPress theme's functions.php file.

shopwp_breadcrumbs

Allows you to customize the ShopWP breadcrumbs execution.

Examples

// Remove ShopWP breadcrumbs
$Templates = ShopWP\Factories\Templates_Factory::build();

remove_action('shopwp_breadcrumbs', [$Templates, 'shopwp_breadcrumbs']);

shopwp_on_plugin_activate

Allows you to run code when ShopWP is activated

Examples

add_action('shopwp_on_plugin_activate', function() {
error_log('Plugin is activated!');
});

shopwp_on_plugin_deactivate

Allows you to run code when ShopWP is deactivated

Examples

add_action('shopwp_on_plugin_deactivate', function() {
error_log('Plugin is deactivated!');
});