Beispiel #1
0
function sl_settings_display_errors($setting)
{
    $option = get_option($setting);
    if (!sl_is_footer_js_verified()) {
        $option['not-verified'] = 'There appears to be an error in calling the Skimlinks Plugin from your theme\'s footer.php file, please ensure your footer.php file includes the standard WordPress function "wp_footer()" above the closing body tag.';
    }
    if (sl_is_subdomain_enabled() && !sl_get_subdomain()) {
        $option['no-subdomain'] = 'Please enter your custom subdomain or unselect "Enable Custom Subdomain"';
    }
    if (is_array($option)) {
        foreach ($option as $slug => $message) {
            echo "<div id='sl_messages' class='error fade {$slug}'><p>{$message}</p></div>";
            unset($option[$slug]);
        }
        update_option($setting, $option);
    }
}
Beispiel #2
0
/**
 * Returns whether the plugin is configured and the theme has been verified to show the js
 * 
 * @return bool
 */
function sl_is_plugin_active()
{
    return sl_is_plugin_configured() && sl_is_footer_js_verified();
}