@@ -156,6 +156,7 @@ public function update( $new_instance, $old_instance ) {
156156 $ instance ['display_arch_arr ' ] = isset ( $ new_instance ['display_arch_arr ' ] ) ? true : false ;
157157 $ instance ['new_tab ' ] = isset ( $ new_instance ['new_tab ' ] ) ? true : false ;
158158 $ instance ['nofollow ' ] = isset ( $ new_instance ['nofollow ' ] ) ? true : false ;
159+ $ instance ['noreferrer ' ] = isset ( $ new_instance ['noreferrer ' ] ) ? true : false ;
159160 $ instance ['items_order ' ] = pinboard_bookmarks_check_items ( $ new_instance ['items_order ' ] );
160161 $ instance ['admin_only ' ] = isset ( $ new_instance ['admin_only ' ] ) ? true : false ;
161162 $ instance ['debug_options ' ] = isset ( $ new_instance ['debug_options ' ] ) ? true : false ;
@@ -267,7 +268,7 @@ public function form( $instance ) {
267268 'value ' => 'instapaper ' ,
268269 'desc ' => esc_html__ ( 'Instapaper ' , 'pinboard-bookmarks ' ),
269270 ),
270- 'pinboard ' => array (
271+ 'pinboard ' => array (
271272 'value ' => 'pinboard ' ,
272273 'desc ' => esc_html__ ( 'Pinboard ' , 'pinboard-bookmarks ' ),
273274 ),
@@ -422,6 +423,7 @@ public function form( $instance ) {
422423 $ instance ['display_source ' ]
423424 );
424425 ?>
426+
425427 <h4><?php esc_html_e ( 'Display site URL ' , 'pinboard-bookmarks ' ); ?> </h4>
426428
427429 <?php
@@ -501,6 +503,49 @@ public function form( $instance ) {
501503 );
502504 ?>
503505
506+ <h4><?php esc_html_e ( 'Links relationship ' , 'pinboard-bookmarks ' ); ?> </h4>
507+
508+ <?php
509+ // Open links in new tab.
510+ pinboard_bookmarks_form_checkbox (
511+ esc_html__ ( 'Open links in a new browser tab ' , 'pinboard-bookmarks ' ),
512+ $ this ->get_field_id ( 'new_tab ' ),
513+ $ this ->get_field_name ( 'new_tab ' ),
514+ $ instance ['new_tab ' ],
515+ sprintf (
516+ // translators: the placeholder is the "noopener rel attribute.
517+ esc_html__ ( 'If activated, the rel attribute %s will be added. ' , 'pinboard-bookmarks ' ),
518+ '<code>noopener</code> '
519+ )
520+ );
521+
522+ // No follow.
523+ pinboard_bookmarks_form_checkbox (
524+ // translators: %s is a rel attribute for links.
525+ sprintf ( esc_html__ ( 'Add %s to links ' , 'pinboard-bookmarks ' ), '<code>nofollow</code> ' ),
526+ $ this ->get_field_id ( 'nofollow ' ),
527+ $ this ->get_field_name ( 'nofollow ' ),
528+ $ instance ['nofollow ' ],
529+ esc_html__ ( 'It will be added to all external links. ' , 'pinboard-bookmarks ' )
530+ );
531+
532+ // No referrer.
533+ pinboard_bookmarks_form_checkbox (
534+ // translators: %s is a rel attribute for links.
535+ sprintf ( esc_html__ ( 'Add %s to links ' , 'pinboard-bookmarks ' ), '<code>noreferrer</code> ' ),
536+ $ this ->get_field_id ( 'noreferrer ' ),
537+ $ this ->get_field_name ( 'noreferrer ' ),
538+ $ instance ['noreferrer ' ],
539+ esc_html__ ( 'It will be added to all external links. ' , 'pinboard-bookmarks ' )
540+ );
541+
542+ printf (
543+ // translators: the placeholder is a link.
544+ esc_html__ ( 'For more information about links attributes, please visit %s. ' , 'pinbard-bookmarks ' ),
545+ '<a rel="external noopener noreferrer nofollow" href="https://www.w3schools.com/tags/att_a_rel.asp" target="_blank">w3schools.com</a> '
546+ );
547+ ?>
548+
504549 <h4><?php esc_html_e ( 'Other options ' , 'pinboard-bookmarks ' ); ?> </h4>
505550
506551 <?php
@@ -530,24 +575,6 @@ public function form( $instance ) {
530575 $ this ->get_field_name ( 'display_arrow ' ),
531576 $ instance ['display_arrow ' ]
532577 );
533-
534- // Open links in new tab.
535- pinboard_bookmarks_form_checkbox (
536- esc_html__ ( 'Open links in a new browser tab ' , 'pinboard-bookmarks ' ),
537- $ this ->get_field_id ( 'new_tab ' ),
538- $ this ->get_field_name ( 'new_tab ' ),
539- $ instance ['new_tab ' ]
540- );
541-
542- // No follow.
543- pinboard_bookmarks_form_checkbox (
544- // translators: %s is the nofollow.
545- sprintf ( esc_html__ ( 'Add %s to links ' , 'pinboard-bookmarks ' ), '<code>nofollow</code> ' ),
546- $ this ->get_field_id ( 'nofollow ' ),
547- $ this ->get_field_name ( 'nofollow ' ),
548- $ instance ['nofollow ' ],
549- esc_html__ ( 'It will be added to all external links. ' , 'pinboard-bookmarks ' )
550- );
551578 ?>
552579
553580 <h4><?php esc_html_e ( 'Displaying order ' , 'pinboard-bookmarks ' ); ?> </h4>
0 commit comments