wp_ajax_wp_fullscreen_save_post [ WordPress Function ]
wp_ajax_wp_fullscreen_save_post ( No parameters )
| Defined at: |
|
Soorgelijke functies: wp_ajax_wp_remove_post_lock, wp_ajax_wp_compression_test, wp_ajax_delete_post, wp_ajax_untrash_post, wp_ajax_trash_post
No description yet.
Source
<?php
function wp_ajax_wp_fullscreen_save_post() {
$post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
$post = $post_type = null;
if ( $post_id )
$post = get_post( $post_id );
if ( $post )
$post_type = $post->post_type;
elseif ( isset( $_POST['post_type'] ) && post_type_exists( $_POST['post_type'] ) )
$post_type = $_POST['post_type'];
check_ajax_referer('update-' . $post_type . '_' . $post_id, '_wpnonce');
$post_id = edit_post();
if ( is_wp_error($post_id) ) {
if ( $post_id->get_error_message() )
$message = $post_id->get_error_message();
else
$message = __('Save failed');
echo json_encode( array( 'message' => $message, 'last_edited' => '' ) );
wp_die();
} else {
$message = __('Saved.');
}
if ( $post ) {
$last_date = mysql2date( get_option('date_format'), $post->post_modified );
$last_time = mysql2date( get_option('time_format'), $post->post_modified );
} else {
$last_date = date_i18n( get_option('date_format') );
$last_time = date_i18n( get_option('time_format') );
}
if ( $last_id = get_post_meta($post_id, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
$last_edited = sprintf( __('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), $last_date, $last_time );
} else {
$last_edited = sprintf( __('Last edited on %1$s at %2$s'), $last_date, $last_time );
}
echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) );
wp_die();
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- PHPXRef 0.7 : WordPress : Detail view of ajax-actions.php
wp_ajax_date_format() wp_ajax_time_format() wp_ajax_wp_fullscreen_save_post() wp_ajax_wp_remove_post_lock() wp_ajax_dismiss_wp_pointer() ...
phpxref.ftwr.co.uk - Docs for page ajax-actions.php
/wp-admin/includes/ajax-actions.php. Description. Description | ...
phpdoc.wordpress.org - trunk
... wp_ajax_wp_compression_test · wp_ajax_wp_fullscreen_save_post · wp_ajax_wp_link_ajax · wp_ajax_wp_remove_post_lock · wp_caption_input_textarea ...
phpdoc.wordpress.org - WordPress 3.4-beta1
Apr 5, 2012 ... error, 1696, No DocBlock was found for function wp_ajax_wp_fullscreen_save_post(). error, 1744, No DocBlock was found for function ...
docs.garyjones.co.uk