• Resolved barkgj

    (@barkgj)


    The postcontent is not parsed for autoembed links. I would like to see the [content] shortcode to prcoess autoembed links by default, and perhaps optionally having the ability to turn that behaviour off. Note that the ORDER in which this is aplpied is very important; first process the autoembed content and afterwards remove the do the wpautop, otherwise the parsing of the embedded links would fail.

    I would recommend first applying the shortcodes, and afterwards trying to parse the autoembed part.

    Like so:

    if($shortcode_option != ‘false’) { // Shortcode?
    $out = do_shortcode( $out );
    }

    if (true) // $content_autoembed == ‘true’)
    {
    $wp_embed = $GLOBALS[‘wp_embed’];
    $out = $wp_embed->autoembed($out);
    }

    if($content_format == ‘true’) { // Format?
    $out = wpautop( $out );
    }

    Let me know your thoughts 🙂

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Thanks for the suggestion – sure, I can implement this.

    I’m not sure if it should autoembed by default, because it would be an extra pass through everything the content shortcode outputs: content, fields, etc.

    How about autoembed can be on by default for post content only (for example, [content] within a loop) and optional for fields?

    Thread Starter barkgj

    (@barkgj)

    I didn’t even know that replacing the video links was a feature of WP, but a client of us informed me that the embedded video’s didn’t show up (and I was using the [content] shortcode. Thus, my advise would be to have this be the default behaviour (as you suggested) for posts (but I would do the same for pages, as I am 99% sure WP does the same for pages).

    In this way your plugin would behave in the same was as WP does by default, which is I think what you try to accomplish. Optionally, you could make it not do the autoembedding, by using a parameters in the shortcode, like [content autoembed=’false’] or so.

    Just in case you are wondering; we have created a front-end editor, and I use your plugin to position/place the WP “backend” content (postcontent) in draggable locations and thus would like the behaviour of [content] to be 1:1 with the behaviour of normal output of WP.

    Thanks!

    Plugin Author Eliot Akira

    (@miyarakira)

    I just made another update to implement autoembed. It makes sense what you say, to output the post content the same as default behavior. I made it an option for fields, in case someone wants to autoembed links in there also.

    It made it easier for me, since you gave me the code for that part. Thanks!

    Very interesting to hear how you’re using it, especially for a front-end editor. I’m curious to see it! 🙂

    Thread Starter barkgj

    (@barkgj)

    Actually I created a video yesterday here that explains how we use the plugin and [content] shortcode, in combination with the front-end editing. See the video here. For other video’s check our support section. Let me know if you would like to use one of our themes, I can provide you one for free if you would be interested to see how it works 🙂

    Plugin Author Eliot Akira

    (@miyarakira)

    I saw the video – wow, that’s quite a system! I’m curious about the front-end editing feature – I see you have one free theme, so I’ll download it to get to know how it works.

    Thank you for mentioning my plugin in the video. I appreciate the feedback also, it helps me to keep improving the plugin to work in different situations.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Video links are not converted to embedded content’ is closed to new replies.