if(window.addEventListener){function fire(event){externalLink(\''.$img_src.'\',\''.addslashes(get_option('jmd_external_links_alternative')).'\')}window.addEventListener("DOMContentLoaded", fire, false);} else if (window.attachEvent) {function fire(event){externalLink(\''.$img_src.'\',\''.addslashes(get_option('jmd_external_links_alternative')).'\')}window.attachEvent("onload", fire, false);}'; } add_action('wp_footer', 'jmd_generate_output');//outputs script in footer function jmd_accessible_external_links_menu() { add_options_page('Accessible Links Options', 'Accessible Links', 'manage_options', 'my-unique-identifier', 'jmd_settings_page'); } // jmd_settings_page() displays the page content for the Accessible Links settings submenu function jmd_settings_page() { //must check that the user has the required capability if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } // variables for the field and option names $opt_name = 'jmd_external_links_alternative'; $hidden_field_name = 'mt_submit_hidden'; $data_field_name = 'jmd_external_links_alternative'; // Read in existing option value from database $opt_val = get_option( $opt_name ); // See if the user has posted us some information // If they did, this hidden field will be set to 'Y' if (empty($opt_val)) { update_option( $opt_name, "Opens in a new window" ); } if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) { // Read their posted value $opt_val = stripslashes($_POST[ $data_field_name ]); // Save the posted value in the database update_option( $opt_name, $opt_val ); // Put an settings updated message on the screen ?>

'; // header echo "

" . __( 'Accessible external links settings', 'config-menu' ) . "

"; // settings form ?>


/>