Skip to content

Instantly share code, notes, and snippets.

@jconroy
Last active July 15, 2020 13:24
Show Gist options
  • Save jconroy/b97289eb6ad2843feb15bfd1fba4196a to your computer and use it in GitHub Desktop.
Save jconroy/b97289eb6ad2843feb15bfd1fba4196a to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Add submenu item to WooCommerce Marketing Hub
*/
add_action('admin_menu', 'register_my_custom_submenu_page');
function register_my_custom_submenu_page() {
add_submenu_page(
'woocommerce-marketing',
'Coupon Generator',
'Coupon Generator',
'manage_woocommerce',
'coupon_generator',
function(){ echo('test'); }
);
}
add_filter( 'woocommerce_marketing_menu_items', function( $items ) {
$items[] = array(
'id' => 'woocommerce-marketing-test',
'title' => __( 'Test', 'woocommerce-admin' ),
'path' => '/marketing/test',
);
return $items;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment