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/class-astra-after-setup-theme.php | 528 +++++++++++++++++----------------- 1 file changed, 264 insertions(+), 264 deletions(-) (limited to 'inc/class-astra-after-setup-theme.php') diff --git a/inc/class-astra-after-setup-theme.php b/inc/class-astra-after-setup-theme.php index 7d9fc94..8af30d8 100644 --- a/inc/class-astra-after-setup-theme.php +++ b/inc/class-astra-after-setup-theme.php @@ -1,264 +1,264 @@ - 180, - 'height' => 60, - 'flex-width' => true, - 'flex-height' => true, - ) - ); - - // Customize Selective Refresh Widgets. - add_theme_support( 'customize-selective-refresh-widgets' ); - - /** - * This theme styles the visual editor to resemble the theme style, - * specifically font, colors, icons, and column width. - */ - /* Directory and Extension */ - $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; - $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; - if ( apply_filters( 'astra_theme_editor_style', true ) ) { - add_editor_style( 'assets/css/' . $dir_name . '/editor-style' . $file_prefix . '.css' ); - } - - if ( apply_filters( 'astra_fullwidth_oembed', true ) ) { - // Filters the oEmbed process to run the responsive_oembed_wrapper() function. - add_filter( 'embed_oembed_html', array( $this, 'responsive_oembed_wrapper' ), 10, 3 ); - } - - // WooCommerce. - add_theme_support( 'woocommerce' ); - - // Rank Math Breadcrumb. - add_theme_support( 'rank-math-breadcrumbs' ); - - // Native AMP Support. - if ( true === apply_filters( 'astra_amp_support', true ) ) { - add_theme_support( - 'amp', - apply_filters( - 'astra_amp_theme_features', - array( - 'paired' => true, - ) - ) - ); - } - - } - - /** - * Set the $content_width global variable used by WordPress to set image dimennsions. - * - * @since 1.5.5 - * @return void - */ - public function setup_content_width() { - global $content_width; - - /** - * Content Width - */ - if ( ! isset( $content_width ) ) { - - if ( is_home() || is_post_type_archive( 'post' ) ) { - $blog_width = astra_get_option( 'blog-width' ); - - if ( 'custom' === $blog_width ) { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-max-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } elseif ( is_single() ) { - - if ( 'post' === get_post_type() ) { - $single_post_max = astra_get_option( 'blog-single-width' ); - - if ( 'custom' === $single_post_max ) { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-single-max-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } - - // For custom post types set the global content width. - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } else { - $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); - } - } - - } - - /** - * Adds a responsive embed wrapper around oEmbed content - * - * @param string $html The oEmbed markup. - * @param string $url The URL being embedded. - * @param array $attr An array of attributes. - * - * @return string Updated embed markup. - */ - public function responsive_oembed_wrapper( $html, $url, $attr ) { - - $add_astra_oembed_wrapper = apply_filters( 'astra_responsive_oembed_wrapper_enable', true ); - - $allowed_providers = apply_filters( - 'astra_allowed_fullwidth_oembed_providers', - array( - 'vimeo.com', - 'youtube.com', - 'youtu.be', - 'wistia.com', - 'wistia.net', - ) - ); - - if ( astra_strposa( $url, $allowed_providers ) ) { - if ( $add_astra_oembed_wrapper ) { - $html = ( '' !== $html ) ? '
' . $html . '
' : ''; - } - } - - return $html; - } - } -} - -/** - * Kicking this off by calling 'get_instance()' method - */ -Astra_After_Setup_Theme::get_instance(); + 180, + 'height' => 60, + 'flex-width' => true, + 'flex-height' => true, + ) + ); + + // Customize Selective Refresh Widgets. + add_theme_support( 'customize-selective-refresh-widgets' ); + + /** + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, icons, and column width. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + if ( apply_filters( 'astra_theme_editor_style', true ) ) { + add_editor_style( 'assets/css/' . $dir_name . '/editor-style' . $file_prefix . '.css' ); + } + + if ( apply_filters( 'astra_fullwidth_oembed', true ) ) { + // Filters the oEmbed process to run the responsive_oembed_wrapper() function. + add_filter( 'embed_oembed_html', array( $this, 'responsive_oembed_wrapper' ), 10, 3 ); + } + + // WooCommerce. + add_theme_support( 'woocommerce' ); + + // Rank Math Breadcrumb. + add_theme_support( 'rank-math-breadcrumbs' ); + + // Native AMP Support. + if ( true === apply_filters( 'astra_amp_support', true ) ) { + add_theme_support( + 'amp', + apply_filters( + 'astra_amp_theme_features', + array( + 'paired' => true, + ) + ) + ); + } + + } + + /** + * Set the $content_width global variable used by WordPress to set image dimennsions. + * + * @since 1.5.5 + * @return void + */ + public function setup_content_width() { + global $content_width; + + /** + * Content Width + */ + if ( ! isset( $content_width ) ) { + + if ( is_home() || is_post_type_archive( 'post' ) ) { + $blog_width = astra_get_option( 'blog-width' ); + + if ( 'custom' === $blog_width ) { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-max-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } elseif ( is_single() ) { + + if ( 'post' === get_post_type() ) { + $single_post_max = astra_get_option( 'blog-single-width' ); + + if ( 'custom' === $single_post_max ) { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'blog-single-max-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } + + // For custom post types set the global content width. + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } else { + $content_width = apply_filters( 'astra_content_width', astra_get_option( 'site-content-width', 1200 ) ); + } + } + + } + + /** + * Adds a responsive embed wrapper around oEmbed content + * + * @param string $html The oEmbed markup. + * @param string $url The URL being embedded. + * @param array $attr An array of attributes. + * + * @return string Updated embed markup. + */ + public function responsive_oembed_wrapper( $html, $url, $attr ) { + + $add_astra_oembed_wrapper = apply_filters( 'astra_responsive_oembed_wrapper_enable', true ); + + $allowed_providers = apply_filters( + 'astra_allowed_fullwidth_oembed_providers', + array( + 'vimeo.com', + 'youtube.com', + 'youtu.be', + 'wistia.com', + 'wistia.net', + ) + ); + + if ( astra_strposa( $url, $allowed_providers ) ) { + if ( $add_astra_oembed_wrapper ) { + $html = ( '' !== $html ) ? '
' . $html . '
' : ''; + } + } + + return $html; + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_After_Setup_Theme::get_instance(); -- cgit v1.2.3-70-g09d2