Closed pareshsojitra closed 7 years ago
I've a similar problem but I've not set 'external_url' at all, but the source_type is 'repo' instead of 'bundled'.
I think the problem is because tgmpa work for plugins that are in repo, the index 'source' of the plugin, by default is set to 'repo', when you and me use the 'source' as plugin url.
These are the default arguments used when a plugin is registered within the tgmpa
'name' => '', // String
'slug' => '', // String
'source' => 'repo', // String
'required' => false, // Boolean
'version' => '', // String
'force_activation' => false, // Boolean
'force_deactivation' => false, // Boolean
'external_url' => '', // String
'is_callable' => '', // String|Array.
The source
index is used to define the type of the plugin: repo, bundled, external.
I think the source_type
is the correct one to use to define the type of the source instead of the source
index that can be used for plugin zip url.
I'm don't know the lib in deep, just made some test and if I change some line of code to switch from source
to source_type
the Source column show the right text.
Can you suggest me how to correct the code as themeforest says ?
I want to set internal URL & not external.
I think it's better to wait for a lib developer because the differences between 'source_type' and 'source' are not quite clear.
By the way, here the diff file. diff.txt
Hi @smpdesignmedia,
I haven't tested with your code yet, but would like to ask you to try this: remove the esc_url
from around the source
and change get_template_directory_uri()
to get_stylesheet_directory()
.
When you want to use a bundled plugin, you should provide TGMPA with the path to the plugin, not the URI.
The escaping is also not necessary as TGMPA will escape any variables used for output in the appropriate way when they are echo-ed out.
That should solve your issue.
As a side-note: The external_url
has nothing to do with whether a plugin is seen as internal or external, it just provides the link for when a user clicks on the plugin name to read more information about the plugin.
For more details about the configuration, have a look here: http://tgmpluginactivation.com/configuration/
@widoz Please don't change the keys in the array. You will break things ;-)
Hi,
Thank you so much for your answer, i have try this & its getting a source type as "Pre-Packaged", but there is one issue with it.
Its finding plugin in child theme because i have activated child theme, so i need to do to get plugin by main theme ? can you suggest me.
Thank you.
Hi,
I have used "get_template_directory()" without esc_url() & its resolved my issue.
Thank you so much for your suggestion.
@smpdesignmedia Glad to hear it worked! Thanks for letting us know.
Hi,
Themeforest says include third party-premium plugins in the download and install via TGM PA as pre-packaged.
I have already set zip packages in theme & here is my code.
tgm code.txt![screen shot 2017-06-27 at 18 52 56](https://user-images.githubusercontent.com/5764334/27673937-12b35128-5cc1-11e7-9921-4fcd20eb33a6.png)