From 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 16:19:29 -0500 Subject: dos2unix on all .php files, begin paring down admin page and site branding. --- inc/core/class-astra-attr.php | 230 +++++++++++++++++++++--------------------- 1 file changed, 115 insertions(+), 115 deletions(-) (limited to 'inc/core/class-astra-attr.php') diff --git a/inc/core/class-astra-attr.php b/inc/core/class-astra-attr.php index 2f55e46..9154c47 100644 --- a/inc/core/class-astra-attr.php +++ b/inc/core/class-astra-attr.php @@ -1,115 +1,115 @@ -astra_parse_attr( $context, $attributes, $args ); - - $output = ''; - - // Cycle through attributes, build tag attribute string. - foreach ( $attributes as $key => $value ) { - - if ( ! $value ) { - continue; - } - - if ( true === $value ) { - $output .= esc_html( $key ) . ' '; - } else { - $output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) ); - } - } - - $output = apply_filters( "astra_attr_{$context}_output", $output, $attributes, $context, $args ); - - return trim( $output ); - } - - /** - * Merge array of attributes with defaults, and apply contextual filter on array. - * - * The contextual filter is of the form `astra_attr_{context}`. - * - * @since 1.6.2 - * - * @param string $context The context, to build filter name. - * @param array $attributes Optional. Extra attributes to merge with defaults. - * @param array $args Optional. Custom data to pass to filter. - * @return array Merged and filtered attributes. - */ - public function astra_parse_attr( $context, $attributes = array(), $args = array() ) { - - $defaults = array( - 'class' => sanitize_html_class( $context ), - ); - - $attributes = wp_parse_args( $attributes, $defaults ); - - // Contextual filter. - return apply_filters( "astra_attr_{$context}", $attributes, $context, $args ); - } - - } - -endif; - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_Attr::get_instance(); +astra_parse_attr( $context, $attributes, $args ); + + $output = ''; + + // Cycle through attributes, build tag attribute string. + foreach ( $attributes as $key => $value ) { + + if ( ! $value ) { + continue; + } + + if ( true === $value ) { + $output .= esc_html( $key ) . ' '; + } else { + $output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) ); + } + } + + $output = apply_filters( "astra_attr_{$context}_output", $output, $attributes, $context, $args ); + + return trim( $output ); + } + + /** + * Merge array of attributes with defaults, and apply contextual filter on array. + * + * The contextual filter is of the form `astra_attr_{context}`. + * + * @since 1.6.2 + * + * @param string $context The context, to build filter name. + * @param array $attributes Optional. Extra attributes to merge with defaults. + * @param array $args Optional. Custom data to pass to filter. + * @return array Merged and filtered attributes. + */ + public function astra_parse_attr( $context, $attributes = array(), $args = array() ) { + + $defaults = array( + 'class' => sanitize_html_class( $context ), + ); + + $attributes = wp_parse_args( $attributes, $defaults ); + + // Contextual filter. + return apply_filters( "astra_attr_{$context}", $attributes, $context, $args ); + } + + } + +endif; + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Attr::get_instance(); -- cgit v1.2.3-70-g09d2