wp_ajax_wp_fullscreen_save_post
Ajax handler for saving posts from the fullscreen editor.
Description
wp_ajax_wp_fullscreen_save_post();
Usage
if ( !function_exists( 'wp_ajax_wp_fullscreen_save_post' ) ) { require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; } // NOTICE! Understand what this does before running. $result = wp_ajax_wp_fullscreen_save_post();
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/ajax-actions.php
- function wp_ajax_wp_fullscreen_save_post() {
- $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
- $post = null;
- if ( $post_id )
- $post = get_post( $post_id );
- check_ajax_referer('update-post_' . $post_id, '_wpnonce');
- $post_id = edit_post();
- if ( is_wp_error( $post_id ) ) {
- }
- if ( $post ) {
- $last_date = mysql2date( __( 'F j, Y' ), $post->post_modified );
- $last_time = mysql2date( __( 'g:i a' ), $post->post_modified );
- } else {
- }
- if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
- $last_user = get_userdata( $last_id );
- } else {
- $last_edited = sprintf( __('Last edited on %1$s at %2$s'), $last_date, $last_time );
- }
- wp_send_json_success( array( 'last_edited' => $last_edited ) );
- }