当前位置: 首页>>代码示例>>PHP>>正文


PHP ewww_image_optimizer_count_optimized函数代码示例

本文整理汇总了PHP中ewww_image_optimizer_count_optimized函数的典型用法代码示例。如果您正苦于以下问题:PHP ewww_image_optimizer_count_optimized函数的具体用法?PHP ewww_image_optimizer_count_optimized怎么用?PHP ewww_image_optimizer_count_optimized使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ewww_image_optimizer_count_optimized函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ewww_ngg_bulk_preview

        function ewww_ngg_bulk_preview()
        {
            if (!empty($_REQUEST['doaction'])) {
                // if there is no requested bulk action, do nothing
                if (empty($_REQUEST['bulkaction'])) {
                    return;
                }
                // if there is no media to optimize, do nothing
                if (empty($_REQUEST['doaction']) || !is_array($_REQUEST['doaction'])) {
                    return;
                }
            }
            list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('ngg');
            // make sure there are some attachments to process
            if ($fullsize_count < 1) {
                echo '<p>' . esc_html__('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
                return;
            }
            ?>
		<div class="wrap">
                <h1><?php 
            esc_html_e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_key')) {
                $verify_cloud = ewww_image_optimizer_cloud_verify(false);
                echo '<a id="ewww-bulk-credits-available" target="_blank" class="page-title-action" style="float:right;" href="https://ewww.io/my-account/">' . esc_html__('Image credits available:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ' ' . ewww_image_optimizer_cloud_quota() . '</a>';
            }
            echo '</h1>';
            // Retrieve the value of the 'bulk resume' option and set the button text for the form to use
            $resume = get_option('ewww_image_optimizer_bulk_ngg_resume');
            if (empty($resume)) {
                $button_text = esc_attr__('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            } else {
                $button_text = esc_attr__('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            }
            ?>
                <div id="ewww-bulk-loading"></div>
                <div id="ewww-bulk-progressbar"></div>
                <div id="ewww-bulk-counter"></div>
		<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
			<br /><input type="submit" class="button-secondary action" value="<?php 
            esc_attr_e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
" />
		</form>
		<div id="ewww-bulk-widgets" class="metabox-holder" style="display:none">
			<div class="meta-box-sortables">
				<div id="ewww-bulk-last" class="postbox">
					<button type="button" class="handlediv button-link" aria-expanded="true">
						<span class="screen-reader-text"><?php 
            esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</span>
						<span class="toggle-indicator" aria-hidden="true"></span>
					</button>
					<h2 class="hndle"><span><?php 
            esc_html_e('Last Image Optimized', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</span></h2>
					<div class="inside"></div>
				</div>
			</div>
			<div class="meta-box-sortables">
				<div id="ewww-bulk-status" class="postbox">
					<button type="button" class="handlediv button-link" aria-expanded="true">
						<span class="screen-reader-text"><?php 
            esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</span>
						<span class="toggle-indicator" aria-hidden="true"></span>
					</button>
					<h2 class="hndle"><span><?php 
            esc_html_e('Optimization Log', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</span></h2>
					<div class="inside"></div>
				</div>
			</div>
		</div>
		<form class="ewww-bulk-form">
			<p><label for="ewww-force" style="font-weight: bold"><?php 
            esc_html_e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</label>&emsp;<input type="checkbox" id="ewww-force" name="ewww-force"></p>
			<p><label for="ewww-delay" style="font-weight: bold"><?php 
            esc_html_e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</label>&emsp;<input type="text" id="ewww-delay" name="ewww-delay" value="<?php 
            if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
                echo $delay;
            } else {
                echo 0;
            }
            ?>
"></p>
			<div id="ewww-delay-slider" style="width:50%"></div>
		</form>
                <div id="ewww-bulk-forms">
		<p class="ewww-bulk-info"><?php 
            printf(esc_html__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count);
            ?>
//.........这里部分代码省略.........
开发者ID:agiper,项目名称:wordpress,代码行数:101,代码来源:nextgen2-integration.php

示例2: ewww_image_optimizer_display_unoptimized_media

function ewww_image_optimizer_display_unoptimized_media()
{
    global $ewww_debug;
    $ewww_debug .= "<b>ewww_image_optimizer_display_unoptimized_media()</b><br>";
    $attachments = ewww_image_optimizer_count_optimized('media', true);
    echo "<div class='wrap'><h3>" . __('Unoptimized Images', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</h3>";
    printf('<p>' . __('We have %d images to optimize.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>', count($attachments));
    if (count($attachments) != 0) {
        sort($attachments, SORT_NUMERIC);
        $image_string = implode(',', $attachments);
        echo '<form method="post" action="upload.php?page=ewww-image-optimizer-bulk">' . "<input type='hidden' name='ids' value='{$image_string}' />" . '<input type="submit" class="button-secondary action" value="' . __('Optimize All Images', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '" />' . '</form>';
        if (count($attachments) < 500) {
            sort($attachments, SORT_NUMERIC);
            $image_string = implode(',', $attachments);
            echo '<table class="wp-list-table widefat media" cellspacing="0"><thead><tr><th>ID</th><th>&nbsp;</th><th>' . __('Title', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</th><th>' . __('Image Optimizer', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</th></tr></thead>';
            $alternate = true;
            foreach ($attachments as $ID) {
                $image_name = get_the_title($ID);
                ?>
				<tr<?php 
                if ($alternate) {
                    echo " class='alternate'";
                }
                ?>
><td><?php 
                echo $ID;
                ?>
</td>
<?php 
                echo "<td style='width:80px' class='column-icon'>" . wp_get_attachment_image($ID, 'thumbnail') . "</td>";
                echo "<td class='title'>{$image_name}</td>";
                echo "<td>";
                ewww_image_optimizer_custom_column('ewww-image-optimizer', $ID);
                echo "</td></tr>";
                $alternate = !$alternate;
            }
            echo '</table>';
        } else {
            echo '<p>' . __('There are too many images to display.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
        }
    }
    echo '</div>';
    return;
}
开发者ID:goodbayscott,项目名称:wwr-temp,代码行数:44,代码来源:common.php

示例3: optimize

 /**
  * Bulk Optimize Images
  *
  * ## OPTIONS
  *
  * <library>
  * : valid values are 'all' (default), 'media', 'nextgen', 'flagallery', and 'other'
  * : media: Media Library only
  * : nextgen: Nextcellent and NextGEN 2.x
  * : flagallery: Grand FlaGallery
  * : other: everything else including theme images and other specified folders
  *
  * <delay>
  * : optional, number of seconds to pause between images
  *
  * <force>
  * : optional, should the plugin re-optimize images that have already been processed.
  *
  * <reset>
  * : optional, start the optimizer back at the beginning instead of resuming from last position
  *
  * <noprompt>
  * : do not prompt, just start optimizing
  *
  * ## EXAMPLES
  *
  *     wp-cli ewwwio optimize media 5 --force --reset --noprompt
  *
  * @synopsis <library> [<delay>] [--force] [--reset] [--noprompt]
  */
 function optimize($args, $assoc_args)
 {
     global $ewww_defer;
     $ewww_defer = false;
     // because NextGEN hasn't flushed it's buffers...
     while (@ob_end_flush()) {
     }
     $library = $args[0];
     if (empty($args[1])) {
         $delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay');
     } else {
         $delay = $args[1];
     }
     $ewww_reset = false;
     if (!empty($assoc_args['reset'])) {
         $ewww_reset = true;
     }
     if (!empty($assoc_args['force'])) {
         WP_CLI::line(__('Forcing re-optimization of previously processed images.', EWWW_IMAGE_OPTIMIZER_DOMAIN));
         $_REQUEST['ewww_force'] = true;
     }
     WP_CLI::line(sprintf(_x('Optimizing %1$s with a %2$d second pause between images.', 'string will be something like "media" or "nextgen"', EWWW_IMAGE_OPTIMIZER_DOMAIN), $library, $delay));
     // let's get started, shall we?
     ewww_image_optimizer_admin_init();
     // and what shall we do?
     switch ($library) {
         case 'all':
             if ($ewww_reset) {
                 update_option('ewww_image_optimizer_bulk_resume', '');
                 update_option('ewww_image_optimizer_aux_resume', '');
                 update_option('ewww_image_optimizer_bulk_ngg_resume', '');
                 update_option('ewww_image_optimizer_bulk_flag_resume', '');
                 WP_CLI::line(__('Bulk status has been reset, starting from the beginning.', EWWW_IMAGE_OPTIMIZER_DOMAIN));
             }
             WP_CLI::line(__('Scanning, this could take a while', EWWW_IMAGE_OPTIMIZER_DOMAIN));
             list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('media');
             WP_CLI::line(sprintf(__('%1$d images in the Media Library have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count));
             if (class_exists('EwwwNgg')) {
                 global $ngg;
                 if (preg_match('/^2/', $ngg->version)) {
                     list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('ngg');
                     WP_CLI::line('Nextgen: ' . sprintf(__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count));
                 } else {
                     $attachments = ewww_image_optimizer_scan_next();
                     WP_CLI::line('Nextgen: ' . sprintf(__('We have %d images to optimize.', EWWW_IMAGE_OPTIMIZER_DOMAIN), count($attachments)));
                 }
             }
             if (class_exists('ewwwflag')) {
                 list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('flag');
                 WP_CLI::line('Flagallery: ' . sprintf(__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count));
             }
             $other_attachments = ewww_image_optimizer_scan_other();
             if (empty($assoc_args['noprompt'])) {
                 WP_CLI::confirm(sprintf(__('%1$d images in other folders need optimizing.', EWWW_IMAGE_OPTIMIZER_DOMAIN), count($other_attachments)));
             }
             ewww_image_optimizer_bulk_media($delay);
             if (class_exists('Ewwwngg')) {
                 global $ngg;
                 if (preg_match('/^2/', $ngg->version)) {
                     ewww_image_optimizer_bulk_ngg($delay);
                 } else {
                     $attachments = ewww_image_optimizer_scan_next();
                     ewww_image_optimizer_bulk_next($delay, $attachments);
                 }
             }
             if (class_exists('ewwwflag')) {
                 ewww_image_optimizer_bulk_flag($delay);
             }
             ewww_image_optimizer_bulk_other($delay, $other_attachments);
             break;
//.........这里部分代码省略.........
开发者ID:aaronfrey,项目名称:PepperLillie-CVM,代码行数:101,代码来源:iocli.php

示例4: ewww_flag_bulk

    function ewww_flag_bulk()
    {
        // if there is POST data, make sure bulkaction and doaction are the values we want
        if (!empty($_POST) && empty($_REQUEST['reset'])) {
            // if there is no requested bulk action, do nothing
            if (empty($_REQUEST['bulkaction'])) {
                return;
            }
            // if there is no media to optimize, do nothing
            if (empty($_REQUEST['doaction']) || !is_array($_REQUEST['doaction'])) {
                return;
            }
            if (!preg_match('/^bulk_optimize/', $_REQUEST['bulkaction'])) {
                return;
            }
        }
        list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('flag');
        // bail-out if there aren't any images to optimize
        if ($fullsize_count < 1) {
            echo '<p>' . __('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
            return;
        }
        ewww_image_optimizer_cloud_verify(false);
        ?>
		<div class="wrap"><div id="icon-upload" class="icon32"></div><h2>GRAND FlAGallery <?php 
        _e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</h2>
		<?php 
        // Retrieve the value of the 'bulk resume' option and set the button text for the form to use
        $resume = get_option('ewww_image_optimizer_bulk_flag_resume');
        if (empty($resume)) {
            $button_text = __('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        } else {
            $button_text = __('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        }
        ?>
		<div id="bulk-loading"></div>
		<div id="bulk-progressbar"></div>
		<div id="bulk-counter"></div>
		<form id="bulk-stop" style="display:none;" method="post" action="">
			<br /><input type="submit" class="button-secondary action" value="<?php 
        _e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
" />
		</form>
		<div id="bulk-status"></div>
		<form class="bulk-form">
			<p><label for="ewww-force" style="font-weight: bold"><?php 
        _e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</label>&emsp;<input type="checkbox" id="ewww-force" name="ewww-force"></p>
			<p><label for="ewww-delay" style="font-weight: bold"><?php 
        _e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</label>&emsp;<input type="text" id="ewww-delay" name="ewww-delay" value="<?php 
        if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
            echo $delay;
        } else {
            echo 0;
        }
        ?>
"></p>
			<div id="ewww-delay-slider" style="width:50%"></div>
		<!--	<p><label for="ewww-interval" style="font-weight: bold"><?php 
        _e('Choose how many images should be processed before each delay', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</label>&emsp;<input type="text" id="ewww-interval" name="ewww-interval" value="<?php 
        if ($interval = ewww_image_optimizer_get_option('ewww_image_optimizer_interval')) {
            echo $interval;
        } else {
            echo 1;
        }
        ?>
"></p>
			<div id="ewww-interval-slider" style="width:50%"></div>-->
		</form>
		<div id="bulk-forms">
		<p class="bulk-info"><?php 
        printf(__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count);
        ?>
<br />
		<?php 
        _e('Previously optimized images will be skipped by default.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</p>
		<form id="bulk-start" class="bulk-form" method="post" action="">
			<input type="submit" class="button-secondary action" value="<?php 
        echo $button_text;
        ?>
" />
		</form>
		<?php 
        // if there was a previous operation, offer the option to reset the option in the db
        if (!empty($resume)) {
            ?>
			<p class="bulk-info"><?php 
            _e('If you would like to start over again, press the Reset Status button to reset the bulk operation status.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</p>
//.........这里部分代码省略.........
开发者ID:LacieNat,项目名称:Access-Comm-Project,代码行数:101,代码来源:flag-integration.php

示例5: ewww_image_optimizer_bulk_preview

function ewww_image_optimizer_bulk_preview()
{
    global $ewww_debug;
    $ewww_debug .= "<b>ewww_image_optimizer_bulk_preview()</b><br>";
    // retrieve the attachment IDs that were pre-loaded in the database
    list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('media');
    //	$upload_import = get_option('ewww_image_optimizer_imported');
    $upload_import = true;
    ?>
	<div class="wrap"> 
	<div id="icon-upload" class="icon32"><br /></div><h2><?php 
    _e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</h2>
<?php 
    // Retrieve the value of the 'bulk resume' option and set the button text for the form to use
    $resume = get_option('ewww_image_optimizer_bulk_resume');
    if (empty($resume)) {
        $button_text = __('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    } else {
        $button_text = __('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    }
    $loading_image = plugins_url('/wpspin.gif', __FILE__);
    // create the html for the bulk optimize form and status divs
    ?>
		<div id="ewww-bulk-loading">
			<p id="ewww-loading" class="ewww-bulk-info" style="display:none"><?php 
    _e('Importing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
&nbsp;<img src='<?php 
    echo $loading_image;
    ?>
' /></p>
		</div>
		<div id="ewww-bulk-progressbar"></div>
		<div id="ewww-bulk-counter"></div>
		<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
			<br /><input type="submit" class="button-secondary action" value="<?php 
    _e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
" />
		</form>
		<div id="ewww-bulk-status"></div>
<?php 
    if (empty($upload_import)) {
        ?>
			<p class="ewww-bulk-info"><?php 
        _e('You should import Media Library images into the table to prevent duplicate optimization.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</p>
			<form id="import-start" class="bulk-form" method="post" action="">
				<input type="submit" class="button-secondary action" value="<?php 
        _e('Import Images', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
" />
			</form>
		</div>
<?php 
        return;
    }
    ?>
		<form class="ewww-bulk-form">
			<p><label for="ewww-force" style="font-weight: bold"><?php 
    _e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</label>&emsp;<input type="checkbox" id="ewww-force" name="ewww-force"></p>
			<p><label for="ewww-delay" style="font-weight: bold"><?php 
    _e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</label>&emsp;<input type="text" id="ewww-delay" name="ewww-delay" value="<?php 
    if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
        echo $delay;
    } else {
        echo 0;
    }
    ?>
"></p>
			<div id="ewww-delay-slider" style="width:50%"></div>
		</form>
		<h3><?php 
    _e('Optimize Media Library', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</h3>
<?php 
    if ($fullsize_count < 1) {
        echo '<p>' . __('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
    } else {
        ?>
			<div id="ewww-bulk-forms">
<?php 
        if (!$resize_count && !$unoptimized_count && !$unoptimized_resize_count) {
            ?>
				<p class="ewww-media-info ewww-bulk-info"><?php 
            printf(__('%1$d images in the Media Library have been selected, unable to determine how many resizes and how many are unoptimized.', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count);
            ?>
<br />
<?php 
        } else {
            ?>
				<p class="ewww-media-info ewww-bulk-info"><?php 
//.........这里部分代码省略.........
开发者ID:Rudchyk,项目名称:wp-framework,代码行数:101,代码来源:bulk.php

示例6: ewww_image_optimizer_bulk_preview

function ewww_image_optimizer_bulk_preview()
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    // retrieve the attachment IDs that were pre-loaded in the database
    list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('media');
    ?>
	<div class="wrap"> 
	<h1>
<?php 
    esc_html_e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_key')) {
        ewww_image_optimizer_cloud_verify();
        echo '<span><a id="ewww-bulk-credits-available" target="_blank" class="page-title-action" style="float:right;" href="https://ewww.io/my-account/">' . esc_html__('Image credits available:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ' ' . ewww_image_optimizer_cloud_quota() . '</a></span>';
    }
    echo '</h1>';
    // Retrieve the value of the 'bulk resume' option and set the button text for the form to use
    $resume = get_option('ewww_image_optimizer_bulk_resume');
    if (empty($resume)) {
        $button_text = esc_attr__('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    } else {
        $button_text = esc_attr__('Resume previous optimization', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    }
    $loading_image = plugins_url('/images/wpspin.gif', __FILE__);
    // create the html for the bulk optimize form and status divs
    ?>
		<div id="ewww-bulk-loading">
			<p id="ewww-loading" class="ewww-bulk-info" style="display:none"><?php 
    esc_html_e('Importing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
&nbsp;<img src='<?php 
    echo $loading_image;
    ?>
' /></p>
		</div>
		<div id="ewww-bulk-progressbar"></div>
		<div id="ewww-bulk-counter"></div>
		<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
			<br /><input type="submit" class="button-secondary action" value="<?php 
    esc_attr_e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
" />
		</form>
		<div id="ewww-bulk-widgets" class="metabox-holder" style="display:none">
			<div class="meta-box-sortables">
				<div id="ewww-bulk-last" class="postbox">
					<button type="button" class="handlediv button-link" aria-expanded="true">
						<span class="screen-reader-text"><?php 
    esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</span>
						<span class="toggle-indicator" aria-hidden="true"></span>
					</button>
					<h2 class="hndle"><span><?php 
    esc_html_e('Last Image Optimized', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</span></h2>
					<div class="inside"></div>
				</div>
			</div>
			<div class="meta-box-sortables">
				<div id="ewww-bulk-status" class="postbox">
					<button type="button" class="handlediv button-link" aria-expanded="true">
						<span class="screen-reader-text"><?php 
    esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</span>
						<span class="toggle-indicator" aria-hidden="true"></span>
					</button>
					<h2 class="hndle"><span><?php 
    esc_html_e('Optimization Log', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</span></h2>
					<div class="inside"></div>
				</div>
			</div>
		</div>
		<form class="ewww-bulk-form">
			<p><label for="ewww-force" style="font-weight: bold"><?php 
    esc_html_e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</label>&emsp;<input type="checkbox" id="ewww-force" name="ewww-force"></p>
			<p><label for="ewww-delay" style="font-weight: bold"><?php 
    esc_html_e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</label>&emsp;<input type="text" id="ewww-delay" name="ewww-delay" value="<?php 
    if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
        echo $delay;
    } else {
        echo 0;
    }
    ?>
"></p>
			<div id="ewww-delay-slider" style="width:50%"></div>
		</form>
		<h2 class="ewww-bulk-media"><?php 
    esc_html_e('Optimize Media Library', EWWW_IMAGE_OPTIMIZER_DOMAIN);
    ?>
</h2>
<?php 
    if ($fullsize_count < 1) {
//.........这里部分代码省略.........
开发者ID:crazyyy,项目名称:bessarabia,代码行数:101,代码来源:bulk.php

示例7: ewww_ngg_bulk_preview

    function ewww_ngg_bulk_preview()
    {
        global $ewww_debug;
        if (!empty($_POST['doaction'])) {
            // if there is no requested bulk action, do nothing
            if (empty($_REQUEST['bulkaction'])) {
                return;
            }
            // if there is no media to optimize, do nothing
            if (empty($_REQUEST['doaction']) || !is_array($_REQUEST['doaction'])) {
                return;
            }
        }
        list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('ngg');
        // make sure there are some attachments to process
        if ($fullsize_count < 1) {
            echo '<p>' . __('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
            return;
        }
        //		ewww_image_optimizer_cloud_verify(false);
        ?>
		<div class="wrap">
                <div id="icon-upload" class="icon32"></div><h2><?php 
        _e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</h2>
                <?php 
        // Retrieve the value of the 'bulk resume' option and set the button text for the form to use
        $resume = get_option('ewww_image_optimizer_bulk_ngg_resume');
        if (empty($resume)) {
            $button_text = __('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        } else {
            $button_text = __('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        }
        ?>
                <div id="ewww-bulk-loading"></div>
                <div id="ewww-bulk-progressbar"></div>
                <div id="ewww-bulk-counter"></div>
		<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
			<br /><input type="submit" class="button-secondary action" value="<?php 
        _e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
" />
		</form>
                <div id="ewww-bulk-status"></div>
		<form class="ewww-bulk-form">
			<p><label for="ewww-force" style="font-weight: bold"><?php 
        _e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</label>&emsp;<input type="checkbox" id="ewww-force" name="ewww-force"></p>
			<p><label for="ewww-delay" style="font-weight: bold"><?php 
        _e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</label>&emsp;<input type="text" id="ewww-delay" name="ewww-delay" value="<?php 
        if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
            echo $delay;
        } else {
            echo 0;
        }
        ?>
"></p>
			<div id="ewww-delay-slider" style="width:50%"></div>
		</form>
                <div id="ewww-bulk-forms">
		<p class="ewww-bulk-info"><?php 
        printf(__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count);
        ?>
<br />
		<?php 
        _e('Previously optimized images will be skipped by default.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        ?>
</p>
                <form id="ewww-bulk-start" class="ewww-bulk-form" method="post" action="">
                        <input type="submit" class="button-secondary action" value="<?php 
        echo $button_text;
        ?>
" />
                </form>
                <?php 
        // if there is a previous bulk operation to resume, give the user the option to reset the resume flag
        if (!empty($resume)) {
            ?>
                        <p class="ewww-bulk-info"><?php 
            _e('If you would like to start over again, press the Reset Status button to reset the bulk operation status.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
</p>
                        <form id="ewww-bulk-reset" class="ewww-bulk-form" method="post" action="">
                                <?php 
            wp_nonce_field('ewww-image-optimizer-bulk-reset', 'ewww_wpnonce');
            ?>
                                <input type="hidden" name="ewww_reset" value="1">
                                <input type="submit" class="button-secondary action" value="<?php 
            _e('Reset Status', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            ?>
" />
                        </form>
<?php 
        }
        echo '</div></div>';
        if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
//.........这里部分代码省略.........
开发者ID:hkarriche,项目名称:wordpress,代码行数:101,代码来源:nextgen2-integration.php


注:本文中的ewww_image_optimizer_count_optimized函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。