Changeset 2470507
- Timestamp:
- 02/07/2021 10:25:21 PM (5 years ago)
- Location:
- socials-ga/trunk
- Files:
-
- 1 deleted
- 4 edited
-
README.md (modified) (1 diff)
-
gaplugin-socials-plugin.php (modified) (1 diff)
-
gaplugin-socials.zip (deleted)
-
includes/Follow.php (modified) (4 diffs)
-
includes/Share.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
socials-ga/trunk/README.md
r2469873 r2470507 8 8 Tested up to: 5.5 9 9 Requires PHP: 7.2 10 Stable tag: 0.01.00.0 010 Stable tag: 0.01.00.01 11 11 License: GPLv3 12 12 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html -
socials-ga/trunk/gaplugin-socials-plugin.php
r2469873 r2470507 7 7 Plugin URI: https://github.com/Gautier-Antoine/gaplugin-socials 8 8 Description: Plugin for your socials media 9 Version: 0.01.00.0 09 Version: 0.01.00.01 10 10 11 11 Requires at least: 5.2 -
socials-ga/trunk/includes/Follow.php
r2469873 r2470507 77 77 rows= "1" 78 78 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 } 81 85 ?></textarea> 82 86 <input type="hidden" name="<?= esc_attr( $option_name ) . '[' . esc_attr( $args['id'] ) . '][label_for]' ?>" value="<?= esc_attr( $args['label_for'] ) ?>"></input> … … 98 102 } 99 103 } else { 100 if ($option['label_for'] === 'Email') {101 $link = 'mailto:';102 } elseif ($option['label_for'] === 'Phone') {103 $link = 'tel:';104 } else {105 $link = '';106 }107 104 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 108 113 $shortcode .= ' 109 114 <a 110 115 target="_blank" 111 116 title="' . __( 'Link to', static::LANGUAGE ) . ' ' . esc_attr( $option['label_for'] ) . '" 112 href="' . $link . esc_url( $option['url'] ) .'"117 href="' . $link . '" 113 118 > 114 119 <div class="' . strtolower( esc_attr( $option['label_for'] ) ) . '"></div> … … 131 136 foreach ( $options as $id => $option ) { 132 137 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'] ); 134 139 add_settings_field( 135 140 $title, … … 139 144 static::PAGE . static::EXTENSION . '_section', 140 145 [ 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'] ) 145 150 ] 146 151 ); 147 152 } else { 148 $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ));153 $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] ); 149 154 add_settings_field( 150 155 $title, 151 esc_attr( $option['label_for'] ),156 $option['label_for'], 152 157 [static::class, 'showText'], 153 158 static::PAGE . static::EXTENSION, // Page 154 159 static::PAGE . static::EXTENSION . '_section', 155 160 [ 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 159 164 ] 160 165 ); -
socials-ga/trunk/includes/Share.php
r2469873 r2470507 57 57 $option_name = static::getOptionName(); 58 58 59 $checked = ( isset( $args['active'] ) && $args['active'] === '1') ? ' checked' : '';59 $checked = ( isset( $args['active'] ) && $args['active'] === true ) ? ' checked' : ''; 60 60 ?> 61 61 <input … … 100 100 $img = $option['imgurl'] . get_the_post_thumbnail_url( get_the_ID(), 'full' ); 101 101 } 102 $ title = null;102 $getTitle = null; 103 103 if ( !empty( $option['titleurl'] ) && !empty( get_the_title() ) ) { 104 $ title = $option['titleurl'] . get_the_title();104 $getTitle = $option['titleurl'] . get_the_title(); 105 105 } 106 $url = $option['url'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $img . $ title;106 $url = $option['url'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $img . $getTitle; 107 107 108 $title = ( $option['label_for'] === 'Email' ) ? __( 'Share this by', static::LANGUAGE ) : __( 'Share this on', static::LANGUAGE ); 108 109 $shortcode .= ' 109 110 <a 110 111 target="_blank" 111 title="' . __( 'Share this on', static::LANGUAGE ). ' ' . esc_attr( $option['label_for'] ) . '"112 title="' . $title . ' ' . esc_attr( $option['label_for'] ) . '" 112 113 href="' . esc_url( $url ) . '" 113 114 > … … 130 131 foreach ( $options as $id => $option ) { 131 132 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'] ); 133 134 add_settings_field( 134 135 $title, … … 138 139 static::PAGE . static::EXTENSION . '_section', 139 140 [ 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'] ) 147 148 ] 148 149 ); 149 150 } else { 150 $title = static::PAGE . static::EXTENSION . '_' . strtolower( esc_attr( $option['label_for'] ));151 $title = static::PAGE . static::EXTENSION . '_' . strtolower( $option['label_for'] ); 151 152 add_settings_field( 152 153 $title, 153 esc_attr( $option['label_for'] ),154 $option['label_for'], 154 155 [static::class, 'showText'], 155 156 static::PAGE . static::EXTENSION, // Page 156 157 static::PAGE . static::EXTENSION . '_section', 157 158 [ 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 161 162 ] 162 163 );
Note: See TracChangeset
for help on using the changeset viewer.