id = $id; $keys = array_keys( get_class_vars( __CLASS__ ) ); foreach ( $keys as $key ) { if ( isset( $args[ $key ] ) ) $this->$key = $args[ $key ]; } $this->settings = array(); // Users cannot customize the $settings array. return $this; } /** * Check if the theme supports the section and check user capabilities. * * @since 3.4.0 * * @return bool False if theme doesn't support the section or user doesn't have the capability. */ function check_capabilities() { if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) return false; if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) return false; return true; } /** * Render the section. * * @since 3.4.0 */ function render() { if ( ! $this->check_capabilities() ) return; ?>