Hi,
What’s your use case for your multi-site deployment?
Each new site in a multisite needs to be initialised so the software can run. You could write a little function to auto-initialise when a new subsite is created.
If the software isn’t needed on the sub sites you should disable network activation and only enable it on sites you need.
Alternatively, it should be possible to disable the notification by removing the filter used (one of three different types). See /pdf.php line 313 for details on which notice type is being set.
Hey, thanks for the quick response.
My use case is that users sometimes need pdf versions of their forms.
Not sure how to remove the filter as deleting this gives white screen. Is it possible to simply add the notifications inside super admin brackets or something?
I dont mind the notifications and find them useful but I think they might be confusing to my users just signing up as “Gravity PDF Auto Initialisation Complete.” notification on dashboard gives them no value since I dont let them access PDF settings.
/*
* Check if the software needs to be deployed/redeployed
*/
public static function check_deployment()
{
global $gfpdfe_data;
/*
* Check if client is using the automated installer
* If installer has issues or client cannot use auto installer (using FTP/SSH ect) then run the usual
* initialisation messages.
*/
if($gfpdfe_data->automated === true && $gfpdfe_data->fresh_install === true & get_option('gfpdfe_automated_install') != 'installing')
{
return;
}
/*
* Check if GF PDF Extended is correctly installed. If not we'll run the installer.
*/
$theme_switch = get_option('gfpdfe_switch_theme');
if( get_option('gf_pdf_extended_installed') != 'installed' && !rgpost('upgrade') )
{
/*
* Prompt user to initialise plugin
*/
add_action($gfpdfe_data->notice_type, array("GFPDF_Notices", "gf_pdf_not_deployed_fresh"));
}
elseif( (
( !is_dir($gfpdfe_data->template_site_location)) ||
( !file_exists($gfpdfe_data->template_site_location . 'configuration.php') ) ||
( !is_dir($gfpdfe_data->template_save_location) )
)
&& (!rgpost('upgrade'))
&& (!is_dir($gfpdfe_data->old_template_location)
&& (!is_dir($gfpdfe_data->old_3_6_template_site_location)) ) /* add in 3.6 directory change */
)
{
/*
* Prompt user that a problem was detected and they need to redeploy
*/
add_action($gfpdfe_data->notice_type, array("GFPDF_Notices", "gf_pdf_problem_detected"));
}
}
You can’t delete the whole function. Plus modifying the core plugin will mean when you update those changes you made will be removed.
You will want to drop something like this as a mu-plugin (or wrap it in a plugin and network activate it). Note I haven’t tested it so it may need some tweaking to function as you need it:
add_action('admin_notices', 'remove_gfpdf_notice', 1);
function remove_gfpdf_notice() {
global $gfpdfe_data;
if(!is_super_admin()) {
remove_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_success'));
}
}
Your function worked perfect, thank you so much 🙂