Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › How to modify 'Install Required Plugins' functionality?
New Landing › How can we help? › Cardinal › How to modify 'Install Required Plugins' functionality?
- This topic has 20 replies, 7 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Cardinal
-
September 3, 2014 at 1:21 pm #106703
Hi,
I am wondering if its possible to make ‘permanent’ modifications to the ‘Install Required Plugins’ functionality?
It appears the plugin being used is from http://tgmpluginactivation.com/ and the main file in question would appear to be:
wp-content/themes/cardinal/includes/plugin-includes.phpMy main questions are:
#1. How to permanently disable the pop up message that appears at the top of every admin dashboard page every-time you enable the Cardinal theme; it states ‘This theme recommends the following plugin…’ etc.?
#2. Would it be possible to modify the plugin-includes.php file and place it in my child theme so it is not overwritten on theme updates? I want to include a few of my own ‘required plugins’ and maybe remove a few that Cardinal recommends…
I created an ‘includes’ folder in my child theme and then placed the modified plugin-includes.php file in there, but it doesn’t seem to be work…
#3. How/where could I edit the following text at the top of the install plugins page?
Please Read! The plugins below are plugins that we either provide as premium plugins that are bundled with the theme, or plugins that we recommend in order to take advantage of theme functionality. In all cases if you don't need a certain plugin, or aren't sure, then please do not install/activate them - until you decide they are needed. Installing more plugins than you need will likely slow your site down. For example, unless you really need to, then we'd recommend only installing one or two (maximum) of the slider plugins. Once you've installed a plugin, you'll need to also click the "Activate" link, and then reload the browser to see the plugin's menu.
Its not in the plugin-includes.php file…
Any advice would be appreciated.
Thanks.
September 4, 2014 at 12:23 am #106879Hi,
For #1 You can add this to remove the notice permanently
add_filter( 'get_user_metadata', function_disableNotice, 10, 4 ); function function_disableNotice ($val, $object_id, $meta_key, $single) { if($meta_key === 'tgmpa_dismissed_notice') { return true; } else { return null; } }
For #2
If you put that in the child theme means, you need to comment this in the functions.php
include_once(SF_INCLUDES_PATH . '/plugin-includes.php');
and change that to
include_once(STYLESHEETPATH . '/includes/plugin-includes.php');
For #3
It can be found in this file, \wp-content\themes\cardinal\includes\class-tgm-plugin-activation.php
Let us know,
Thanks,
laranz.September 4, 2014 at 9:03 am #106985Hi laranz,
Thank you for the feedback.
#1. Worked nicely.
#2. This doesn’t work: Following your directions, I put the following into functions.php file:
/* include_once(SF_INCLUDES_PATH . '/plugin-includes.php'); */ include_once(STYLESHEETPATH . '/includes/plugin-includes.php');
That breaks the website…
Also, that wouldn’t really be an ideal solution as every time I upgrade the theme, those changes would be overwritten?
For what its worth, the path to the plugin includes file within my child theme would be:
wp-content/themes/cardinal-child/includes/plugin-includes.php#3. Found the text within that file, thanks.
September 4, 2014 at 11:25 am #107039Hi
Unfortunately that file can’t be overwritten in the child theme, if you wanted to make that change, you would need to do so each time you update the theme
– Kyle
September 4, 2014 at 11:28 am #107042Ok, thats fine.
But as I said above, the suggested change in the functions.php breaks the site…
September 4, 2014 at 11:33 am #107045Instead try:
include_once(SF_TEMPLATE_PATH . '/plugin-includes.php');
– Kyle
September 4, 2014 at 11:37 am #107048This reply has been marked as private.September 4, 2014 at 5:35 pm #107147Hi,
The since step 2 must be reverted and to solve that warning, the include line should stay like it was at first place.
include_once(SF_INCLUDES_PATH . '/plugin-includes.php');
because the file is located at cardinal/includes/plugin-includes.php
Thanks.
-Rui
September 4, 2014 at 5:59 pm #107150Sorry,
Not sure what you mean. Can you explain exactly what I need to do?
Thanks.
September 4, 2014 at 6:09 pm #107154In the functions.php of your theme in line 41 where the error you showed above is being triggered.
Replace that current line that i suppose is like this one bellow
include_once(SF_TEMPLATE_PATH . '/plugin-includes.php');
by this one
include_once(SF_INCLUDES_PATH . '/plugin-includes.php');
-Rui
September 4, 2014 at 6:33 pm #107158That removes the error, but does not achieve what I asked above.
I want to create an altered plugin-includes.php file and place it in my child theme so that it is not overwritten on theme updates. Are you saying that is not possible and I need to directly edit that file in the main theme directory?
September 4, 2014 at 6:38 pm #107160That was only to remove the error.
Not everything is suitable to overwrite in a child theme.In this case this is a part of the framework of our theme that is not suitable to be overwritten.
Only if we have an option to control if that is displayed or not in the theme.The other workaround is replace the file in each theme update.
-Rui
September 4, 2014 at 6:40 pm #107161That is no problem; but why was laranz – SUPPORT giving me directions that you are saying is not possible?
September 4, 2014 at 10:20 pm #107201Hi Anthony,
It should probably be this instead:
include_once(get_stylesheet_directory() . '/includes/plugin-includes.php');
Laranz was correct apart from the STYLESHEET definition probably isn’t defined.
– Ed
September 5, 2014 at 10:19 am #107361Would it be possible to include an option to remove / turn this off? Permanently, or by role. Admin could see it, but it makes no sense to let other users see this.
I like the idea of being able to update the theme without manual edit of the code afterwards.
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.