-
Notifications
You must be signed in to change notification settings - Fork 218
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
Creating custom extension through Plugin #394
Comments
Create directory function _wdm_filter_my_plugin_extensions($locations) {
$locations[dirname(__FILE__) . '/extensions']
=
plugin_dir_url( __FILE__ ) . 'extensions';
return $locations;
}
add_filter('fw_extensions_locations', '_wdm_filter_my_plugin_extensions'); |
Thank you. This works well. I have one doubt. If I add extension through plugin, will it be visible in Unyson 'Available' / 'Active' extension list. Currently, it is not visible. If plugin is active, it gets activated automatically. I have added following properties, $manifest['display'] = true; $manifest['standalone'] = true; in manifest file. |
Sorry, at the moment no (I forgot about that). I am fixing this right now. |
Please download the latest Unyson dev version, extract in |
P.S. To set extension image, add this in manifest $manifest['thumbnail'] = '//placehold.it/256x256&text=hello'; |
Hi @moldcraft It showed: Fatal error: Call to undefined function fw_ext_feedback_stars_get_post_rating() in /plugins/ht-recipes/extensions/recipes/views/single.php on line 124 Any suggestions? |
Before calling any extension function, first you need to check if it is enabled/exists if (fw_ext('extension_name')) {
fw_ext_extension_name_whaterver_function();
} |
Thanks for your help! |
Hi, Sorry for the delay. I checked with new version, it works well. Great !! |
Hi, I'm just about to implement this so my shortcodes are in a plugin rather than the framework-customizations folder. When I submit my theme to ThemeForest would I just include the plugin with the theme and let the user install my plugin when setting up the theme or must the plugin be hosted with WordPress.org in their plugin directory? Thanks |
Included |
Thanks |
Is there anyway I can have more than one plugin with shortcodes? I'm wanting to have one plugin which contains core shortcodes which I'm going to reuse on each theme. I then want another plugin with theme specific shortcodes tailored to the themes genre. As far as I'm aware I can't use the Is there a way I can achieve this? |
You can use the filter how much you want, in any plugin you want (No limits/restrictions) For e.g. you can have multiple directories with extensions in the same plugin: function _filter_{plugin-id}_extensions($locations) {
$locations[ dirname(__FILE__) . '/core-extensions' ]
= plugin_dir_url( __FILE__ ) . 'core-extensions';
$locations[ dirname(__FILE__) . '/theme-extensions' ]
= plugin_dir_url( __FILE__ ) . 'theme-extensions';
return $locations;
}
add_filter('fw_extensions_locations', '_filter_{plugin-id}_extensions'); |
Hi, It seems we can only declare shortcodes in one extension at a time, if loaded from the plugins. Example: we have a plugin which loads one extension name 'our-core' and also shortcodes ( 'our-core-shorcode' ) Now lets create another plugin and load another extension name 'our-core-secondary' and also shortcodes ( 'our-core-secondary-shortcode' ) Both extensions are being loaded via two different plugins but only one will support shortcodes. not both? Unless the extension name is the same. How can we have multiple plugins with its own extensions and its own shortcodes, as it seems only one plugin can support shortcodes at a time, the second is simply ignored for shorcodes. Any help is appreciated @moldcraft |
@Shahab2905 I created 2 plugins with one shortcode in each, everything works fine You can test the plugins on your side |
@moldcraft Thank you, Indeed its is working. I will look into my code again and see whats been done wrong. |
Hi,
I have created plugin with following structure,
<plugin_folder_name>/framework-customizations/extensions/<extension_name>
I have added below code in main plugin file,
If I add extension, in theme 'extensions' folder, it worked well.
Can you please give a step by step approach for creating extension via a plugin?
The text was updated successfully, but these errors were encountered: