Plugin Directory

Changeset 2443968


Ignore:
Timestamp:
12/21/2020 11:53:03 PM (5 years ago)
Author:
remixdvoice
Message:

added support for amp

Location:
remixd-voice
Files:
12 added
3 edited

Legend:

Unmodified
Added
Removed
  • remixd-voice/trunk/README.txt

    r2431936 r2443968  
    66Tested up to: 5.6
    77Requires PHP: 5.6
    8 Stable tag: 1.0.5
     8Stable tag: 1.0.6
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58= 1.0.6=
     59* AMP (Accelerated Mobile Pages) support
     60
    5861= 1.0.5 =
    5962* Fixed version control
  • remixd-voice/trunk/lib/remixd-player.php

    r2431935 r2443968  
    4949            $player_tag = '<div class="wp-remixd-voice-wrapper">' . $this->get_player_tag() . '</div>';
    5050
    51             if ($this->options['display'] == 1) :
    52                 $content_with_remixd = $player_tag . $content;
    53                 return $content_with_remixd;
    54             endif;
     51            if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) :
     52                global $post;
     53                $player_amp_tag = '<div class="wp-remixd-voice-wrapper">' . str_replace("STANDARD_PAGE_PERMALINK", esc_url( get_permalink() ), REMIXD_AMP_TAG) . '</div>';
    5554
    56             global $post;
    57             $remixd_voice = get_post_meta($post->ID, 'remixd_voice', true);
    58 
    59             if (isset($remixd_voice) && $remixd_voice == 'on') :
    60                 $content_with_remixd = $player_tag . $content;
    61                 return $content_with_remixd;
    62             endif;
     55                return $player_amp_tag . $content;
     56            else :
     57                if ($this->options['display'] == 1) :
     58                    $content_with_remixd = $player_tag . $content;
     59                   
     60                    return $content_with_remixd;
     61                endif;
     62   
     63                global $post;
     64                $remixd_voice = get_post_meta($post->ID, 'remixd_voice', true);
     65   
     66                if (isset($remixd_voice) && $remixd_voice == 'on') :
     67                    $content_with_remixd = $player_tag . $content;
     68                   
     69                    return $content_with_remixd;
     70                endif;
     71            endif;
    6372
    6473            return $content;
  • remixd-voice/trunk/remixd.php

    r2431936 r2443968  
    44 * Plugin URI: https://www.remixd.com/
    55 * Description: Remixd’s Audicles&trade; utilize publisher text and converts it into playable audio for easy and convenient on page consumption.
    6  * Version: 1.0.5
     6 * Version: 1.0.6
    77 * Author: Remixd Voice
    88 **/
     
    3232}
    3333
     34if (!defined('REMIXD_AMP_TAG')) {
     35    define('REMIXD_AMP_TAG', '<amp-ad type="remixd" height="100" width="640" data-version="5" style="max-width: 100%;" data-url="STANDARD_PAGE_PERMALINK"></amp-ad>');
     36}
     37
    3438
    3539require_once REMIXD_PLUGIN_DIR . 'lib/settings.php';
Note: See TracChangeset for help on using the changeset viewer.