i.mce-i-wp-awld-js-mce-button{background-image: url("' . $GLOBALS['wp_awld_js']->plugin_dir_url . 'inc/assets/images/wp_awld_js_icon.png");}' . "\n"; } /** * TinyMCE External Plugins * * @param array $plugin_array array of external plugins * @return array modified array of external plugins */ function wp_awld_js_mce_external_plugins( $plugin_array ) { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $plugin_array['wp_awld_js_mce_button'] = $GLOBALS['wp_awld_js']->plugin_dir_url . 'inc/assets/js/wp/awld_editor_plugin' . $min . '.js'; return $plugin_array; } /** * TinyMCE Buttons * * @param array $buttons array of buttons * @return array modified array of buttons */ function wp_awld_js_mce_buttons( $buttons ) { array_push( $buttons, "wp_awld_js_mce_button" ); return $buttons; } /** * HTML editor Quicktags * * Add custom Quicktag buttons to the editor Wordpress ver. 3.3 and above only * * Params for this are: * * - Button HTML ID (required) * - Button display, value="" attribute (required) * - Opening Tag (required) * - Closing Tag (required) * - Access key, accesskey="" attribute for the button (optional) * - Title, title="" attribute (optional) * - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional) * * @return void */ add_action( 'admin_print_footer_scripts', '_wp_awld_js_add_quicktags' ); function _wp_awld_js_add_quicktags() { if( get_option( 'wp_awld_js_quicktags' ) != 'yes' || ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) return; global $pagenow; if( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) : ?>