'accidental', // 'accidentalWrap' => '', // 'caseSensitive' => false, // 'ignoreWithin' => '.no-accidentals', // 'inputTypes' => "['text']", // 'noteNames' => '[A-H]', // 'noteNameWrap' => '', // 'outerWrap' => '', 'safeMode' => true, 'selector' => 'body' ); add_action('init', 'accidentals_init'); function accidentals_init(){ add_action( 'wp_enqueue_scripts', 'accidentals_add_scripts' ); add_action( 'admin_menu', 'accidentals_menu' ); add_action( 'admin_init', 'accidentals_register_settings' ); } function accidentals_add_scripts() { wp_enqueue_script( 'accidentals', accidentals_get_url( 'js/jquery.accidentals.min.js' ), array( 'jquery' ), $accidentals_version, true ); wp_enqueue_script( 'accidentals-wordpress', accidentals_get_url( 'js/accidentals-wordpress.min.js' ), array( 'jquery', 'accidentals' ), $accidentals_version, true ); $options = get_option('accidentals_options'); if ($options){ wp_localize_script( 'accidentals-wordpress', 'accidentals', $options ); } } function accidentals_menu() { add_options_page( 'Accidentals Options', 'Accidentals', 'manage_options', 'accidentals', 'accidentals_options' ); } function accidentals_register_settings() { register_setting('accidentals-option-group', 'accidentals_options', 'accidentals_sanitize'); } function accidentals_sanitize ($options) { global $accidentals_options_defaults; if( !is_array( $options ) || empty( $options ) || ( false === $options ) ) return $accidentals_options_defaults; foreach( $accidentals_options_defaults as $option_name => $option_value ) { if ($option_name == "safeMode") { //checkbox $options[$option_name] = isset($options[$option_name]) ? 1 : 0; } elseif ( !isset( $options[$option_name] ) || ( strlen($options[$option_name]) < 1 ) ) { $options[$option_name] = $accidentals_options_defaults[$option_name]; } } return $options; } // Add settings link on plugin page function accidentals_options_settings_link($links) { $links[] = 'Settings'; return $links; } add_filter("plugin_action_links_".$plugin = plugin_basename(__FILE__), 'accidentals_options_settings_link' ); function accidentals_get_url( $path = '' ) { return plugins_url( ltrim( $path, '/' ), __FILE__ ); } function accidentals_options() { if ( !current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } ?>
This plugin converts certain text into musical symbols, if it can verify that the user's computer or device supports those symbols. If this cannot be verified, the plugin does not attempt conversions—this is a feature, to prevent unsightly boxes or other placeholders that some computers display instead of musical symbols. More information
| Type this into posts or pages: | It will be displayed on the device you are currently using as: |
|---|---|
| A-natural | A-natural |
| A-flat | A-flat |
| A-sharp | A-sharp |
| A-double-flat | A-double-flat |
| A-double-sharp | A-double-sharp |
Regardless of what you see here, your blog readers may see either symbols or the text as typed, depending on their operating systems, browsers, and installed fonts.
If you are familiar with CSS, symbols can be targeted for styling using the classes accidental (all symbols), accidental-natural, accidental-flat, accidental-sharp, accidental-double-flat, and accidental-double-sharp. Using these classes to apply font-face is not recommended in most cases, as the most common web fonts do not include these musical symbols. If you use CSS to change the font-size, font-weight, or other visual characteristics of the symbols, please test on a variety of systems to ensure that the desired results are being achieved.
Text within containers having a class of no-accidentals will not be affected by the plugin.
You can access more advanced options by disabling this plugin and using jquery.accidentals.js directly in your theme or plugin.