PluginProbe ʕ •ᴥ•ʔ
External Links – nofollow, noopener & new window / 2.66
External Links – nofollow, noopener & new window v2.66
2.66 0.31 0.32 0.33 0.34 0.35 1.01 1.02 1.03 1.10 1.20 1.21 1.30 1.31 1.40 1.41 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.60 1.61 1.62 1.70 1.80 1.81 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 2.3 2.32 2.35 2.40 2.42 2.43 2.45 2.46 2.47 2.48 2.50 2.51 2.55 2.56 2.57 2.58 2.59 2.60 2.61 2.62 2.63 2.64 2.65 trunk 0.10 0.11 0.12 0.20 0.21 0.30
wp-external-links / includes / class-wpel-link.php
wp-external-links / includes Last commit date
admin 2 months ago register-hooks 3 years ago class-wpel-front-ignore.php 3 years ago class-wpel-front.php 4 months ago class-wpel-link.php 3 years ago class-wpel-plugin.php 1 year ago class-wpel-register-scripts.php 2 months ago class-wpel-template-tags.php 3 years ago class-wpel-update.php 3 years ago index.php 6 years ago
class-wpel-link.php
101 lines
1 <?php
2 /**
3 * Class WPEL_Link
4 *
5 * This class extends DOMElement which uses the camelCase naming style.
6 * Therefore this class also contains camelCase names.
7 *
8 * @package WPEL
9 * @category WordPress Plugin
10 * @version 2.3
11 * @link https://www.webfactoryltd.com/
12 * @license Dual licensed under the MIT and GPLv2+ licenses
13 */
14 class WPEL_Link extends FWP_HTML_Element_1x0x0
15 {
16
17 /**
18 * Mark as external link (by setting data attribute)
19 */
20 public function set_external()
21 {
22 $this->set_attr( 'data-wpel-link', 'external' );
23 }
24
25 /**
26 * Is marked as external link
27 * @return boolean
28 */
29 public function is_external()
30 {
31 return 'external' === $this->get_attr( 'data-wpel-link' ) || $this->has_attr_value( 'rel', 'external' );
32 }
33
34 /**
35 * Mark as internal link (by setting data attribute)
36 */
37 public function set_internal()
38 {
39 $this->set_attr( 'data-wpel-link', 'internal' );
40 }
41
42 /**
43 * Is marked as internal link
44 * @return boolean
45 */
46 public function is_internal()
47 {
48 return 'internal' === $this->get_attr( 'data-wpel-link' );
49 }
50
51 /**
52 * Mark as excluded link (by setting data attribute)
53 */
54 public function set_exclude()
55 {
56 $this->set_attr( 'data-wpel-link', 'exclude' );
57 }
58
59 /**
60 * Is marked as excluded link
61 * @return boolean
62 */
63 public function is_exclude()
64 {
65 return 'exclude' === $this->get_attr( 'data-wpel-link' );
66 }
67
68 /**
69 * Mark as ignored link (by setting data attribute)
70 */
71 public function set_ignore()
72 {
73 $this->set_attr( 'data-wpel-link', 'ignore' );
74 }
75
76 /**
77 * Is marked as ignored link
78 * @return boolean
79 */
80 public function is_ignore()
81 {
82 return 'ignore' === $this->get_attr( 'data-wpel-link' );
83 }
84
85 /**
86 * Check url is mailto link
87 * @return boolean
88 */
89 public function is_mailto()
90 {
91 $url = trim( $this->get_attr( 'href' ) );
92
93 if ( substr( $url, 0, 7 ) === 'mailto:' ) {
94 return true;
95 }
96
97 return false;
98 }
99
100 }
101