ffff', '#dd3333', '#dd9933', '#eeee22', '#81d742', '#1e73be', '#8224e3', ); return apply_filters( 'astra_color_palettes', $color_palette ); } } if ( ! function_exists( 'astra_get_theme_name' ) ) { /** * Get theme name. * * @return string Theme Name. */ function astra_get_theme_name() { $theme_name = 'Astra'; return apply_filters( 'astra_theme_name', $theme_name ); } } if ( ! function_exists( 'astra_get_addon_name' ) ) { /** * Get Addon name. * * @return string Addon Name. */ function astra_get_addon_name() { $pro_name = 'Astra Pro'; // If addon is not updated & White Label added for Addon then show the updated addon name. if ( class_exists( 'Astra_Ext_White_Label_Markup' ) ) { $plugin_data = Astra_Ext_White_Label_Markup::$branding; if ( '' != $plugin_data['astra-pro']['name'] ) { $pro_name = $plugin_data['astra-pro']['name']; } } return apply_filters( 'astra_addon_name', $pro_name ); } } /** * Added this filter to modify the post navigation template to remove the h2 tag from screen reader text. */ function astra_post_navigation_template() { return ''; } add_filter( 'navigation_markup_template', 'astra_post_navigation_template' ); /** * Prevent onboarding of Elementor. * * @param bool $network_wide Whether to enable the plugin for all sites in the network * or just the current site. Multisite only. Default false. * * @since 3.9.0 */ function astra_skip_elementor_onboarding( $network_wide ) { // Deleted transient & setting up onboaded flag true to skip steps. delete_transient( 'elementor_activation_redirect' ); update_option( 'elementor_onboarded', true ); } add_action( 'activate_elementor/elementor.php', 'astra_skip_elementor_onboarding' ); /** * BBPress & BuddyPress Multiple user profile compatibility issue. * * @param bool $value For checking this issue is still persist or not. * * @since 4.1.0 */ function astra_bbpress_issue( $value ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( class_exists( 'bbpress' ) && ( bbp_is_single_user() || bbp_is_search() || bbp_is_topic_tag() || is_bbpress() ) ) { /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort return false; } // BuddyPress login page looping issue resolution if ( function_exists( 'buddypress' ) && is_buddypress() ) { /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort return false; } return $value; } add_filter( 'astra_single_layout_one_banner_visibility', 'astra_bbpress_issue', 50 ); /** * Render Svg Mask for Header logo * * @since 4.2.2 * @return void */ function astra_render_header_svg_mask() { $transparent_header_logo_color = astra_get_option( 'transparent-header-logo-color' ); $header_logo_color = astra_get_option( 'header-logo-color' ); if ( $header_logo_color && 'unset' !== $header_logo_color ) { /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort astra_render_svg_mask( 'ast-img-color-filter', 'header_logo_svg_color', $header_logo_color ); } if ( $transparent_header_logo_color && 'unset' !== $transparent_header_logo_color ) { /** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort astra_render_svg_mask( 'ast-img-color-filter-2', 'header_logo_svg_color', $transparent_header_logo_color ); } } add_action( 'wp_footer', 'astra_render_header_svg_mask' ); /** * Render Featured Image for single post at 'astra_entry_before' hook before post
* * @since 4.4.0 */ function astra_single_post_entry_featured_image() { $post_type = strval( get_post_type() ); $featured_image_size = astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-size', 'large' ); if ( apply_filters( 'astra_post_featured_image_condition', has_post_thumbnail() ) ) { do_action( 'astra_article_featured_image_before' ); $output = ''; $post_thumb = apply_filters( 'astra_article_featured_image_markup', get_the_post_thumbnail( /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort absint( astra_get_post_id() ), /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort apply_filters( 'astra_post_featured_image_default_size', $featured_image_size ), apply_filters( 'astra_post_featured_image_itemprop', '' ) ) ); if ( '' != $post_thumb ) { $featured_image_width = 'layout-1' === astra_get_option( 'ast-dynamic-single-' . $post_type . '-layout', 'layout-1' ) ? astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-width-type', 'wide' ) : ''; $output .= '
'; $output .= $post_thumb; $output .= '
'; } $output = apply_filters( 'astra_featured_post_thumbnail', $output ); echo wp_kses_post( $output ); do_action( 'astra_article_featured_image_after' ); } } /** * Prepare rendering Featured Image for single post at 'astra_header_after' hook after header. * Required on single post only. * * @since 4.4.0 */ function astra_setup_article_featured_image() { if ( ! is_singular() ) { return; } $post_type = strval( get_post_type() ); if ( ( 'disabled' === astra_get_option_meta( 'ast-featured-img' ) && Astra_Dynamic_CSS::astra_4_6_2_compatibility() ) || false === astra_get_option( 'ast-single-' . $post_type . '-title' ) ) { /** * Bail early if featured image option "Show featured image in the posts lists only, but hide it in the single post view." is enabled. * * @since 4.6.2 */ return; } $banner_title_layout = astra_get_option( 'ast-dynamic-single-' . $post_type . '-layout', 'layout-1' ); $single_structure = astra_get_option( 'ast-dynamic-single-' . $post_type . '-structure', astra_get_option( 'ast-dynamic-single-' . $post_type . '-structure', 'page' === $post_type ? array( 'ast-dynamic-single-' . $post_type . '-image', 'ast-dynamic-single-' . $post_type . '-title' ) : array( 'ast-dynamic-single-' . $post_type . '-title', 'ast-dynamic-single-' . $post_type . '-meta' ) ) ); if ( ! in_array( 'ast-dynamic-single-' . $post_type . '-image', $single_structure ) ) { return; } if ( 'layout-1' === $banner_title_layout ) { $article_featured_image_position = astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-position-layout-1', 'behind' ); } else { $article_featured_image_position = astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-position-layout-2', 'none' ); } if ( 'none' !== $article_featured_image_position ) { add_action( 'astra_entry_before', 'astra_single_post_entry_featured_image' ); } } add_action( 'astra_header_after', 'astra_setup_article_featured_image' ); /** * Add aria-expanded attribute to menu items that have submenus. * * @since 4.6.15 * @param string $output The HTML output of the menu item. * @param object $item Menu item data object. * @param int $depth Depth of the current menu item. * @param array $args An array of arguments. * * @return string $output Menu item markup output. */ function astra_add_aria_expanded_submenu_items_attr( $output, $item, $depth, $args ) { $classes = empty( $item->classes ) ? array() : (array) $item->classes; // forming classes array if string. if ( in_array( 'menu-item-has-children', $classes ) ) { $output = str_replace( '