send_to_editor get audio address and id

这个方法会导致 WordPress 编辑器原本的插入媒体功能失效!

send_audio_to_editor

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
add_filter('media_send_to_editor', 'media_editor', 1, 3);
function media_editor($html, $send_id, $attachment ){
    //get the media's guid and append it to the html
    //$post = get_post($send_id);
    //$html .= ''.$send_id.'"';
    $html = str_replace('<a', '<a="" smid=".$send_id,  $html);     return $html; } add_action("admin_init", "yao_post_fields_init"); function yao_post_fields_init() {     add_meta_box("post_fields", "Post fields :", "yao_post_fields", " post');="" add_action('save_post',="" 'xxxx_save_post_fields');="" }="" function="" yao_post_fields()="" {="" global="" $post;="" $_post_fields="get_post_meta($post-">ID, "yao_post_fields", true);

    ?>

 

 

 

Link
Audio View document 

‘; } ?>

 


Comments

1,147 responses to “send_to_editor get audio address and id”