mirror of
https://github.com/10h30/woo-viet.git
synced 2026-06-05 15:09:49 +09:00
@@ -109,6 +109,9 @@ class WooViet {
|
||||
if ( class_exists( 'WooCommerce' ) ) {
|
||||
// Run this plugin normally if WooCommerce is active
|
||||
$this->main();
|
||||
|
||||
// Add "Settings" link when the plugin is active
|
||||
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_settings_link' ) ) ;
|
||||
} else {
|
||||
// Throw a notice if WooCommerce is NOT active
|
||||
add_action( 'admin_notices', array( $this, 'notice_if_not_woocommerce' ) );
|
||||
@@ -224,4 +227,17 @@ class WooViet {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add "Settings" link in the Plugins list page when the plugin is active
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Longkt
|
||||
*/
|
||||
public function add_settings_link( $links ) {
|
||||
$settings = array( '<a href="' . admin_url( 'admin.php?page=woo-viet' ) . '">' . __( 'Settings', 'woo-viet' ) . '</a>' );
|
||||
$links = array_reverse( array_merge( $links, $settings ) );
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user