Changeset 26876 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 12/28/2013 11:52:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r26868 r26876 1788 1788 $post_id = edit_post(); 1789 1789 1790 if ( is_wp_error($post_id) ) { 1791 if ( $post_id->get_error_message() ) 1792 $message = $post_id->get_error_message(); 1793 else 1794 $message = __('Save failed'); 1795 1796 echo json_encode( array( 'message' => $message, 'last_edited' => '' ) ); 1797 wp_die(); 1798 } else { 1799 $message = __('Saved.'); 1790 if ( is_wp_error( $post_id ) ) { 1791 wp_send_json_error(); 1800 1792 } 1801 1793 … … 1808 1800 } 1809 1801 1810 if ( $last_id = get_post_meta( $post_id, '_edit_last', true) ) {1811 $last_user = get_userdata( $last_id);1802 if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) { 1803 $last_user = get_userdata( $last_id ); 1812 1804 $last_edited = sprintf( __('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), $last_date, $last_time ); 1813 1805 } else { … … 1815 1807 } 1816 1808 1817 echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) ); 1818 wp_die(); 1809 wp_send_json_success( array( 'last_edited' => $last_edited ) ); 1819 1810 } 1820 1811 … … 1840 1831 * @since 3.3.0 1841 1832 * 1842 * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 1 20.1833 * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 150. 1843 1834 */ 1844 $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 1 20 ) + 5 ) . ':' . $active_lock[1];1835 $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1]; 1845 1836 update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) ); 1846 1837 wp_die( 1 );
Note: See TracChangeset
for help on using the changeset viewer.