Esempio n. 1
0
/**
 *
 * RETINA DASHBOARD
 *
 */
function wr2x_admin_menu_dashboard()
{
    $refresh = isset($_GET['refresh']) ? $_GET['refresh'] : 0;
    $clearlogs = isset($_GET['clearlogs']) ? $_GET['clearlogs'] : 0;
    $ignore = isset($_GET['ignore']) ? $_GET['ignore'] : false;
    if ($ignore) {
        if (!wr2x_is_pro()) {
            echo "<div class='error' style='margin-top: 20px;'><p>";
            _e("Ignore is a Pro feature.", 'wp-retina-2x');
            echo "</p></div>";
        } else {
            wr2x_add_ignore($ignore);
        }
    }
    if ($refresh) {
        wr2x_calculate_issues();
    }
    if ($clearlogs) {
        if (file_exists(plugin_dir_path(__FILE__) . '/wp-retina-2x.log')) {
            unlink(plugin_dir_path(__FILE__) . '/wp-retina-2x.log');
        }
    }
    $flagged = count(wr2x_get_issues());
    $warning_title = __("Retina images", 'wp-retina-2x');
    $menu_label = sprintf(__('Retina %s'), "<span class='update-plugins count-{$flagged}' title='{$warning_title}'><span class='update-count'>" . number_format_i18n($flagged) . "</span></span>");
    add_media_page('Retina', $menu_label, 'manage_options', 'wp-retina-2x', 'wpr2x_wp_retina_2x');
}
/**
 *
 * RETINA DASHBOARD
 *
 */
function wr2x_admin_menu_dashboard()
{
    $refresh = isset($_GET['refresh']) ? $_GET['refresh'] : 0;
    $ignore = isset($_GET['ignore']) ? $_GET['ignore'] : false;
    if ($ignore) {
        wr2x_add_ignore($ignore);
    }
    if ($refresh) {
        wr2x_calculate_issues();
    }
    $flagged = count(wr2x_get_issues());
    $warning_title = __("Retina images", 'wp-retina-2x');
    $menu_label = sprintf(__('WP Retina 2x %s'), "<span class='update-plugins count-{$flagged}' title='{$warning_title}'><span class='update-count'>" . number_format_i18n($flagged) . "</span></span>");
    add_media_page('WP Retina 2x', $menu_label, 'manage_options', 'wp-retina-2x', 'wpr2x_wp_retina_2x');
}