Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_ajax_image_editor [ WordPress Function ]

wp_ajax_image_editor ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_image_editor() {
    
$attachment_id intval($_POST['postid']);
    if ( empty(
$attachment_id) || !current_user_can('edit_post'$attachment_id) )
        
wp_die( -);

    
check_ajax_referer"image_editor-$attachment_id);
    include_once( 
ABSPATH 'wp-admin/includes/image-edit.php' );

    
$msg false;
    switch ( 
$_POST['do'] ) {
        case 
'save' :
            
$msg wp_save_image($attachment_id);
            
$msg json_encode($msg);
            
wp_die$msg );
            break;
        case 
'scale' :
            
$msg wp_save_image($attachment_id);
            break;
        case 
'restore' :
            
$msg wp_restore_image($attachment_id);
            break;
    }

    
wp_image_editor($attachment_id$msg);
    
wp_die();
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics