Description
Create the external link warning Alert boxAdd jQuery to produce a confirmation warning message when clicking on external links Note: There is no special logic for WordPress MultiSite configurations.
Usage
$string = oik_external_link_warning();Parameters
Returns
string the alert textSource
File name: oik-external-link-warning/oik-external-link-warning.phpLines:
1 to 16 of 16
function oik_external_link_warning() { $alert_text = bobbcomp::bw_get_option( "external_link_warning", "oik_elw_options" ); if ( $alert_text ) { //$allowed_hosts = "www.oik-plugins.com" ; $safe_alert_text = esc_js( $alert_text ); //bw_trace2( $safe_alert_text, "safe_alert_text", false ); $selector = "a[href^='http://']:not([href*='\"+location.hostname+\"']), [href^='https://']:not([href*='\"+location.hostname+\"'])" ; bw_jquery( $selector , "click" , "function(e) { var r = confirm( \"$safe_alert_text\" ); return( r ); } " ); } return( $alert_text ); }View on GitHub
Invoked by
Calls
1 to 1 of 1
Call hooks
API Letters:
