'pa_color', 'hide_parent' => 'yes', ); return wp_parse_args( get_option( self::OPTION_KEY, array() ), $defaults ); } public static function get( $key, $fallback = null ) { $options = self::get_all(); return isset( $options[ $key ] ) ? $options[ $key ] : $fallback; } public static function sanitize( $input ) { return array( 'primary_attribute' => isset( $input['primary_attribute'] ) ? sanitize_key( $input['primary_attribute'] ) : 'pa_color', 'hide_parent' => ( isset( $input['hide_parent'] ) && $input['hide_parent'] === 'yes' ) ? 'yes' : 'no', ); } }