MainWP_Child_HTML_Regression
in package
Class MainWP_Child_HTML_Regression
MainWP HTML Regression extension handler.
Table of Contents
Properties
- $instance : mixed
- Public static variable to hold the single instance of the class.
- $is_plugin_installed : bool
- Public variable to hold the information if the HTML Regression plugin is installed on the child site.
- $plugin_translate : string
- Public variable to hold the information about the language domain.
Methods
- __construct() : mixed
- MainWP_Child_HTML_Regression constructor.
- get_active_assets() : array<string|int, mixed>
- Method get_active_assets()
- get_css_js_files() : array<string|int, mixed>
- Method get_css_js_files()
- get_frontend_assets_only() : array<string|int, mixed>
- Method get_frontend_assets_only()
- get_theme_css_js_files() : array<string|int, mixed>
- Method get_theme_css_js_files()
- init() : void
- Method init()
- instance() : mixed
- Method instance()
- is_asset_in_admin() : bool
- Method is_asset_in_admin()
- sync_others_data() : array<string|int, mixed>
- Method sync_others_data()
- track_admin_assets() : void
- Method track_admin_assets()
- get_plugin_name_from_path() : mixed
- Method get_plugin_name_from_path()
Properties
$instance
Public static variable to hold the single instance of the class.
public
static mixed
$instance
= null
Default null
$is_plugin_installed
Public variable to hold the information if the HTML Regression plugin is installed on the child site.
public
bool
$is_plugin_installed
= true
If HTML Regression installed, return true, if not, return false.
$plugin_translate
Public variable to hold the information about the language domain.
public
string
$plugin_translate
= 'mainwp-child'
'mainwp-child' languge domain.
Methods
__construct()
MainWP_Child_HTML_Regression constructor.
public
__construct() : mixed
Run any time class is called.
get_active_assets()
Method get_active_assets()
public
get_active_assets() : array<string|int, mixed>
Get plugin and theme files
Tags
Return values
array<string|int, mixed> —List Folder files CSS, JS of Plugins and Theme.
get_css_js_files()
Method get_css_js_files()
public
get_css_js_files(string $directory) : array<string|int, mixed>
Get css and js files from folder.
Parameters
- $directory : string
-
directory path.
Tags
Return values
array<string|int, mixed> —List of CSS and JS files.
get_frontend_assets_only()
Method get_frontend_assets_only()
public
get_frontend_assets_only() : array<string|int, mixed>
Get a list of enqueued CSS and JS files and only get them from the frontend
Tags
Return values
array<string|int, mixed> —List of CSS and JS files.
get_theme_css_js_files()
Method get_theme_css_js_files()
public
get_theme_css_js_files() : array<string|int, mixed>
Get theme css js files
Tags
Return values
array<string|int, mixed> —theme css and js files.
init()
Method init()
public
init() : void
Initiate action hooks.
instance()
Method instance()
public
static instance() : mixed
Create a public static instance.
Return values
mixed —Class instance.
is_asset_in_admin()
Method is_asset_in_admin()
public
is_asset_in_admin(string $handle, string $type) : bool
Check if the CSS/JS file is loaded in admin or not.
Parameters
- $handle : string
-
Asset name (CSS/JS).
- $type : string
-
'style' or 'script' to identify the asset type.
Tags
Return values
bool —True if the asset is loaded in admin, false otherwise.
sync_others_data()
Method sync_others_data()
public
sync_others_data(array<string|int, mixed> $information[, array<string|int, mixed> $data = array() ]) : array<string|int, mixed>
Sync the HTML Regression plugin settings.
Parameters
- $information : array<string|int, mixed>
-
Array containing the sync information.
- $data : array<string|int, mixed> = array()
-
Array containing the HTML Regression plugin data to be synced.
Tags
Return values
array<string|int, mixed> —$information Array containing the sync information.
track_admin_assets()
Method track_admin_assets()
public
track_admin_assets() : void
Track admin assets files.
Return values
void —update option tracking admin assets plugins.
get_plugin_name_from_path()
Method get_plugin_name_from_path()
private
get_plugin_name_from_path(string $path) : mixed
Get plugin name from file path.
Parameters
- $path : string
-
CSS/JS file path.
Tags
Return values
mixed —Name and path of plugin.