BBP_Admin::register_admin_styles()

Registers the bbPress admin styling and color schemes


Description Description

Because wp-content can exist outside of the WordPress root, there is no way to be certain what the relative path of admin images is.


Source Source

File: includes/admin/classes/class-bbp-admin.php

	public function register_admin_styles() {

		// RTL and/or minified
		$suffix  = is_rtl() ? '-rtl' : '';
		$suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

		// Get the version to use for JS
		$version = bbp_get_version();

		// Register admin CSS with dashicons dependency
		wp_register_style( 'bbp-admin-css', $this->css_url . 'admin' . $suffix . '.css', array( 'dashicons' ), $version );

		// Color schemes are not available when running out of src
		if ( false !== strpos( plugin_basename( bbpress()->file ), 'src' ) ) {
			return;
		}

		// Mint
		wp_admin_css_color(
			'bbp-mint',
			esc_html_x( 'Mint', 'admin color scheme', 'bbpress' ),
			$this->styles_url . 'mint/colors' . $suffix . '.css',
			array( '#4f6d59', '#33834e', '#5FB37C', '#81c498' ),
			array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
		);

		// Evergreen
		wp_admin_css_color(
			'bbp-evergreen',
			esc_html_x( 'Evergreen', 'admin color scheme', 'bbpress' ),
			$this->styles_url . 'evergreen/colors' . $suffix . '.css',
			array( '#324d3a', '#446950', '#56b274', '#324d3a' ),
			array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' )
		);
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.