Plugin Directory

Changeset 2470507


Ignore:
Timestamp:
02/07/2021 10:25:21 PM (5 years ago)
Author:
gautierantoine
Message:

update byemail

Location:
socials-ga/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • socials-ga/trunk/README.md

    r2469873 r2470507  
    88Tested up to: 5.5
    99Requires PHP: 7.2
    10 Stable tag: 0.01.00.00
     10Stable tag: 0.01.00.01
    1111License: GPLv3
    1212License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
  • socials-ga/trunk/gaplugin-socials-plugin.php

    r2469873 r2470507  
    77Plugin URI: https://github.com/Gautier-Antoine/gaplugin-socials
    88Description: Plugin for your socials media
    9 Version: 0.01.00.00
     9Version: 0.01.00.01
    1010
    1111Requires at least: 5.2
  • socials-ga/trunk/includes/Follow.php

    r2469873 r2470507  
    7777            rows= "1"
    7878            title="<?php printf( __('Put your %1$s URL', static::LANGUAGE), esc_attr( $args['label_for'] ) ) ?>"
    79           ><?=
    80             esc_url( $args['url'] );
     79          ><?php
     80            if ($args['label_for'] == 'Email' || $args['label_for'] == 'Phone') {
     81              echo esc_attr( $args['url'] );
     82            } else {
     83              echo esc_url( $args['url'] );
     84            }
    8185          ?></textarea>
    8286          <input type="hidden" name="<?= esc_attr( $option_name ) . '[' . esc_attr( $args['id'] ) . '][label_for]' ?>" value="<?= esc_attr( $args['label_for'] ) ?>"></input>
     
    98102              }
    99103            } else {
    100               if ($option['label_for'] === 'Email') {
    101                 $link = 'mailto:';
    102               } elseif ($option['label_for'] === 'Phone') {
    103                 $link = 'tel:';
    104               } else {
    105                 $link = '';
    106               }
    107104              if ( !empty ( $option['url'] ) ) {
     105                if ($option['label_for'] === 'Email') {
     106                  $link = 'mailto:' . esc_attr( $option['url'] );
     107                } elseif ($option['label_for'] === 'Phone') {
     108                  $link = 'tel:' . esc_attr( $option['url'] );
     109                } else {
     110                  $link = esc_url( $option['url'] );
     111                }
     112
    108113                $shortcode .= '
    109114                  <a
    110115                    target="_blank"
    111116                    title="' . __( 'Link to', static::LANGUAGE ) . ' ' . esc_attr( $option['label_for'] ) . '"
    112                     href="' . $link . esc_url( $option['url'] ) . '"
     117                    href="' . $link . '"
    113118                  >
    114119                    <div class="' . strtolower( esc_attr( $option['label_for'] ) ) . '"></div>
     
    131136      foreach ( $options as $id => $option ) {
    132137        if ( $id !== 'settings' ) {
    133           $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ) );
     138          $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] );
    134139          add_settings_field(
    135140            $title,
     
    139144            static::PAGE . static::EXTENSION . '_section',
    140145            [
    141               'label_for' => esc_attr( $option['label_for'] ),
    142               'url' => ( esc_url( $option['url'] ) ) ?: null,
    143               'id' => esc_attr( $id ),
    144               'class' => strtolower( esc_attr( $option['label_for'] ) )
     146              'label_for' => $option['label_for'],
     147              'url' => ( $option['url'] ) ?: null,
     148              'id' => $id,
     149              'class' => strtolower( $option['label_for'] )
    145150            ]
    146151          );
    147152        } else {
    148             $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ) );
     153            $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] );
    149154            add_settings_field(
    150155              $title,
    151               esc_attr( $option['label_for'] ),
     156              $option['label_for'],
    152157              [static::class, 'showText'],
    153158              static::PAGE . static::EXTENSION, // Page
    154159              static::PAGE . static::EXTENSION . '_section',
    155160              [
    156                 'label_for' => esc_attr( $option['label_for'] ),
    157                 'text' => ( esc_attr( $option['text'] ) ) ?: null,
    158                 'id' => esc_attr( $id )
     161                'label_for' => $option['label_for'],
     162                'text' => ( $option['text'] ) ?: null,
     163                'id' => $id
    159164              ]
    160165            );
  • socials-ga/trunk/includes/Share.php

    r2469873 r2470507  
    5757        $option_name = static::getOptionName();
    5858
    59         $checked = ( isset( $args['active'] ) && $args['active'] === '1' ) ? ' checked' : '';
     59        $checked = ( isset( $args['active'] ) && $args['active'] === true ) ? ' checked' : '';
    6060        ?>
    6161          <input
     
    100100              $img =  $option['imgurl']  . get_the_post_thumbnail_url( get_the_ID(), 'full' );
    101101            }
    102             $title = null;
     102            $getTitle = null;
    103103            if ( !empty( $option['titleurl'] ) && !empty( get_the_title() ) ) {
    104               $title =  $option['titleurl']  . get_the_title();
     104              $getTitle =  $option['titleurl']  . get_the_title();
    105105            }
    106             $url = $option['url'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] .  $img  .  $title;
     106            $url = $option['url'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] .  $img  .  $getTitle;
    107107
     108            $title = ( $option['label_for'] === 'Email' ) ? __( 'Share this by', static::LANGUAGE ) : __( 'Share this on', static::LANGUAGE );
    108109            $shortcode .= '
    109110              <a
    110111                target="_blank"
    111                 title="' . __( 'Share this on', static::LANGUAGE ) . ' ' . esc_attr( $option['label_for'] ) . '"
     112                title="' . $title . ' ' . esc_attr( $option['label_for'] ) . '"
    112113                href="' . esc_url( $url ) . '"
    113114              >
     
    130131      foreach ( $options as $id => $option ) {
    131132        if ($id !== 'settings') {
    132           $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ) );
     133          $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] );
    133134          add_settings_field(
    134135            $title,
     
    138139            static::PAGE . static::EXTENSION . '_section',
    139140            [
    140               'label_for' => esc_attr( $option['label_for'] ),
    141               'url' => ($option['url']) ? esc_url( $option['url'] ) : null,
    142               'imgurl' => (!empty($option['imgurl'])) ? esc_html( $option['imgurl'] ) : false,
    143               'titleurl' => ( !empty( $option['titleurl'] ) ) ? esc_html( $option['titleurl'] ) : null,
    144               'active' => ($option['active']) ? esc_attr( $option['active'] ) : 0,
    145               'id' => esc_attr( $id ),
    146               'class' => strtolower( esc_attr( $option['label_for'] ) )
     141              'label_for' => $option['label_for'],
     142              'url' => ($option['url']) ? $option['url'] : null,
     143              'imgurl' => (!empty($option['imgurl'])) ? $option['imgurl'] : false,
     144              'titleurl' => ( !empty( $option['titleurl'] ) ) ? $option['titleurl'] : null,
     145              'active' => (isset($option['active'])) ? $option['active'] : 0,
     146              'id' => $id,
     147              'class' => strtolower( $option['label_for'] )
    147148            ]
    148149          );
    149150        } else {
    150           $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ) );
     151          $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] );
    151152          add_settings_field(
    152153            $title,
    153             esc_attr( $option['label_for'] ),
     154            $option['label_for'],
    154155            [static::class, 'showText'],
    155156            static::PAGE . static::EXTENSION, // Page
    156157            static::PAGE . static::EXTENSION . '_section',
    157158            [
    158               'label_for' => esc_attr( $option['label_for'] ),
    159               'text' => ( $option['text'] ) ? esc_attr( $option['text'] ) : null,
    160               'id' => esc_attr( $id )
     159              'label_for' => $option['label_for'],
     160              'text' => ( $option['text'] ) ? $option['text'] : null,
     161              'id' => $id
    161162            ]
    162163          );
Note: See TracChangeset for help on using the changeset viewer.