CSS Organizer

The CSS Organizer plugin has a useful hook for developers to use to further enhance its functionality.

cssorganizer_expand_btns

TYPE ⇢ Filter

Modify the array of expand button width percentages used in the Customizer section. This allows developers to add, remove, or reorder available width options for the expand buttons shown above each CSS editor section, note that 18% is the default.

Example Usage

PHP
/**
 * Add a 65% expand button to CSS Organizer.
 *
 * @param array $expand_btns Array of width percentages for expand buttons.
 * @return array Modified array of expand button widths.
 */
add_filter( 'cssorganizer_expand_btns', function( $expand_btns ) {
    // Add a button for 65% width
    $expand_btns[] = 65;

    // Sort the array so buttons appear in ascending order
    sort( $expand_btns );

    return $expand_btns;
} );

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.