Switch language

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




wp_ajax_inline_save_tax [ WordPress Function ]

wp_ajax_inline_save_tax ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_inline_save_tax() {
    global 
$wp_list_table;

    
check_ajax_referer'taxinlineeditnonce''_inline_edit' );

    
$taxonomy sanitize_key$_POST['taxonomy'] );
    
$tax get_taxonomy$taxonomy );
    if ( ! 
$tax )
        
wp_die);

    if ( ! 
current_user_can$tax->cap->edit_terms ) )
        
wp_die( -);

    
set_current_screen'edit-' $taxonomy );

    
$wp_list_table _get_list_table('WP_Terms_List_Table');

    if ( ! isset(
$_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
        
wp_die( -);

    
$tag get_term$id$taxonomy );
    
$_POST['description'] = $tag->description;

    
$updated wp_update_term($id$taxonomy$_POST);
    if ( 
$updated && !is_wp_error($updated) ) {
        
$tag get_term$updated['term_id'], $taxonomy );
        if ( !
$tag || is_wp_error$tag ) ) {
            if ( 
is_wp_error($tag) && $tag->get_error_message() )
                
wp_die$tag->get_error_message() );
            
wp_die__'Item not updated.' ) );
        }

        echo 
$wp_list_table->single_row$tag );
    } else {
        if ( 
is_wp_error($updated) && $updated->get_error_message() )
            
wp_die$updated->get_error_message() );
        
wp_die__'Item not updated.' ) );
    }

    
wp_die();
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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