Changeset 3208637
- Timestamp:
- 12/16/2024 02:55:44 PM (16 months ago)
- Location:
- customize-external-links-and-add-icon/trunk
- Files:
-
- 4 edited
-
customize-external-links-form.php (modified) (2 diffs)
-
customize-external-links.php (modified) (4 diffs)
-
customizer-external-links-initiate.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
customize-external-links-and-add-icon/trunk/customize-external-links-form.php
r3126790 r3208637 1 2 1 <?php 3 2 … … 62 61 } 63 62 64 // CHECKBOX - Name: plugin_options[chkNoFollow] 65 function cuexlinks_setting_plugin_chknoopener_fn() 66 { 67 $checked = ""; 68 69 $options = get_option('plugin_options'); 70 if (isset($options['chkNoOpener'])) { 71 $checked = ' checked="checked" '; 72 } 73 ?> 74 75 <input <?=$checked?> 76 id='plugin_chknoopener' 77 name='plugin_options[chkNoOpener]' 78 type='checkbox' /> 79 <?php 80 } 81 63 // CHECKBOX - Name: plugin_options[chkNoReferrer] 82 64 function cuexlinks_setting_plugin_chknoreferrer_fn() 83 65 { -
customize-external-links-and-add-icon/trunk/customize-external-links.php
r3126790 r3208637 5 5 * Description: Add nofollow and remove noreferrer attributes in external links. Choose between different icons to show users which link is an external one. 6 6 * Author: blapps 7 * Version: 2. 27 * Version: 2.3 8 8 * Tested up to: 6.6 9 9 * Text Domain: customize-external-links … … 283 283 } 284 284 285 function cuexlinks_get_icon() 286 { 287 // $items = array("None", "fa-external-link-square-alt", "fa-external-link-alt", "ascii-8599", "ascii-8625", "ascii-8663"); 288 // $item_tag = array("None", "<i class=\"fas fa-external-link-square-alt\"></i> Icon by Fontawesome", "<i class=\"fas fa-external-link-alt\"></i> Icon by Fontawesome", "↗ (recommened)", "↱", "⇗"); 285 function cuexlinks_get_icon() { 286 // Get the plugin options 287 $options = get_option('plugin_options'); 288 289 // Check if $options is a valid array 290 if (!is_array($options)) { 291 // If not, return an empty string or handle the error 292 return ''; 293 } 289 294 290 295 $icon = ""; 291 $options = get_option('plugin_options'); 292 296 297 // Ensure the 'option_iconType' key exists in the options array 293 298 switch ($options['option_iconType']) { 294 299 case "fa-external-link-square-alt": … … 308 313 break; 309 314 case "manual": 310 $icon = $options['text_manual']; 311 break; 312 case "None"; 315 // Check if 'text_manual' is set in options 316 $icon = isset($options['text_manual']) ? $options['text_manual'] : ''; 317 break; 318 case "None": 313 319 break; 314 320 default: … … 316 322 break; 317 323 } 324 318 325 return $icon; 319 326 } 327 320 328 321 329 function cuexlinks_closing_parse($content) -
customize-external-links-and-add-icon/trunk/customizer-external-links-initiate.php
r3126790 r3208637 55 55 function cuexlinks_fontawesome_admin() 56 56 { 57 wp_enqueue_style('fontawesome', 'https://use.fontawesome.com/releases/v6. 6.0/css/all.css');57 wp_enqueue_style('fontawesome', 'https://use.fontawesome.com/releases/v6.7.1/css/all.css'); 58 58 } 59 59 … … 90 90 91 91 $options = get_option('plugin_options'); 92 if (strpos($options['option_iconType'], 'external')) { 93 add_action('wp_enqueue_scripts', 'cuexlinks_add_fawesome'); 92 93 // Check if $options is an array and if the 'option_iconType' key exists 94 if (is_array($options) && isset($options['option_iconType'])) { 95 // Use strpos safely since we now know 'option_iconType' exists 96 if (strpos($options['option_iconType'], 'external') !== false) { 97 add_action('wp_enqueue_scripts', 'cuexlinks_add_fawesome'); 98 } 99 } else { 100 // Handle the case where the option is missing, for example, by logging or setting default values. 101 // You could set a default empty array to prevent further issues: 102 $options = array(); 94 103 } 104 95 105 96 106 function cuexlinks_add_fawesome() -
customize-external-links-and-add-icon/trunk/readme.txt
r3126790 r3208637 2 2 Contributors: blapps 3 3 Donate link: 4 Tags: nofollow, noreferer, icon external link, nofollow links, external links, nofollow for external links, nofollow external link, nofollow external links, custom icons, remove noreferrer , no opener4 Tags: nofollow, noreferer, icon external link, nofollow links, external links, nofollow for external links, nofollow external link, nofollow external links, custom icons, remove noreferrer 5 5 Requires at least: 4 6 6 Tested up to: 6.6 7 Stable tag: 2. 27 Stable tag: 2.3 8 8 License: GPL2 9 9 … … 12 12 == Description == 13 13 14 This plugin adds and removes link relations such as nofollow and noreferrer to your external links. Furthermore, indication of external links by adding a custom icon to the link text. This plugin also adds automatically that external links will be open ded in annew tab.14 This plugin adds and removes link relations such as nofollow and noreferrer to your external links. Furthermore, indication of external links by adding a custom icon to the link text. This plugin also adds automatically that external links will be opened in a new tab. 15 15 16 16 * Add rel=nofollow for all the external links of your posts / pages / menus … … 58 58 59 59 = 2.2 = 60 - ready for WP 6.661 60 - minor bugfixes 62 61 - Fontawesome resource updated 63 - added noopener 62 64 63 65 64 = 2.1 =
Note: See TracChangeset
for help on using the changeset viewer.