Changeset 28358 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 05/10/2014 11:35:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r28356 r28358 2507 2507 wp_send_json_success( $api ); 2508 2508 } 2509 2510 /** 2511 * Apply `the_content` filters to a string based on the post ID. 2512 * 2513 * @since 4.0.0 2514 */ 2515 function wp_ajax_filter_content() { 2516 global $post; 2517 2518 if ( ! $post = get_post( (int) $_REQUEST['post_ID'] ) ) { 2519 wp_send_json_error(); 2520 } 2521 2522 if ( ! current_user_can( 'read_post', $post->ID ) ) { 2523 wp_send_json_error(); 2524 } 2525 2526 setup_postdata( $post ); 2527 2528 wp_send_json_success( apply_filters( 'the_content', wp_unslash( $_POST['content'] ) ) ); 2529 }
Note: See TracChangeset
for help on using the changeset viewer.