• Resolved scorpiohydrogen

    (@scorpiohydrogen)


    I love the widget feature where you can input a Search keyword or phrase to generate a playlist on the fly.

    Can this be done with the [youtube] shortcode within a post or page?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor David Artiss

    (@dartiss)

    You can indeed. Simply use a parameter of “search=yes” and then the search word should be specified instead of a video ID.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    You’re awesome!

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    Is there a parameter for Playlist and User ID also?

    Plugin Contributor David Artiss

    (@dartiss)

    There is! All the information is on here – https://www.ads-software.com/plugins/youtube-embed/.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    Awesome, I’ve played around with it. Is it correct that it doesn’t support normal youtube search operators like intitle:, quotation marks, and commas?

    Quotes can be used to require a search phrase be present. Commas can let you specify filters after the search, like with regard to upload date, to only show videos from the recent week or month for example.

    Or is your search code essentially putting quotes around the entire phrase inside?

    Plugin Contributor David Artiss

    (@dartiss)

    It should support everything YouTube allows. You need to put quotes around the search term so that WordPress doesn’t think each word is a parameter of the plugin. However, this isn’t passed into the search to YouTube. You can use double or single quotes around your search term.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    I’m not having any luck. Try this:

    [youtube search=yes]baked salmon gordon ramsay[/youtube]

    [youtube search=yes]”baked salmon” “gordon ramsay”[/youtube]

    [youtube search=yes]intitle:”baked salmon” intitle:”gordon ramsay”[/youtube]

    The 2nd and 3rd produce no results, even though entering them into youtube directly produces results.

    Plugin Contributor David Artiss

    (@dartiss)

    Hmm, I see the issue here. The only way to pass a search parameter to YouTube is to place it in quotes, which are then conflicting with those within the search.

    I’ll need to add this to a list of things I need to look at. Hopefully, I’ll find a fix for this.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    When you write a fix, there are also other search operators like commas:

    Gordon Ramsay Salmon, month, HD

    That will give all HD videos in the last month.

    Or

    Presidential Debate, live
    Kevin Hart, film
    Wall Street Journal, channel
    Joe Rogan, long

    Here are some articles:

    https://www.gtricks.com/youtube/youtube-search-operators/
    https://www.labnol.org/internet/youtube-search/19261/

    Plugin Contributor David Artiss

    (@dartiss)

    I don’t believe commas should cause problems – just quotes.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    The commas do not perform the filtering that they do when entered directly on Youtube is what I’m saying. On Youtube, they call the secondary Filters as if you performed the search and then clicked FILTER and made some selections from the columns UPLOAD DATE, TYPE, DURATION, and FEATURES.

    But when using commas with your shortcode, for example:

    [youtube search=yes]gordon ramsay, today[/youtube]

    It sends the word “today” as a search term, so it results in his appearances on the Today show, or put out by the channel called Today. In other words, it doesn’t filter by Upload Date. I’m just giving you this info so when you get around to working on your code, you will have all the necessary data to try to provide full functionality. Being able to call those filters from your short code, in addition to using quotes and the “intitle:” term, would make your plugin exponentially more powerful and more awesome!

    Thanks!

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    The quotes and commas seem to work perfectly when I use your widget, just not the shortcode.

    Thread Starter scorpiohydrogen

    (@scorpiohydrogen)

    Actually sorry, the commas don’t work, but the quotes do.

    Plugin Contributor David Artiss

    (@dartiss)

    That’s very odd – not what I’d expect. Okay, I’ll add this to the issues list and try and get it investigated as soon as I can.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Shortcode supporting YouTube Search?’ is closed to new replies.