setAdminNotice() public static method

Sets an admin notice.
Since: 3.5.0
public static setAdminNotice ( $sMessage, $sClassAttribute = 'error' ) : void
return void
コード例 #1
0
// Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file.
if (!defined('ABSPATH')) {
    return;
}
if (defined('DOING_UNINSTALL')) {
    return;
}
// Include the library file
if (!class_exists('AdminPageFramework')) {
    // The development version is available in the repository cloned via GitHub.
    $_sDevelopmentVersionPath = dirname(__FILE__) . '/development/admin-page-framework.php';
    $_bDebugMode = defined('WP_DEBUG') && WP_DEBUG;
    include $_bDebugMode && file_exists($_sDevelopmentVersionPath) ? $_sDevelopmentVersionPath : dirname(__FILE__) . '/library/admin-page-framework/admin-page-framework.php';
}
if (!class_exists('AdminPageFramework_Registry') || !defined('AdminPageFramework_Registry::VERSION') || version_compare(AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<')) {
    AdminPageFrameworkLoader_Registry::setAdminNotice(sprintf('The framework has been already loaded and its version is lesser than yours. Your framework will not be loaded to avoid unexpected results. Loaded Version: %1$s. Your Version: %2$s.', class_exists('AdminPageFramework_Registry') && defined('AdminPageFramework_Registry::VERSION') ? AdminPageFramework_Registry::VERSION : 'unknown', AdminPageFrameworkLoader_Registry::VERSION));
}
// Include the framework loader plugin components.
include AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/boot/AdminPageFrameworkLoader_Bootstrap.php';
if (class_exists('AdminPageFrameworkLoader_Bootstrap')) {
    // for backward compatibility
    new AdminPageFrameworkLoader_Bootstrap(AdminPageFrameworkLoader_Registry::$sFilePath, AdminPageFrameworkLoader_Registry::HOOK_SLUG);
}
/*
 * If you find this framework useful, include it in your project!
 * And please leave a nice comment in the review page, http://wordpress.org/support/view/plugin-reviews/admin-page-framework
 * 
 * If you have a suggestion, the GitHub repository is open to anybody so post an issue there.
 * https://github.com/michaeluno/admin-page-framework/issues
 * 
 * Happy coding!
コード例 #2
0
function AdminPageFrameworkLoader_Warning()
{
    $_bFrameworkLoaded = class_exists('AdminPageFramework_Registry', false);
    if (!$_bFrameworkLoaded || !defined('AdminPageFramework_Registry::VERSION') || version_compare(AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<')) {
        AdminPageFrameworkLoader_Registry::setAdminNotice(sprintf('The framework has been already loaded and its version is lesser than yours. Your framework will not be loaded to avoid unexpected results. Loaded Version - %1$s. Your Version - %2$s.', $_bFrameworkLoaded && defined('AdminPageFramework_Registry::VERSION') ? AdminPageFramework_Registry::VERSION : 'unknown', AdminPageFrameworkLoader_Registry::VERSION));
    }
}