MainWP Child Documentation

MainWP_Child_Branding
in package

Class MainWP_Child_Branding

MainWP Branding extension handler.

Table of Contents

Properties

$child_branding_options  : string
Public variable to hold the MainWP Child plugin branding options.
$child_plugin_dir  : string
Public variable to hold the MainWP Child plugin directory information.
$instance  : mixed
Public static variable to hold the single instance of the class.

Methods

__construct()  : void
MainWP_Child_Branding constructor.
action()  : mixed
Method action()
add_support_button_in_top_admin_bar()  : bool
Method add_support_button_in_top_admin_bar()
admin_footer_text()  : mixed
Method core_update_footer()
admin_init()  : mixed
Method admin_init()
admin_menu()  : mixed
Method admin_menu()
branding_global_footer()  : mixed
Method branding_global_footer()
branding_init()  : void
Method branding_init()
branding_map_meta_cap()  : array<string|int, mixed>
Method branding_map_meta_cap()
branding_redirect()  : mixed
Method branding_redirect()
branding_upload_image()  : array<string|int, mixed>
Method branding_upload_image()
child_deactivation()  : mixed
Method child_deactivation()
core_update_footer()  : mixed
Method core_update_footer()
custom_admin_css()  : mixed
Method custom_admin_css()
custom_dashboard_widgets()  : mixed
Method custom_dashboard_widgets()
custom_favicon_frontend()  : mixed
Method custom_favicon_frontend()
custom_generator()  : string
Method custom_generator()
custom_gettext()  : array<string|int, mixed>
Method custom_gettext()
custom_login_css()  : mixed
Method custom_login_css()
custom_login_headertitle()  : string
Method custom_login_headertitle()
custom_login_headerurl()  : string
Method custom_login_headerurl()
custom_login_logo()  : mixed
Method custom_login_logo()
custom_pages_columns()  : array<string|int, mixed>
Method custom_pages_columns()
custom_post_columns()  : array<string|int, mixed>
Method custom_post_columns()
get_branding_options()  : array<string|int, mixed>
Method get_branding_options()
get_branding_title()  : mixed
Method get_branding_title()
get_extra_options()  : array<string|int, mixed>
Method get_extra_options()
get_extra_settings()  : array<string|int, mixed>
Method get_extra_settings()
hide_update_notice()  : array<string|int, mixed>
Method hide_update_notice()
init_options()  : array<string|int, mixed>
Method init_options()
instance()  : mixed
Method instance()
is_branding()  : bool
Method is_branding()
manage_my_category_columns()  : array<string|int, mixed>
Method manage_my_category_columns()
modify_plugin_header()  : array<string|int, mixed>
Method modify_plugin_header()
parse_css()  : mixed
Method parse_css()
parse_css_rebuild()  : mixed
Method parse_css_rebuild()
plugin_row_meta()  : array<string|int, mixed>
Method plugin_row_meta()
remove_default_page_metaboxes()  : mixed
Method remove_default_page_metaboxes()
remove_default_post_metaboxes()  : mixed
Method remove_default_post_metaboxes()
remove_update_nag()  : object
Method remove_update_nag()
save_branding_options()  : mixed
Method save_branding_options()
update_branding()  : array<string|int, mixed>
Method update_branding()
update_plugin_header()  : array<string|int, mixed>
Method update_plugin_header()

Properties

$child_plugin_dir

Public variable to hold the MainWP Child plugin directory information.

public string $child_plugin_dir

Default null

$instance

Public static variable to hold the single instance of the class.

public static mixed $instance = null

Default null

Methods

add_support_button_in_top_admin_bar()

Method add_support_button_in_top_admin_bar()

public add_support_button_in_top_admin_bar(object $wp_admin_bar) : bool

Add or remove the admin bar Support button node.

Parameters
$wp_admin_bar : object

An object containing the WP Admin bar information.

Return values
bool

If conditions not met, return false.

admin_menu()

Method admin_menu()

public admin_menu() : mixed

Add the support form page admin menu item.

Tags
uses
MainWP_Child_Branding_Render::instance()

Method branding_global_footer()

public branding_global_footer() : mixed

Set custom footer text.

branding_map_meta_cap()

Method branding_map_meta_cap()

public branding_map_meta_cap(array<string|int, mixed> $caps, string $cap) : array<string|int, mixed>

Set cutom capabilities to disable theme switching.

Parameters
$caps : array<string|int, mixed>

An array of capabiilities.

$cap : string

