mirror of
https://github.com/10h30/woo-viet.git
synced 2026-07-11 18:56:13 +09:00
@@ -109,6 +109,9 @@ class WooViet {
|
|||||||
if ( class_exists( 'WooCommerce' ) ) {
|
if ( class_exists( 'WooCommerce' ) ) {
|
||||||
// Run this plugin normally if WooCommerce is active
|
// Run this plugin normally if WooCommerce is active
|
||||||
$this->main();
|
$this->main();
|
||||||
|
|
||||||
|
// Add "Settings" link when the plugin is active
|
||||||
|
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_settings_link' ) ) ;
|
||||||
} else {
|
} else {
|
||||||
// Throw a notice if WooCommerce is NOT active
|
// Throw a notice if WooCommerce is NOT active
|
||||||
add_action( 'admin_notices', array( $this, 'notice_if_not_woocommerce' ) );
|
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