Changeset 29178 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 07/15/2014 10:07:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r29176 r29178 2685 2685 wp_send_json_success( $parsed ); 2686 2686 } 2687 2688 function wp_ajax_parse_media_shortcode() { 2689 global $post, $wp_scripts; 2690 2691 if ( ! $post = get_post( (int) $_REQUEST['post_ID'] ) ) { 2692 wp_send_json_error(); 2693 } 2694 2695 setup_postdata( $post ); 2696 2697 ob_start(); 2698 2699 $styles = wp_media_mce_styles(); 2700 foreach ( $styles as $style ) { 2701 printf( '<link rel="stylesheet" href="%s"/>', $style ); 2702 } 2703 2704 echo do_shortcode( wp_unslash( $_REQUEST['shortcode'] ) ); 2705 2706 if ( ! empty( $wp_scripts ) ) { 2707 $wp_scripts->done = array(); 2708 } 2709 2710 if ( 'playlist' === $_REQUEST['type'] ) { 2711 wp_underscore_playlist_templates(); 2712 2713 wp_print_scripts( 'wp-playlist' ); 2714 } else { 2715 wp_print_scripts( 'wp-mediaelement' ); 2716 } 2717 2718 wp_send_json_success( ob_get_clean() ); 2719 }
Note: See TracChangeset
for help on using the changeset viewer.