slimline_tinymce() - slimline/tinymce GitHub Wiki

Sets up the Slimline TinyMCE plugin.

Source

/**
 * Initialize plugin
 *
 * @link  https://github.com/slimline/tinymce/wiki/slimline_tinymce()
 * @since 0.1.0
 */
function slimline_tinymce() {

	/**
	 * Stop initialization if not in the dashboard
	 *
	 * @link https://developer.wordpress.org/reference/functions/is_admin/
	 *       Documentation of `is_admin` function
	 */
	if ( ! is_admin() ) {
		return;
	} // if ( ! is_admin() )

    /**
     * Enqueue styles to fix wp editor on term and user pages
     *
     * The term and user pages include styles that cause quicktag buttons to span the
     * full width of the editor. We will load some CSS to fix that by setting them to
     * width "auto".
     *
     * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
     *       Documentation of `admin_enqueue_scripts` hook
     */
	add_action( 'admin_enqueue_scripts', 'slimline_tinymce_admin_enqueue_scripts' );

	/**
	 * Add filters to edit-tags page
	 *
	 * @link https://developer.wordpress.org/reference/hooks/load-plugin_page/
	 *       Documentation of `load-{$plugin_page}` hook
	 */
	add_action( 'load-edit-tags.php', 'slimline_add_term_tinymce' );

	/**
	 * Add filters to profile page
	 *
	 * @link https://developer.wordpress.org/reference/hooks/load-plugin_page/
	 *       Documentation of `load-{$plugin_page}` hook
	 */
	add_action( 'load-profile.php', 'slimline_add_user_tinymce' );

	/**
	 * Add filters to user-edit page
	 *
	 * @link https://developer.wordpress.org/reference/hooks/load-plugin_page/
	 *       Documentation of `load-{$plugin_page}` hook
	 */
	add_action( 'load-user-edit.php', 'slimline_add_user_tinymce' );

}

Hook

Fires on plugins_loaded at priority 10

Changelog

  • Since 0.1.0