Skip to:
Content

bbPress.org

Changeset 4315


Ignore:
Timestamp:
11/03/2012 07:57:14 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Settings:

  • Hide theme compat package selection setting if only 1 package is registered.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/admin.php

    r4285 r4315  
    137137        // Map settings capabilities
    138138        add_filter( 'bbp_map_meta_caps',   array( $this, 'map_settings_meta_caps' ), 10, 4 );
     139
     140        // Hide the theme compat package selection
     141        add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );
    139142
    140143        /** Network Admin *****************************************************/
     
    12171220    }
    12181221
     1222    /**
     1223     * Hide theme compat package selection if only 1 package is registered
     1224     *
     1225     * @since bbPress (r4315)
     1226     *
     1227     * @param array $sections bbPress settings sections
     1228     * @return array
     1229     */
     1230    public function hide_theme_compat_packages( $sections = array() ) {
     1231        if ( count( bbpress()->theme_compat->packages ) <= 1 )
     1232            unset( $sections['bbp_settings_theme_compat'] );
     1233
     1234        return $sections;
     1235    }
     1236
    12191237    /** Ajax ******************************************************************/
    12201238
Note: See TracChangeset for help on using the changeset viewer.