Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding a plugin parameter named is_callable #205

Merged
merged 2 commits into from
Jun 11, 2014

Conversation

zackkatz
Copy link
Contributor

@zackkatz zackkatz commented Jun 8, 2014

Here's a use case: Yoast's WordPress SEO Plugin and the Premium version. Mostly same plugin but different slugs. This allows you to say "no, the slug doesn't exist, but this function (or method) is callable, so the plugin must be active".

Here's the plugin array item passed to tgmpa():

array(
    'name'      => 'WordPress SEO by Yoast',
    'slug'      => 'wordpress-seo',
    'required'  => false,
    'is_callable' => 'wpseo_init',
)

If the wpseo_init() function exists, the WordPress SEO Premium plugin is still considered active, even the slug would normally be wordpress-seo-premium. This makes it possible to add some basic logic outside slug names.

Here's a use case: Yoast's WordPress SEO Plugin and the Premium version. Mostly same plugin but different slugs. This allows you to say "no, the slug doesn't exist, but this function (or method) is callable, so the plugin must be active".

Here's the plugin array item passed to `tgmpa()`: 

``
array(
    'name'      => 'WordPress SEO by Yoast',
    'slug'      => 'wordpress-seo',
    'required'  => false,
    'is_callable' => 'wpseo_init',
)
``

If the `wpseo_init()` function exists, the plugin's still considered active.
thomasgriffin added a commit that referenced this pull request Jun 11, 2014
Allow adding a plugin parameter named `is_callable`
@thomasgriffin thomasgriffin merged commit a307067 into TGMPA:master Jun 11, 2014
@thomasgriffin
Copy link
Contributor

I dig it - thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants