Closed cfoellmann closed 11 years ago
I tried it and found 2 way to do it:
set_plugin_meta
function outside the class, then call add_filter
like you did. (So add the snippet after the add_action('widgets_init', [...]);
line)set_plugin_meta
as a class method, then add this add_filter('plugin_row_meta', array(&$this, 'set_plugin_meta'), 10, 2);
in the __construct()
method (a.k.a. the object constructor). The difference is array(&$this, 'set_plugin_meta')
, this tells PHP to call the set_plugin_meta
method of the $this
object, that is the current object.I'm a PHP newbie too so I may be wrong, but it worked :D
If you want to see just the change this is the commit, I added a link to the issues page. https://github.com/fracek/better-github-widget/commit/223e0f3f2ee74742b088fde421b4c3e3554c346c
I am not sure what the problem is but it is not working for me. The first way exactly what I did and something is blocking it on my installation. Your implementation is not working either.
I don't know what it is, can you read the php logs on your system? They might help us.
No errors there. I even cranked up the log level to the max. Nothing. What WP version are you using? I am on 3.5
On other plugins its working :-1:
After a bit of trial and error I noticed you need to activate the plugin to view the additional links with our plugin and "Wp-Piwik", somehow "WordPress HTTPS" displays it even when not active. I'm gonna investigate this.
The WordPress HTTPS code is here on GitHub: https://github.com/Mvied/wordpress-https I can ask @Mvied . He is pretty nice, too. :-) (now he gets a notification)
He is using his own "framework" maybe that could help figure it out. https://github.com/Mvied/mvied
BTW can you confirm that it works when you activate it? One thing less to worry about :smiley:
Yes, after activation it is displayed. But I do not think that is a good thing.
if you like, you can send me an IM address via email to foellmann@foe-services.de, ICQ, Facebook, Skype
I'm leaving this issue open until we can display the links even if the plugin is not active.
Having this same issue as @cfoellmann commented on my plugin. Maybe this is on purpose? Perhaps it makes sense not to see the links if someone didn't activate the plugin. I deactivated other plugins on one of my blogs which also use meta links, and their links are not working either.
I dont know if you know https://github.com/Mvied/wordpress-https but maybe you can test it. It is providing meta links while deactivated
I can't reliably get my plugin to show the meta links while deactivated. Are you using a multisite installation? On a multisite, if the plugin is enabled for any site, it seems to make the meta links show up.
@Mvied I have a WP 3.5 multisite and your plugin is displaying all the additional links in activated and deactivated state.
Is it deactivated on every site?
I did a complete deactivation and I now see that all of you are right. All meta links are only displayed when the plugin is activated. :disappointed:
It seems strange that it does that. Do other plugins do that as well or is it because of the way I coded it?
https://github.com/Mvied/wordpress-https/blob/master/lib/WordPressHTTPS/Module/Admin.php#L22 https://github.com/Mvied/wordpress-https/blob/master/lib/WordPressHTTPS/Module/Admin.php#L62
It seems to be the case for all plugins. The hook might have this limitation. Nothing about it on the WordPress Trac though
Mystery solved then :neckbeard:
I'll close this issue because it's more a WP issue than mine.
@fracek I hope you can help me. I am one step away from a complete meltdown :imp:
This site seems to be the "main" reference for the hook: http://wpengineer.com/1295/meta-links-for-wordpress-plugins/
and I would like to implement this code example:
I thought: Learning by doing. Lets get a little better at PHP - after trying and reading... nothing. OOP seems to be devils work for a non-programmer.