Properties

$instance

$instance : mixed

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

Type

mixed — Default null

$child_plugin_dir

$child_plugin_dir : string

Public variable to hold the MainWP Child plugin directory information.

Type

string — Default null

$child_branding_options

$child_branding_options : string

Public variable to hold the MainWP Child plugin branding options.

Type

string — Default null

Methods

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

__construct()

__construct() : void

MainWP_Child_Branding constructor.

Run any time class is called.

init_options()

init_options() : array

Method init_options()

Initiate the branding extension options.

Returns

array —

Array containing branding options.

get_extra_options()

get_extra_options() : array

Method get_extra_options()

Get extra branding settings.

Returns

array —

Array containing the extra branding settings.

plugin_row_meta()

plugin_row_meta(array  $plugin_meta, string  $plugin_file, string  $child_plugin_slug) : array

Method plugin_row_meta()

Handle plugin meta information when custom branding is applied.

Parameters

array $plugin_meta

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

string $plugin_file

Path to the plugin file relative to the plugins directory.

string $child_plugin_slug

MainWP Child plugin slug.

Returns

array —

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

child_deactivation()

child_deactivation() 

Method child_deactivation()

Empty custom branding options upon MainWP Child plugin deactivation.

action()

action() 

Method action()

Fire off certain branding actions.

update_branding()

update_branding() : array

Method update_branding()

Update custom branding settings.

Returns

array —

Action result.

get_extra_settings()

get_extra_settings(array  $current_extra_setting, array  $settings, array  $information) : array

Method get_extra_settings()

Get extra branding settings.

Parameters

array $current_extra_setting

An array containing the current extra branding settings.

array $settings

An array containing the branding settings.

array $information

An array containing the synchronization information.

Returns

array —

An array of branding extra settings

branding_upload_image()

branding_upload_image(string  $img_url) : array

Method branding_upload_image()

Upload custom image from MainWP Dashboard.

Parameters

string $img_url

Contains image URL.

Throws

\Exception

Error message.

Returns

array —

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

branding_init()

branding_init() : void

Method branding_init()

Initiate custom branding features.

admin_init()

admin_init() 

Method admin_init()

Remove remove the update nag.

admin_menu()

admin_menu() 

Method admin_menu()

Add the support form page admin menu item.

remove_default_post_metaboxes()

remove_default_post_metaboxes() 

Method remove_default_post_metaboxes()

Hide new post screen unwanted metaboxes.

custom_post_columns()

custom_post_columns(array  $defaults) : array

Method custom_post_columns()

Hide unwanted posts table columns.

Parameters

array $defaults

An array containing default Manage Posts columns.

Returns

array —

$defaults An updated array containing default Manage Posts columns.

manage_my_category_columns()

manage_my_category_columns(array  $defaults) : array

Method manage_my_category_columns()

Hide the post slug metabox.

Parameters

array $defaults

An array containing default Manage Posts columns.

Returns

array —

$defaults An updated array containing default Manage Posts columns.

remove_default_page_metaboxes()

remove_default_page_metaboxes() 

Method remove_default_page_metaboxes()

Hide new post screen unwanted metaboxes.

custom_pages_columns()

custom_pages_columns(array  $defaults) : array

Method custom_pages_columns()

Hide unwanted pages table columns.

Parameters

array $defaults

An array containing default Manage Pages columns.

Returns

array —

$defaults An updated array containing default Manage Pages columns.

branding_redirect()

branding_redirect() 

Method branding_redirect()

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

core_update_footer()

core_update_footer() 

Method core_update_footer()

Remove the footer text containing the WP Core version info.

admin_footer_text()

admin_footer_text() 

Method core_update_footer()

Set custom admin footer text.

custom_favicon_frontend()

custom_favicon_frontend() 

Method custom_favicon_frontend()

Set custom site favicon.

custom_login_logo()

custom_login_logo() 

Method custom_login_logo()

Set custom site login page logo.

custom_login_headerurl()

custom_login_headerurl(string  $value) : string

Method custom_login_headerurl()

Set custom site login logo link.

Parameters

string $value

Contains the image link information.