Contains the capability.

Return values
array<string|int, mixed>

$caps An array of updated capabiilities.

branding_redirect()

Method branding_redirect()

public branding_redirect() : mixed

Prevent updates by redirecting access from the Updates and Plugins page.

branding_upload_image()

Method branding_upload_image()

public branding_upload_image(string $img_url) : array<string|int, mixed>

Upload custom image from MainWP Dashboard.

Parameters
$img_url : string

Contains image URL.

Tags
throws
MainWP_Exception

Error message.

uses
MainWP_Helper::get_class_name()
Return values
array<string|int, mixed>

An array containing the image information such as path and URL.

Method core_update_footer()

public core_update_footer() : mixed

Remove the footer text containing the WP Core version info.

custom_dashboard_widgets()

Method custom_dashboard_widgets()

public custom_dashboard_widgets() : mixed

Hide unwanted WordPress Dashboard page widgets.

custom_favicon_frontend()

Method custom_favicon_frontend()

public custom_favicon_frontend() : mixed

Set custom site favicon.

custom_generator()

Method custom_generator()

public custom_generator(string $generator[, string $type = '' ]) : string

Set custom generator meta tag.

Parameters
$generator : string

Contains the generator information.

$type : string = ''

Contains the generator type information.

Return values
string

Contains the updated generator information.

custom_gettext()

Method custom_gettext()

public custom_gettext(array<string|int, mixed> $translations, string $text) : array<string|int, mixed>

Replace language domains.

Parameters
$translations : array<string|int, mixed>

An array containing the list of available translations.

$text : string

Contains the text to replace.

Return values
array<string|int, mixed>

$translations An array containing the list of available translations.

custom_login_headertitle()

Method custom_login_headertitle()

public custom_login_headertitle(string $value) : string

Set custom site login logo title.

Parameters
$value : string

Contains the image title information.

Return values
string

$value Contains the image title updated information.

custom_login_headerurl()

Method custom_login_headerurl()

public custom_login_headerurl(string $value) : string

Set custom site login logo link.

Parameters
$value : string

Contains the image link information.

Return values
string

$value Contains the image link updated information.

custom_pages_columns()

Method custom_pages_columns()

public custom_pages_columns(array<string|int, mixed> $defaults) : array<string|int, mixed>

Hide unwanted pages table columns.

Parameters
$defaults : array<string|int, mixed>

An array containing default Manage Pages columns.

Return values
array<string|int, mixed>

$defaults An updated array containing default Manage Pages columns.

custom_post_columns()

Method custom_post_columns()

public custom_post_columns(array<string|int, mixed> $defaults) : array<string|int, mixed>

Hide unwanted posts table columns.

Parameters
$defaults : array<string|int, mixed>

An array containing default Manage Posts columns.

Return values
array<string|int, mixed>

$defaults An updated array containing default Manage Posts columns.

get_branding_options()

Method get_branding_options()

public get_branding_options() : array<string|int, mixed>

Get branding options.

Return values
array<string|int, mixed>

An array containing the branding options.

get_branding_title()

Method get_branding_title()

public get_branding_title() : mixed

Get custom title for the MainWP Child plugin.

Return values
mixed

If branding enabled, return custom title.

get_extra_options()

Method get_extra_options()

public get_extra_options() : array<string|int, mixed>

Get extra branding settings.

Return values
array<string|int, mixed>

Array containing the extra branding settings.

get_extra_settings()

Method get_extra_settings()

public get_extra_settings(array<string|int, mixed> $current_extra_setting, array<string|int, mixed> $settings, array<string|int, mixed> &$information) : array<string|int, mixed>

Get extra branding settings.

Parameters
$current_extra_setting : array<string|int, mixed>

An array containing the current extra branding settings.

$settings : array<string|int, mixed>

An array containing the branding settings.

$information : array<string|int, mixed>

An array containing the synchronization information.

Tags
used-by

MainWP_Child_Branding::update_branding() Update custom branding settings.

Return values
array<string|int, mixed>

An array of branding extra settings

hide_update_notice()

Method hide_update_notice()

public hide_update_notice(array<string|int, mixed> $slugs) : array<string|int, mixed>

Hide the MainWP Child update notice if custom branding is applied.

Parameters
$slugs : array<string|int, mixed>

An array of slugs of all installed plugins.

Return values
array<string|int, mixed>

$slugs Updated array of slugs of all installed plugins.

init_options()

Method init_options()

public init_options() : array<string|int, mixed>

