Loader
Loader Class.
Description Description
Source Source
File: packages/woocommerce-admin/src/Loader.php
Methods Methods
- __construct — Constructor.
- activated_plugin — Run when plugin is activated (can be WooCommerce or WooCommerce Admin).
- add_admin_body_classes — Adds body classes to the main wp-admin wrapper, allowing us to better target elements in specific scenarios.
- add_component_settings — Hooks extra neccessary data into the component settings array already set in WooCommerce core.
- add_settings — Add WC Admin specific settings
- add_settings_group — Register the admin settings for use in the WC REST API
- build_and_save_translations — Combine and save translations for a specific locale.
- combine_translation_chunk_files — Combine translation chunks when files are updated.
- define_tables — Add custom tables to $wpdb object.
- delete_homepage — Delete woocommerce_onboarding_homepage_post_id field when the homepage is deleted
- embed_page_header — Set up a div for the header embed to render into.
- generate_translation_strings — Combine translation chunks when plugin is activated.
- get_analytics_capability — Gets WordPress capability required to use analytics features. — deprecated
- get_combined_translation_filename — Generate a filename to cache translations from JS chunks.
- get_currency_settings — Return an object defining the currecy options for the site's current currency
- get_custom_settings — Gets custom settings used for WC Admin.
- get_embed_breadcrumbs — Returns breadcrumbs for the current page.
- get_features — Gets a build configured array of enabled WooCommerce Admin features/sections. — deprecated
- get_file_version — Gets the file modified time as a cache buster if we're in dev mode, or the plugin version otherwise.
- get_instance — Get class instance.
- get_order_statuses — Format order statuses by removing a leading 'wc-' if present.
- get_path — Gets the path for the asset depending on file type.
- get_script_asset_filename — Gets a script asset registry filename. The asset registry lists dependencies for the given script.
- get_translation_chunk_data — Find and combine translation chunk files.
- get_unregistered_order_statuses — Get all order statuses present in analytics tables that aren't registered.
- get_url — Gets the URL to an asset file.
- get_user_data_field — Helper to retrive user data fields.
- get_user_data_fields — We store some WooCommerce specific user meta attached to users endpoint, so that we can track certain preferences or values such as the inbox activity panel last open time.
- get_user_data_values — For all the registered user data fields ( Loader::get_user_data_fields ), fetch the data for returning via the REST API.
- inject_after_notices — Runs after admin notices and closes div.
- inject_before_notices — Runs before admin notices action and hides them.
- inject_wc_settings_dependencies — Injects wp-shared-settings as a dependency if it's present.
- is_admin_or_embed_page — Returns true if we are on a JS powered admin page or a "classic" (non JS app) powered admin page (an embedded page).
- is_admin_page — Returns true if we are on a JS powered admin page.
- is_dev — Returns true if WooCommerce Admin is currently running in a development environment.
- is_embed_page — Returns true if we are on a "classic" (non JS app) powered admin page.
- is_feature_enabled — Returns if a specific wc-admin feature is enabled. — deprecated
- is_onboarding_enabled — Returns if the onboarding feature of WooCommerce Admin should be enabled.
- is_using_installed_wc_admin_plugin — Verifies which plugin version is being used. If WooCommerce Admin is installed and activated but not in use it will show a warning.
- load_features — Class loader for enabled WooCommerce Admin features/sections.
- load_script_translation_file — Load translation strings from language packs for dynamic imports.
- load_scripts — Loads the required scripts on the correct pages.
- maybe_output_preload_link_tag — Render a preload link tag for a dependency, optionally checked against a provided allowlist.
- output_breadcrumbs — Outputs breadcrumbs via PHP for the initial load of an embedded page.
- output_header_preload_tags — Output preload link tags for all enqueued stylesheets and scripts.
- output_header_preload_tags_for_type — Output a preload link tag for dependencies (and their sub dependencies) with an optional allowlist.
- output_heading — Outputs breadcrumbs via PHP for the initial load of an embedded page.
- page_wrapper — Set up a div for the app to render into.
- register_page_handler — Connects existing WooCommerce pages.
- register_scripts — Registers all the neccessary scripts and styles to show the admin experience.
- register_store_details_page — Registers the store details (profiler) page.
- register_user_data — Registers WooCommerce specific user data to the WordPress user API.
- remove_app_entry_page_menu_item — Remove the menu item for the app entry point page.
- remove_notices — Removes notices that should not be displayed on WC Admin pages.
- should_use_minified_js_file — Determines if a minified JS file should be served.
- smart_app_banner — Adds an iOS "Smart App Banner" for display on iOS Safari.
- update_admin_title — Edits Admin title based on section of wc-admin.
- update_user_data_field — Helper to update user data fields.
- update_user_data_values — For all the registered user data fields ( Loader::get_user_data_fields ), update the data for the REST API.
- user_can_analytics — Helper function indicating whether the current user has the required analytics capability. — deprecated