wp_ajax_inline_save [ WordPress Function ]
wp_ajax_inline_save ( No parameters )
| Defined at: |
|
Soorgelijke functies: wp_ajax_inline_save_tax, wp_add_inline_style, wp_ajax_nopriv_autosave, wp_ajax_autosave, wp_ajax_delete_page
No description yet.
Source
<?php
function wp_ajax_inline_save() {
global $wp_list_table;
check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) )
wp_die();
if ( 'page' == $_POST['post_type'] ) {
if ( ! current_user_can( 'edit_page', $post_ID ) )
wp_die( __( 'You are not allowed to edit this page.' ) );
} else {
if ( ! current_user_can( 'edit_post', $post_ID ) )
wp_die( __( 'You are not allowed to edit this post.' ) );
}
set_current_screen( $_POST['screen'] );
if ( $last = wp_check_post_lock( $post_ID ) ) {
$last_user = get_userdata( $last );
$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), esc_html( $last_user_name ) );
wp_die();
}
$data = &$_POST;
$post = get_post( $post_ID, ARRAY_A );
$post = add_magic_quotes($post); //since it is from db
$data['content'] = $post['post_content'];
$data['excerpt'] = $post['post_excerpt'];
// rename
$data['user_ID'] = $GLOBALS['user_ID'];
if ( isset($data['post_parent']) )
$data['parent_id'] = $data['post_parent'];
// status
if ( isset($data['keep_private']) && 'private' == $data['keep_private'] )
$data['post_status'] = 'private';
else
$data['post_status'] = $data['_status'];
if ( empty($data['comment_status']) )
$data['comment_status'] = 'closed';
if ( empty($data['ping_status']) )
$data['ping_status'] = 'closed';
// update the post
edit_post();
$wp_list_table = _get_list_table('WP_Posts_List_Table');
$mode = $_POST['post_view'];
$wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) );
wp_die();
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- PHPXRef 0.7 : WordPress : Detail view of ajax-actions.php
wp_ajax_inline_save() wp_ajax_inline_save_tax() wp_ajax_find_posts() wp_ajax_widgets_order() wp_ajax_save_widget() wp_ajax_upload_attachment( ) ...
phpxref.ftwr.co.uk - Docs for page ajax-actions.php
/wp-admin/includes/ajax-actions.php. Description. Description | ...
phpdoc.wordpress.org - wp_add_inline_style (WordPress Function) - WPSeek.com
Similar Functions: wp_ajax_inline_save, wp_ajax_inline_save_tax, print_admin_styles, wp_print_styles, wp_dequeue_style. Adds extra CSS. Works only if the ...
wpseek.com - WordPress 3.4-beta1
Apr 5, 2012... No DocBlock was found for function wp_ajax_sample_permalink(). error, 1318, No DocBlock was found for function wp_ajax_inline_save() ...
docs.garyjones.co.uk