Plugin Directory

Changeset 1635174


Ignore:
Timestamp:
04/11/2017 10:10:02 AM (9 years ago)
Author:
greatestview
Message:

now working for teaser as well

Location:
replace-thumbnail-with-oembed/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • replace-thumbnail-with-oembed/trunk/readme.txt

    r1634091 r1635174  
    55Requires at least: 4.0
    66Tested up to: 4.7.3
    7 Stable tag: 1.1.1
     7Stable tag: 1.2
    88License: GNU General Public License v3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1414This plugin checks, if the first line of the content is a valid oEmbed URL. If that is the case, it replaces the thumbnail image with the oEmbed element (e. g. with a YouTube video). Now you don’t have to care too much about a thumbnail image, since instead you would see the video or any other oEmbed content. You can even e. g. watch videos on your blogs front page without opening the post.
    1515
    16 Works for all is_singular() WordPress contents, which have a thumbnail set and are not password protected.
     16Works for all WordPress contents, which have a thumbnail set and are not password protected.
     17
     18The active WordPress Theme must use the_post_thumbnail() or get_the_post_thumbnail() functions for this to work!
    1719
    1820== Installation ==
     
    3133== Changelog ==
    3234
     35= 1.2 =
     36* Now working for teaser as well
     37
    3338= 1.1 =
    3439* Disabled, when passwort protection is active
  • replace-thumbnail-with-oembed/trunk/replace-thumbnail-with-oembed.php

    r1634091 r1635174  
    33/**
    44 * Plugin Name: Replace Thumbnail with oEmbed
    5  * Description: This plugin checks, if the first line of the content is a valid oEmbed URL. If that is the case, it replaces the thumbnail image with the oEmbed element (e. g. with a YouTube video). Now you don’t have to care too much about a thumbnail image, since instead you would see the video or any other oEmbed content. You can even e. g. watch videos on your blogs front page without opening the post. Works for all is_singular() WordPress contents, which have a thumbnail set and are not password protected.
    6  * Version:     1.1.1
     5 * Description: This plugin checks, if the first line of the content is a valid oEmbed URL. If that is the case, it replaces the thumbnail image with the oEmbed element (e. g. with a YouTube video). Now you don’t have to care too much about a thumbnail image, since instead you would see the video or any other oEmbed content. You can even e. g. watch videos on your blogs front page without opening the post. Works for all WordPress contents, which have a thumbnail set and are not password protected. The active WordPress Theme must use the_post_thumbnail() or get_the_post_thumbnail() functions for this to work!
     6 * Version:     1.2
    77 * Author:      Palasthotel <[email protected]> (Kim-Christian Meyer)
    88 * Author URI:  https://palasthotel.de
     
    1414
    1515function replace_thumbnail_with_oembed_apply( $html ) {
    16     if ( is_singular() && has_post_thumbnail() && ! post_password_required() ) {
     16    if ( ! is_attachment() && has_post_thumbnail() && ! post_password_required() ) {
    1717        $oembed_html = replace_thumbnail_with_oembed_replace_first_line_of_content_with_oembed();
    1818        if ( $oembed_html !== false ) {
Note: See TracChangeset for help on using the changeset viewer.