Returns

string —

$value Contains the image link updated information.

custom_login_headertitle()

custom_login_headertitle(string  $value) : string

Method custom_login_headertitle()

Set custom site login logo title.

Parameters

string $value

Contains the image title information.

Returns

string —

$value Contains the image title updated information.

custom_gettext()

custom_gettext(array  $translations, string  $text) : array

Method custom_gettext()

Replace language domains.

Parameters

array $translations

An array containing the list of available translations.

string $text

Contains the text to replace.

Returns

array —

$translations An array containing the list of available translations.

custom_admin_css()

custom_admin_css() 

Method custom_admin_css()

Set custom WP Admin area CSS.

custom_login_css()

custom_login_css() 

Method custom_login_css()

Set custom Login page CSS.

parse_css()

parse_css(string  $css) : mixed

Method parse_css()

Parses CSS into an array.

Parameters

string $css

Contains the CSS code that needs to be parsed.

Returns

mixed —

Rebuilt CSS.

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

parse_css_rebuild()

parse_css_rebuild(string  $ordered) : mixed

Method parse_css_rebuild()

Rebuild parsed CSS.

Parameters

string $ordered

Contains the parsed CSS code that needs to be rebuit.

Returns

mixed —

CSS output.

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

custom_generator()

custom_generator(string  $generator, string  $type = '') : string

Method custom_generator()

Set custom generator meta tag.

Parameters

string $generator

Contains the generator information.

string $type

Contains the generator type information.

Returns

string —

Contains the updated generator information.

custom_dashboard_widgets()

custom_dashboard_widgets() 

Method custom_dashboard_widgets()

Hide unwanted WordPress Dashboard page widgets.

branding_global_footer()

branding_global_footer() 

Method branding_global_footer()

Set custom footer text.

add_support_button_in_top_admin_bar()

add_support_button_in_top_admin_bar(object  $wp_admin_bar) : boolean

Method add_support_button_in_top_admin_bar()

Add or remove the admin bar Support button node.

Parameters

object $wp_admin_bar

An object containing the WP Admin bar information.

Returns

boolean —

If conditions not met, return false.

is_branding()

is_branding() : boolean

Method is_branding()

Check if the custom branding is enabled.

Returns

boolean —

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

get_branding_title()

get_branding_title() : mixed

Method get_branding_title()

Get custom title for the MainWP Child plugin.

Returns

mixed —

If branding enabled, return custom title.

get_branding_options()

get_branding_options() : array

Method get_branding_options()

Get branding options.

Returns

array —

An array containing the branding options.

save_branding_options()

save_branding_options(string  $name, string  $val) 

Method save_branding_options()

Save branding options.

Parameters

string $name

Contains the option name.

string $val

Contains the option value.

branding_map_meta_cap()

branding_map_meta_cap(array  $caps, string  $cap) : array

Method branding_map_meta_cap()

Set cutom capabilities to disable theme switching.

Parameters

array $caps

An array of capabiilities.

string $cap

Contains the capability.

Returns

array —

$caps An array of updated capabiilities.

modify_plugin_header()

modify_plugin_header(array  $plugins) : array

Method modify_plugin_header()

Modify plugin header to show custom plugin info.

Parameters

array $plugins

An array of installed plugins information.

Returns

array —

$plugins Updated array of installed plugins information.

hide_update_notice()

hide_update_notice(array  $slugs) : array

Method hide_update_notice()

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

Parameters

array $slugs

An array of slugs of all installed plugins.

Returns

array —

$slugs Updated array of slugs of all installed plugins.

remove_update_nag()

remove_update_nag(object  $value) : object

Method remove_update_nag()

Hide the MainWP Child update notification on the Updates page.

Parameters

object $value

Object containing the updates info.

Returns

object —

$value Updated object containing the updates info.

update_plugin_header()

update_plugin_header(array  $plugins, array  $header) : array

Method update_plugin_header()

Update plugin header to show custom plugin info.

Parameters

array $plugins

An array of installed plugins information.

array $header

An array containig plugin information.

Returns

array —

$plugins Updated array of installed plugins information.