Свойство | Type | Description | |
---|---|---|---|
$instance | Static property to hold our singleton instance. |
Méthode | Description | |
---|---|---|
admin_bar_toggle ( WP_Admin_Bar $wp_admin_bar ) : void | Add our quick toggle to the admin bar to enable / disable | |
admin_body_class ( string $classes ) : string | Add body class to admin pages based on plugin status. | |
admin_menu_items ( ) : null | Remove menu items for updates from a standard WP install. | |
available_translations ( mixed $translations ) : array | Filter for languages list transient. Returns locally available translations to avoid request into wp.org translation API. | |
block_oembed_html ( string $html, string $url, array $attr, integer $post_ID ) : string | Block oEmbeds from displaying. | |
block_script_load ( string $source ) : string | Check the URL of a JS file and remove any that are not on the local URL. | |
block_style_load ( string $source ) : string | Check the URL of a stylesheet and remove any that are not on the local URL. | |
body_class ( array $classes ) : array | Add body class to front-end pages and login based on plugin status. | |
bypass_theme_api_call ( false | object | array $override, string $action, object $args ) : boolean | Override the API call made for pulling themes from the .org repo. | |
bypass_theme_api_result ( array | object | WP_Error $res, string $action, object $args ) : boolean | Hijack the expected themes API result. | |
count_http_requests ( ) : void | Increase HTTP request counter by one. | |
create_setting ( ) | Set our initial airplane mode setting to 'on' on activation. | |
default_avatar ( string $avatar_list ) : string | Remove avatar images from the default avatar list | |
disable_http_reqs ( boolean | array | WP_Error $status = false, array $args = [], string $url = '' ) : boolean | array | WP_Error | Disable all the HTTP requests being made with the action happening before the status check so others can allow certain items as desired. | |
enabled ( ) : boolean | Helper function to check the current status. | |
getInstance ( ) | If an instance exists, this returns it. If not, it creates one and returns it. | |
last_checked_core ( ) : object | Always send back that the latest version of WordPress is the one we're running | |
last_checked_plugins ( ) : object | Always send back that the latest version of our plugins are the one we're running | |
last_checked_themes ( ) : object | Always send back that the latest version of our theme is the one we're running | |
ms_admin_menu_items ( ) : null | Remove menu items for updates from a multisite instance. | |
plugin_add_tabs ( array $nonmenu_tabs ) : array | Remove the tabs on the plugin page to add new items since they require the WP connection and will fail. | |
prevent_auto_updates ( array $caps, string $cap ) : array | Filter a user's meta capabilities to prevent auto-updates from being attempted. | |
purge_transients ( ) : void | Check the new status after airplane mode has been enabled or disabled and purge related transients | |
remove_bulk_actions ( array $actions ) : array | Remove the ability to update plugins/themes from single site and multisite bulk actions | |
remove_schedule_hook ( ) : null | Remove all the various schedule hooks for themes, plugins, etc. | |
remove_setting ( ) | Remove our setting on plugin deactivation. | |
remove_update_array ( array $items ) : array | Return an empty array of items requiring update for both themes and plugins | |
remove_update_crons ( ) : null | Remove all the various places WP does the update checks. As you can see there are a lot of them. | |
replace_gravatar ( string $avatar, integer | object | string $id_or_email, integer $size, string $default, string $alt ) : string | Replace all instances of gravatar with a local image file to remove the call to remote service. | |
textdomain ( ) : void | Load our textdomain for localization. | |
toggle_check ( ) : void | Check the user action from the toggle switch to set the option to 'on' or 'off'. | |
toggle_css ( ) | Load our small CSS file for the toggle switch. |
Méthode | Description | |
---|---|---|
get_redirect ( ) : string | Fetch the URL to redirect to after toggling Airplane Mode. |
Méthode | Description | |
---|---|---|
__construct ( ) | This is our constructor. There are many like it, but this one is mine. | |
get_offline_languages ( array $installed_languages ) : array | Returns list of languages installed locally with full mimicked meta data. | |
get_offline_translation_information ( ) : array | We can't use wp_get_available_translations() offine. |
public admin_bar_toggle ( WP_Admin_Bar $wp_admin_bar ) : void | ||
$wp_admin_bar | WP_Admin_Bar | The admin bar object. |
Résultat | void | if current user can't manage options and we bail early. |
public admin_body_class ( string $classes ) : string | ||
$classes | string | The existing space-separated list of CSS classes. |
Résultat | string | $classes The updated space-separated list of CSS classes. |
public available_translations ( mixed $translations ) : array | ||
$translations | mixed | Translation data returned from transient API. |
Résultat | array | List of available languages. |
public block_script_load ( string $source ) : string | ||
$source | string | The source URL of the JS file. |
Résultat | string | $source The same URL, or null. |
public block_style_load ( string $source ) : string | ||
$source | string | The source URL of the CSS sheet. |
Résultat | string | $source The same URL, or null. |
public body_class ( array $classes ) : array | ||
$classes | array | The existing array of body classes. |
Résultat | array | $classes The updated array of body classes. |
public bypass_theme_api_call ( false | object | array $override, string $action, object $args ) : boolean | ||
$override | false | object | array | Whether to override the WordPress.org Themes API. Default false. |
$action | string | Requested action. Likely values are 'theme_information', 'feature_list', or 'query_themes'. |
$args | object | Arguments used to query for installer pages from the Themes API. |
Résultat | boolean | True if enabled, otherwise the existng value. |
public bypass_theme_api_result ( array | object | WP_Error $res, string $action, object $args ) : boolean | ||
$res | array | object | WP_Error | WordPress.org Themes API response. |
$action | string | Requested action. Likely values are 'theme_information', 'feature_list', or 'query_themes'. |
$args | object | Arguments used to query for installer pages from the WordPress.org Themes API. |
Résultat | boolean | An empty array if enabled, otherwise the existng result. |
public count_http_requests ( ) : void | ||
Résultat | void |
public create_setting ( ) |
public default_avatar ( string $avatar_list ) : string | ||
$avatar_list | string | List of default avatars. |
Résultat | string | Updated list with images removed |
public disable_http_reqs ( boolean | array | WP_Error $status = false, array $args = [], string $url = '' ) : boolean | array | WP_Error | ||
$status | boolean | array | WP_Error | Whether to preempt an HTTP request return. Default false. |
$args | array | HTTP request arguments. |
$url | string | The request URL. |
Résultat | boolean | array | WP_Error | A WP_Error object if Airplane Mode is enabled. Original $status if not. |
public static getInstance ( ) |
protected static get_redirect ( ) : string | ||
Résultat | string | The URL to redirect to. |
public last_checked_core ( ) : object | ||
Résultat | object | the modified output with our information |
public last_checked_plugins ( ) : object | ||
Résultat | object | the modified output with our information |
public last_checked_themes ( ) : object | ||
Résultat | object | the modified output with our information |
public plugin_add_tabs ( array $nonmenu_tabs ) : array | ||
$nonmenu_tabs | array | All the tabs displayed. |
Résultat | array | $nonmenu_tabs The remaining tabs. |
public purge_transients ( ) : void | ||
Résultat | void |
public remove_bulk_actions ( array $actions ) : array | ||
$actions | array | All the bulk actions. |
Résultat | array | $actions The remaining actions |
public remove_schedule_hook ( ) : null | ||
Résultat | null |
public remove_setting ( ) |
public remove_update_array ( array $items ) : array | ||
$items | array | All the items being passed for update. |
Résultat | array | An empty array, or the original items if not enabled. |
public remove_update_crons ( ) : null | ||
Résultat | null |
public replace_gravatar ( string $avatar, integer | object | string $id_or_email, integer $size, string $default, string $alt ) : string | ||
$avatar | string | Image tag for the user's avatar. |
$id_or_email | integer | object | string | A user ID, email address, or comment object. |
$size | integer | Square avatar width and height in pixels to retrieve. |
$default | string | URL to a default image to use if no avatar is available. |
$alt | string | Alternative text to use in the avatar image tag. |
Résultat | string | `` tag for the user's avatar. |
public textdomain ( ) : void | ||
Résultat | void |
public toggle_check ( ) : void | ||
Résultat | void | if any of the sanity checks fail and we bail early. |