DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.67k stars 2.25k forks source link

Plugin action link not being added? #108

Closed slobodan closed 10 years ago

slobodan commented 10 years ago
// Add an action link pointing to the options page.
$plugin_basename = plugin_basename( plugin_dir_path( __FILE__ ) . $this->plugin_slug . '.php' );
add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );

In class-plugin-name-admin.php, this makes $plugin_basename = 'plugin-name/admin/plugin-name.php'

Seems to work fine with plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_slug . '.php' ), has anyone else tried adding action links since admin class was created?

grappler commented 10 years ago

The problem is not the change to a separate class but moving the admin class to the admin directory.

It should be $plugin_basename = 'plugin-name/plugin-name.php'

I do understand the directory functions well enough to give a solution. @GaryJones Can you come to the rescue?

slobodan commented 10 years ago

Yeah, that's what I meant, new class and moving to new directory happened at the same time.

Why not just use $this->plugin_slug . '/' . $this->plugin_slug . '.php'?

tommcfarlin commented 10 years ago

Assigning this to 2.6.1.

grappler commented 10 years ago

This PR should have fixed this. https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/116

tommcfarlin commented 10 years ago

Closing this ticket because of the pull request. If the problem still exists, feel free to re-open the ticket.