1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2024-12-22 20:03:53 +02:00

Fix $plugin_basename to allow plugin_action_links

With the move to /admin and /public directory, the class-plugin-name-admin.php needed to be changed to use __DIR__ instead of __FILE__ to create the $plugin_basename, otherwise the hook would be something like plugin_action_links_plugin-name/admin/plugin-name.php which doesn't work.
This commit is contained in:
Silvan Hagen 2013-11-04 16:26:19 +01:00
parent ae381619d4
commit f844d0a075

View file

@ -68,7 +68,7 @@ class Plugin_Name_Admin {
add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
// Add an action link pointing to the options page.
$plugin_basename = plugin_basename( plugin_dir_path( __FILE__ ) . $this->plugin_slug . '.php' );
$plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_slug . '.php' );
add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
/*