media_upload_max_image_resize

函式
media_upload_max_image_resize ( No parameters )

media_upload_max_image_resize – 這個WordPress過濾器用於設定在圖片上傳過程中可以調整的最大圖片尺寸。這可以幫助減少伺服器的負載,並確保影象的快速上傳。

顯示覆選框以縮放影象。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function media_upload_max_image_resize() {
$checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : '';
$a = '';
$end = '';
if ( current_user_can( 'manage_options' ) ) {
$a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
$end = '</a>';
}
?>
<p class="hide-if-no-js"><label>
<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
<?php
/* translators: 1: Link start tag, 2: Link end tag, 3: Width, 4: Height. */
printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );
?>
</label></p>
<?php
}
function media_upload_max_image_resize() { $checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : ''; $a = ''; $end = ''; if ( current_user_can( 'manage_options' ) ) { $a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">'; $end = '</a>'; } ?> <p class="hide-if-no-js"><label> <input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> /> <?php /* translators: 1: Link start tag, 2: Link end tag, 3: Width, 4: Height. */ printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) ); ?> </label></p> <?php }
function media_upload_max_image_resize() {
	$checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : '';
	$a       = '';
	$end     = '';

	if ( current_user_can( 'manage_options' ) ) {
		$a   = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
		$end = '</a>';
	}

	?>
	<p class="hide-if-no-js"><label>
	<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
	<?php
	/* translators: 1: Link start tag, 2: Link end tag, 3: Width, 4: Height. */
	printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );

	?>
	</label></p>
	<?php
}

常見問題

FAQs
檢視更多 >