Astra_Ext_White_Label_Markup::__construct()

Constructor


Description


Source

File: classes/class-astra-ext-white-label-markup.php

		public function __construct() {

			add_filter( 'astra_theme_author', array( $this, 'theme_author_callback' ) );
			if ( is_admin() ) {
				add_filter( 'all_plugins', array( $this, 'plugins_page' ) );
				add_filter( 'wp_prepare_themes_for_js', array( $this, 'themes_page' ) );
				add_filter( 'all_themes', array( $this, 'network_themes_page' ) );
				add_filter( 'update_right_now_text', array( $this, 'admin_dashboard_page' ) );
				add_action( 'customize_render_section', array( $this, 'theme_customizer' ) );

				// Change menu page title.
				add_filter( 'astra_menu_page_title', array( $this, 'menu_page_title' ), 10, 1 );
				add_filter( 'astra_theme_name', array( $this, 'menu_page_title' ), 10, 1 );
				add_filter( 'astra_addon_name', array( $this, 'addon_page_name' ), 10, 1 );
				add_filter( 'astra_addon_list_tagline', array( $this, 'addon_addon_list_tagline' ), 10, 1 );

				// Theme welcome Page right sections filter.
				add_filter( 'astra_support_link', array( $this, 'agency_author_link' ), 10, 1 );
				add_filter( 'astra_community_group_link', array( $this, 'agency_author_link' ), 10, 1 );
				add_filter( 'astra_knowledge_base_documentation_link', array( $this, 'agency_author_link' ), 10, 1 );
				add_filter( 'astra_starter_sites_documentation_link', array( $this, 'agency_author_link' ), 10, 1 );

				// Astra Addon List filter.
				add_filter( 'astra_addon_list', array( $this, 'astra_addon_list' ) );

				add_filter( 'astra_site_url', array( $this, 'agency_author_link' ), 10, 1 );
				add_action( 'astra_welcome_page_header_title', array( $this, 'welcome_page_header_site_title' ) );
				add_filter( 'astra_page_top_icon', array( $this, 'astra_welcome_page_icon' ), 10, 1 );

				if ( false !== self::get_whitelabel_string( 'astra', 'name', false ) ) {
					// Gettext filter.
					add_filter( 'gettext', array( $this, 'theme_gettext' ), 20, 3 );
				}

				if ( false !== self::astra_pro_whitelabel_name() ) {
					add_filter( 'gettext', array( $this, 'plugin_gettext' ), 20, 3 );
				}

				// Add menu item.
				if ( self::show_branding() ) {
					add_action( 'astra_menu_white_label_action', array( $this, 'settings_page' ) );
				} else {
					add_action( 'init', array( $this, 'white_label_hide_settings' ) );
					add_filter( 'astra_welcome_wrapper_class', array( $this, 'welcome_wrapper_class' ), 10, 1 );

					// Remove Action Heading if white label is enabled.
					add_filter( 'astra_advanced_hooks_list_action_column_headings', array( $this, 'remove_white_label_action' ), 10, 1 );

					// Remove Action Description.
					add_filter( 'astra_custom_layouts_hooks', array( $this, 'remove_description_custom_layouts' ), 10, 1 );

					// Rename custom layout post url slug.
					add_filter( 'astra_advanced_hooks_rewrite_slug', array( $this, 'change_custom_hook_url_slug' ), 20, 2 );

					// Hide Themes section in the customizer as the theme name cannot be edited in it.
					add_action( 'customize_register', array( $this, 'remove_themes_section' ), 30 );

					add_filter( 'bsf_product_changelog_astra-addon', '__return_empty_string' );

					add_filter( 'bsf_white_label_options', array( $this, 'astra_bsf_analytics_white_label' ) );
				}

				// White label save action.
				add_action( 'admin_init', array( $this, 'settings_save' ) );

				// Add menu item.
				add_filter( 'astra_addon_licence_url', array( $this, 'addon_licence_url' ), 10, 1 );

				// Change the theme page slug only if the value if added by user.
				$theme_whitelabelled_name = self::get_whitelabel_string( 'astra', 'name', false );
				if ( false !== $theme_whitelabelled_name && ! empty( $theme_whitelabelled_name ) ) {
					add_filter( 'astra_theme_page_slug', array( $this, 'astra_whitelabelled_slug' ) );
					add_filter( 'admin_body_class', array( $this, 'astra_page_admin_classes' ) );
				}
			}

			add_action( 'admin_enqueue_scripts', array( $this, 'updates_core_page' ) );

			// White Label graupi updates screen.
			add_filter( 'bsf_product_name_astra-addon', array( $this, 'astra_pro_whitelabel_name' ) );
			add_filter( 'bsf_product_description_astra-addon', array( $this, 'astra_pro_whitelabel_description' ) );
			add_filter( 'bsf_product_author_astra-addon', array( $this, 'astra_pro_whitelabel_author' ) );
			add_filter( 'bsf_product_homepage_astra-addon', array( $this, 'astra_pro_whitelabel_author_url' ) );
			if ( false !== self::get_whitelabel_string( 'astra', 'screenshot' ) ) {
				add_filter( 'bsf_product_icons_astra-addon', array( $this, 'astra_pro_branded_icons' ) );
			}
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.