• When you insert an uploaded video through the back-end editor, (Using “Add Media” button), it is seen as a [video] shortcode in the Text mode, but as a normal video tag in the Visual mode.

    However, this is not the case when inserting a video in the front-end editor that was created using the wp_editor function. Images get inserted just like in back-end, but videos are shown as [video] shortcodes in both Visual and Text modes. It seems that there is some Text-Visual shortcode conversion script missing in the front-end editor.

    Any solution to this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey Promaty. Im having the exact same issue right now. I have managed to get the front end wp_editor to render shortcodes, but when I try using audio/video shortcodes or straight audio/video urls, it doesnt render the player like it does on the admin side.

    I dont have an answer im afraid, but was wondering if you managed to figure it out?

    Thread Starter promaty

    (@promaty)

    No not yet. Programming in wp_editor seems to be one of the most complicated parts of WordPress, so I’m still hoping for an expert to reply to this…

    wpismypuppet

    (@wordpressismypuppet)

    Can you show the code you are using to create the editor in the front end?

    Thread Starter promaty

    (@promaty)

    @wpismypuppet, I’m testing on a completely fresh installation, just putting:
    <?php wp_editor('test','test') ?>

    in header.php of twentysixteen theme. This is clearly not implemented, so I’m wondering what kind of script is missing and can I reuse the same one from the back end.

    Hey Promaty, I think not all the editor scripts are loaded in frontend…
    try to use this

    
    add_action( 'wp_enqueue_scripts', 'frontend_editor_scripts' );
    function frontend_editor_scripts() {
    	/*Media Scripts*/
        wp_enqueue_media();
        /*Editor View*/
        wp_enqueue_script('mce-view');
    
    }
    
    Thread Starter promaty

    (@promaty)

    OMG IT WORKS, I LOVE YOU! 😀

    You are welcome 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Video Shortcode preview in visual front-end wp_editor’ is closed to new replies.