array( 'top' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'], 'right' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'], 'bottom' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'], 'left' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'], ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'desktop-unit' => 'px', 'tablet-unit' => 'px', 'mobile-unit' => 'px', ); $defaults['scroll-to-top-icon-color'] = ''; $defaults['scroll-to-top-icon-h-color'] = ''; $defaults['scroll-to-top-icon-bg-color'] = ''; $defaults['scroll-to-top-icon-h-bg-color'] = ''; return $defaults; } /** * Add customizer configs for scroll to top in the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. * @since 4.0.0 */ public function new_customize_register( $wp_customize ) { require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/customizer/class-astra-scroll-to-top-configs.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way. } /** * Customizer Preview * * @since 4.0.0 */ public function preview_scripts() { /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( SCRIPT_DEBUG ) { /** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/unminified/customizer-preview.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } else { wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/minified/customizer-preview.min.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Scroll to Top addon markup loader * * Loads appropriate template file based on the style option selected in options panel. * * @since 4.0.0 */ public function html_markup_loader() { if ( true === astra_get_option( 'scroll-to-top-enable', true ) ) { get_template_part( 'template-parts/scroll-to-top' ); } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Scroll_To_Top_Loader::get_instance();