Initiate the branding extension options.

Return values
array<string|int, mixed>

Array containing branding options.

instance()

Method instance()

public static instance() : mixed

Create a public static instance.

Return values
mixed

Class instance.

is_branding()

Method is_branding()

public is_branding() : bool

Check if the custom branding is enabled.

Return values
bool

If branding enabled, return true, if not, return false.

manage_my_category_columns()

Method manage_my_category_columns()

public manage_my_category_columns(array<string|int, mixed> $defaults) : array<string|int, mixed>

Hide the post slug metabox.

Parameters
$defaults : array<string|int, mixed>

An array containing default Manage Posts columns.

Return values
array<string|int, mixed>

$defaults An updated array containing default Manage Posts columns.

modify_plugin_header()

Method modify_plugin_header()

public modify_plugin_header(array<string|int, mixed> $plugins) : array<string|int, mixed>

Modify plugin header to show custom plugin info.

Parameters
$plugins : array<string|int, mixed>

An array of installed plugins information.

Return values
array<string|int, mixed>

$plugins Updated array of installed plugins information.

parse_css()

Method parse_css()

public static parse_css(string $css) : mixed

Parses CSS into an array.

Parameters
$css : string

Contains the CSS code that needs to be parsed.

Return values
mixed

Rebuilt CSS.

Copyright (C) 2009 Peter Kröner, CSSPARSER.

parse_css_rebuild()

Method parse_css_rebuild()

public static parse_css_rebuild(string $ordered) : mixed

Rebuild parsed CSS.

Parameters
$ordered : string

Contains the parsed CSS code that needs to be rebuit.

Return values
mixed

CSS output.

Copyright (C) 2009 Peter Kröner, CSSPARSER.

plugin_row_meta()

Method plugin_row_meta()

public plugin_row_meta(array<string|int, mixed> $plugin_meta, string $plugin_file, string $child_plugin_slug) : array<string|int, mixed>

Handle plugin meta information when custom branding is applied.

Parameters
$plugin_meta : array<string|int, mixed>

An array of the plugin's metadata, including the version, author, author URI, and plugin URI.

$plugin_file : string

Path to the plugin file relative to the plugins directory.

$child_plugin_slug : string

MainWP Child plugin slug.

Return values
array<string|int, mixed>

An array of the plugin's metadata, including the version, author, author URI, and plugin URI.

remove_default_page_metaboxes()

Method remove_default_page_metaboxes()

public remove_default_page_metaboxes() : mixed

Hide new post screen unwanted metaboxes.

remove_default_post_metaboxes()

Method remove_default_post_metaboxes()

public remove_default_post_metaboxes() : mixed

Hide new post screen unwanted metaboxes.

remove_update_nag()

Method remove_update_nag()

public remove_update_nag(object $value) : object

Hide the MainWP Child update notification on the Updates page.

Parameters
$value : object

Object containing the updates info.

Tags
uses
MainWP_Helper::is_updates_screen()
Return values
object

$value Updated object containing the updates info.

save_branding_options()

Method save_branding_options()

public save_branding_options(string $name, string $val) : mixed

Save branding options.

Parameters
$name : string

Contains the option name.

$val : string

Contains the option value.

Tags
uses
MainWP_Helper::update_option()

Update database option.

used-by
MainWP_Child_Stats::get_site_stats()
used-by
MainWP_Child_Stats::get_site_stats()
used-by
MainWP_Child::__construct()
used-by
MainWP_Client_Report::set_showhide()
used-by
MainWP_Connect::register_site()

update_branding()

Method update_branding()

public update_branding() : array<string|int, mixed>

Update custom branding settings.

Tags
used-by

\MainWP\Child\MainWP_Child_Branding::action() Fire off certain Google Pagespeed Insights plugin actions.

used-by
MainWP_Child_Branding::action()

Update custom branding settings.

used-by
MainWP_Child_DB_Updater::action()

Update custom branding settings.

uses
MainWP_Helper::update_option()
Return values
array<string|int, mixed>

Action result.

update_plugin_header()

Method update_plugin_header()

public update_plugin_header(array<string|int, mixed> $plugins, array<string|int, mixed> $header) : array<string|int, mixed>

Update plugin header to show custom plugin info.

Parameters
$plugins : array<string|int, mixed>

An array of installed plugins information.

$header : array<string|int, mixed>

An array containig plugin information.

Return values
array<string|int, mixed>

$plugins Updated array of installed plugins information.


        
On this page

Search results