Plugin Directory

Changeset 2649883

Timestamp:
12/28/2021 09:42:24 AM (4 years ago)
Author:
micropat
Message:

1.8.3

  • Update AMP support
  • Update vertical floating share buttons bar for AMP pages
    • Supports "Left docked" or "Right docked" placement options
  • Update horizontal floating share buttons bar for AMP pages
    • Full width layout overrides placement options
  • Add round corners to AMP share buttons in content
  • Skip plugin scripts on AMP pages
Location:
add-to-any/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • add-to-any/trunk/README.txt

    r2631805 r2649883  
    55Tested up to: 5.8
    66Requires PHP: 5.6
    7 Stable tag: 1.8.2
     7Stable tag: 1.8.
    88
    99Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, WhatsApp, Pinterest, Reddit, many more, and follow icons too.
     
    346346
    347347== Changelog ==
     348
     349
     350
     351
     352
     353
     354
     355
     356
    348357
    349358= 1.8.2 =
  • add-to-any/trunk/add-to-any.php

    r2631805 r2649883  
    44 * Plugin URI: https://www.addtoany.com/
    55 * Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, LinkedIn, Pinterest, WhatsApp and many more.
    6  * Version: 1.8.2
     6 * Version: 1.8.
    77 * Author: AddToAny
    88 * Author URI: https://www.addtoany.com/
     
    359359            // Use AMP's "print" action.
    360360            if ( $is_amp && 'print' === $code_name ) {
    361                 $amp_on_attr = 'on="tap:AMP.print()"';
    362                 $href_attr = '#';
     361                $amp_on_attr = ' on="tap:AMP.print()"';
     362                $href_attr = ' href="#print"';
     363                $target_attr = '';
    363364            } else {
    364365                $amp_on_attr = '';
     
    366367
    367368            // Set dimension attributes if using custom icons and dimension is specified.
    368             if ( isset( $custom_icons ) ) {
     369            if ( isset( $custom_icons ) ) {
    369370                $width_attr = ! empty( $icons_width ) ? ' width="' . $icons_width . '"' : '';
    370371                $height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
     
    756757    }
    757758    else {
    758         // Output escaped HTML without stripping out positional styles as wp_kses* does.
     759        // Output escaped HTML without stripping out positional styles as wp_kses* does.
    759760        echo addtoany_kses( $floating_html );
    760761    }
     
    767768    $floating_html = ADDTOANY_SHARE_SAVE_FLOATING( array( 'output_later' => true ) );
    768769   
    769     // Output escaped HTML without stripping out positional styles as wp_kses* does.
     770    // Output escaped HTML without stripping out positional styles as wp_kses* does.
    770771    echo addtoany_kses( $floating_html );
    771772}
     
    923924   
    924925    if ( ! is_admin() ) {
    925         wp_enqueue_style( 'addtoany', plugins_url('/addtoany.min.css', __FILE__ ), false, '1.15' );
    926        
    927926        // Prepare inline CSS.
    928927        $inline_css = '';
     928
     929
     930
     931
     932
     933
     934
     935
     936
     937
    929938       
    930939        $vertical_type = ( isset( $options['floating_vertical'] ) && 'none' != $options['floating_vertical'] ) ? $options['floating_vertical'] : false;
     
    944953            // Set media query.
    945954            $inline_css .= '@media screen and (max-width:' . $vertical_max_width . 'px){' . "\n"
    946                 . '.a2a_floating_style.a2a_vertical_style{display:none;}' . "\n"
     955                . '.a2a_floating_style.a2a_vertical_style{display:none;}' . "\n"
    947956                . '}';
    948957        }
     
    964973            // Set media query.
    965974            $inline_css .= '@media screen and (min-width:' . $horizontal_min_width . 'px){' . "\n"
    966                 . '.a2a_floating_style.a2a_default_style{display:none;}' . "\n"
     975                . '.a2a_floating_style.a2a_default_style{display:none;}' . "\n"
    967976                . '}';
    968977        }
     
    9941003    // Example: add_filter( 'addtoany_script_disabled', '__return_true' );
    9951004    $script_disabled = apply_filters( 'addtoany_script_disabled', false );
    996    
    997     if ( is_admin() || is_feed() || $script_disabled )
     1005
     1006    $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
     1007   
     1008    if ( is_admin() || is_feed() || $script_disabled || $is_amp )
    9981009        return;
    9991010
  • add-to-any/trunk/addtoany.compat.php

    r2623086 r2649883  
    22
    33/**
    4  * Strips out disallowed HTML using wp_kses_post() while temporarily allowing some additional CSS in a style attribute.
     4 * Strips out disallowed HTML using wp_kses_post() while temporarily allowing
     5 * some additional HTML attributes and CSS in a style attribute.
    56 */
    67function addtoany_kses( $string ) {
     
    1819
    1920    // Strip out any disallowed HTML.
    20     $string = wp_kses_post( $string );
     21    $string = wp_kses );
    2122   
    2223    // Revert kses filters to originals.
    23     remove_filter( 'safe_style_css', 'allow_css_properties' );
     24    remove_filter( 'safe_style_css', 'allow_css_properties' );
    2425    remove_filter( 'safecss_filter_attr_allow_css', 'addtoany_kses_allow_css_declarations', 10, 2 );
    2526
    2627    return $string;
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
    2738}
    2839
     
    7182        }   
    7283    }
    73 }
    74 
    75 /**
    76  * Load AMP (Accelerated Mobile Pages) compatibility functions.
    77  */
    78 
    79 add_action( 'amp_post_template_css', 'addtoany_amp_additional_css_styles' );
    80 
    81 function addtoany_amp_additional_css_styles( $amp_template ) {
    82     // CSS only.
    83     ?>
    84     .addtoany_list a {
    85         padding: 0 4px;
    86     }
    87     .addtoany_list a amp-img {
    88         display: inline-block;
    89     }
    90     <?php
    9184}
    9285
Note: See TracChangeset for help on using the changeset viewer.