本文整理匯總了PHP中stream_preview_image函數的典型用法代碼示例。如果您正苦於以下問題:PHP stream_preview_image函數的具體用法?PHP stream_preview_image怎麽用?PHP stream_preview_image使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了stream_preview_image函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wp_ajax_imgedit_preview
/**
* Ajax handler for image editor previews.
*
* @since 3.1.0
*/
function wp_ajax_imgedit_preview()
{
$post_id = intval($_GET['postid']);
if (empty($post_id) || !current_user_can('edit_post', $post_id)) {
wp_die(-1);
}
check_ajax_referer("image_editor-{$post_id}");
include_once ABSPATH . 'wp-admin/includes/image-edit.php';
if (!stream_preview_image($post_id)) {
wp_die(-1);
}
wp_die();
}
示例2: elseif
} elseif ('no' == $_GET['test']) {
update_site_option('can_compress_scripts', 0);
} elseif ('yes' == $_GET['test']) {
update_site_option('can_compress_scripts', 1);
}
}
die('0');
break;
case 'imgedit-preview':
$post_id = intval($_GET['postid']);
if (empty($post_id) || !current_user_can('edit_post', $post_id)) {
die('-1');
}
check_ajax_referer("image_editor-{$post_id}");
include_once ABSPATH . 'wp-admin/includes/image-edit.php';
if (!stream_preview_image($post_id)) {
die('-1');
}
die;
break;
case 'oembed-cache':
$return = $wp_embed->cache_oembed($_GET['post']) ? '1' : '0';
die($return);
break;
default:
do_action('wp_ajax_' . $_GET['action']);
die('0');
break;
}
}
/**