Override an action using a plugin.
-
Hi,
Not sure if this is the place to ask but here goes.
I have WP e-Commerce and wish to override a add menu function they have in it using my own code.
I already know how to do this and what code to use. My issue now is that by editing the original file in the plugin, if I update WPEC then I need to make that edit again.
Is there a way to override or replace it with my own using another plugin?
I want to write a plugin that makes the change I am needing so that I can update WPEC and all should be good until they change the code I replace.
Also new to writing plugins so I would prefer to be pointed in the right direction if its possible so I can learn for myself how to do it.
PS: the code I am wanting to change is this:
$page_hooks[] = $purchase_log_page = add_submenu_page( ‘index.php’, __( ‘Store Sales’, ‘wpsc’ ), __( ‘Store Sales’, ‘wpsc’ ), ‘administrator’, ‘wpsc-sales-logs’, ‘wpsc_display_sales_logs’ );
to this:
$page_hooks[] = $purchase_log_page = add_submenu_page( ‘index.php’, __( ‘Store Sales’, ‘wpsc’ ), __( ‘Store Sales’, ‘wpsc’ ), ‘wpsc_sales_logs’, ‘wpsc-sales-logs’, ‘wpsc_display_sales_logs’ );
Its a simple change that works the way I need it to, but I have to start somewhere with plugin writing right.
The topic ‘Override an action using a plugin.’ is closed to new replies.