Свойство | Type | Description | |
---|---|---|---|
$stats_roles | Roles that can access Stats once they're granted access. | ||
$user_permissions_error_msg | Generic error message when user is not allowed to perform an action. |
Méthode | Description | |
---|---|---|
activate_plugins_permission_check ( ) : boolean | Verify that user can view Jetpack admin page and can activate plugins. | |
build_connect_url ( ) : string | WP_Error | Gets a new connect raw URL with fresh nonce. | |
cast_value ( mixed $value, array $definition ) : boolean | float | integer | string | Perform a casting to the value specified in the option definition. | |
configure_modules_permission_check ( ) : boolean | Verify that user can update Jetpack modules. | |
confirm_safe_mode ( ) : boolean | Handles identity crisis mitigation, confirming safe mode for this site. | |
connect_url_permission_callback ( ) : boolean | WP_Error | Verify that the user can get a connect/link URL | |
disconnect_site ( $data ) : boolean | WP_Error | Disconnects Jetpack from the WordPress.com Servers | |
disconnect_site_permission_callback ( ) : boolean | WP_Error | Verify that the user can disconnect the site. | |
dismiss_notice ( $data ) : array | wp-error | Handles dismissing of Jetpack Notices | |
get_module_requested ( string $route = '/module/(?P<slug>[a-z\-]+)' ) : array | Get the currently accessed route and return the module slug in it. | |
get_plugin ( WP_REST_Request $data ) : boolean | WP_Error | Get data about the queried plugin. Currently it only returns whether the plugin is active or not. | |
get_plugin_update_count ( ) : mixed | WP_Error | Get number of plugin updates available. | |
get_plugins ( ) : WP_REST_Response | WP_Error | Get plugins data in site. | |
get_remote_value ( string $module, string $option ) : boolean | Get a value not saved locally. | |
get_settings ( ) : object | Get miscellaneous settings for this Jetpack installation, like Holiday Snow. | |
get_site_data ( ) : array | Get site data, including for example, the site's current plan. | |
get_updateable_data_list ( string | array $selector = '' ) : array | Returns a list of module options or general settings that can be updated. | |
get_updateable_parameters ( string $selector = '' ) : array | Get the query parameters to update module options or general settings. | |
get_user_connection_data ( ) : object | Get miscellaneous user data related to the connection. Similar data available in old "My Jetpack". | |
get_user_connection_data_permission_callback ( ) : boolean | WP_Error | Verify that a user can get the data about the current user. | |
holiday_snow_option_name ( ) : string | Returns the proper name for Jetpack Holiday Snow setting. | |
identity_crisis_mitigation_permission_check ( ) : boolean | Verify that user can mitigate an identity crisis. | |
jetpack_connection_status ( ) : boolean | Get connection status for this Jetpack site. | |
jumpstart_activate ( WP_REST_Request $data ) : boolean | WP_Error | Activates a series of valid Jetpack modules and initializes some options. | |
jumpstart_deactivate ( WP_REST_Request $data ) : boolean | WP_Error | Dismisses Jumpstart so user is not prompted to go through it again. | |
jumpstart_toggle ( WP_REST_Request $data ) : boolean | WP_Error | Toggles activation or deactivation of the JumpStart | |
manage_modules_permission_check ( ) : boolean | Verify that user can manage Jetpack modules. | |
migrate_stats_and_subscribers ( ) : boolean | Handles identity crisis mitigation, migrating stats and subscribers from old url to this, new url. | |
prepare_modules_for_response ( string $modules = '', null | string $slug = null ) : array | Adds extra information for modules. | |
prepare_options_for_response ( string $module = '' ) : array | Remove 'validate_callback' item from options available for module. | |
register_endpoints ( ) | Declare the Jetpack REST API endpoints. | |
reset_jetpack_options ( WP_REST_Request $data ) : boolean | WP_Error | Reset Jetpack options | |
rest_authorization_required_code ( ) : integer | Contextual HTTP error code for authorization failure. | |
route ( $path, $classname, $method, $constructor_arguments = NULL, $endpoint_arguments = NULL ) | ||
sanitize_stats_allowed_roles ( string | boolean $value ) : boolean | If for some reason the roles allowed to see Stats are empty (for example, user tampering with checkboxes), return an array with only 'administrator' as the allowed role and save it for 'roles' option. | |
split_options ( array $separate_options, array $grouped_options, string $prefix = '' ) : array | Splits module options saved as arrays like relatedposts or verification_services_codes into separate options to be returned in the response. | |
start_fresh_connection ( ) : boolean | WP_Error | This IDC resolution will disconnect the site and re-connect to a completely new and separate shadow site than the original. | |
unlink_user ( $data ) : boolean | WP_Error | Unlinks current user from the WordPress.com Servers. | |
unlink_user_permission_callback ( ) : boolean | WP_Error | Verify that a user can use the /connection/user endpoint. Has to be a registered user and be currently linked. | |
update_setting ( WP_REST_Request $data ) : object | Update a single miscellaneous setting for this Jetpack installation, like Holiday Snow. | |
update_settings_permission_check ( ) : boolean | Verify that user can update Jetpack general settings. | |
validate_alphanum ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is an alphanumeric or empty string (to be able to clear the field). | |
validate_boolean ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is either a pure boolean or a numeric string that can be mapped to a boolean. | |
validate_custom_service ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter has enough information to build a custom sharing button. | |
validate_custom_service_id ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is a custom sharing service ID like 'custom-1461976264'. | |
validate_list_item ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter belongs to a list of admitted values. | |
validate_module_list ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter belongs to a list of admitted values. | |
validate_posint ( integer $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is a positive integer. | |
validate_services ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is among the views where the Sharing can be displayed. | |
validate_sharing_show ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is among the views where the Sharing can be displayed. | |
validate_stats_roles ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is among the roles allowed for Stats. | |
validate_string ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is a string. | |
validate_twitter_username ( string $value = '', WP_REST_Request $request, string $param ) : boolean | Validates that the parameter is a Twitter username or empty string (to be able to clear the field). | |
view_admin_page_permission_check ( ) : boolean | Verify that user can view Jetpack admin page. |
Méthode | Description | |
---|---|---|
core_get_plugins ( ) : array | Returns a list of all plugins in the site. | |
core_is_plugin_active ( $plugin ) : boolean | Checks if the queried plugin is active. |
public static activate_plugins_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has the capability 'jetpack_admin_page' and 'activate_plugins'. |
public static build_connect_url ( ) : string | WP_Error | ||
Résultat | string | WP_Error | A raw URL if the connection URL could be built; error message otherwise. |
public static configure_modules_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has the capability 'jetpack_configure_modules'. |
public static confirm_safe_mode ( ) : boolean | ||
Résultat | boolean | | WP_Error True if option is properly set. |
public static connect_url_permission_callback ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if user is able to disconnect the site. |
public static disconnect_site ( $data ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if Jetpack successfully disconnected. |
public static disconnect_site_permission_callback ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if user is able to disconnect the site. |
public static dismiss_notice ( $data ) : array | wp-error | ||
Résultat | array | wp-error |
public static get_module_requested ( string $route = '/module/(?P<slug>[a-z\-]+)' ) : array | ||
$route | string | Regular expression for the endpoint with the module slug to return. |
Résultat | array |
public static get_plugin ( WP_REST_Request $data ) : boolean | WP_Error | ||
$data | WP_REST_Request | { Array of parameters received by request. @type string $slug Plugin slug with the syntax 'plugin-directory/plugin-main-file.php'. } |
Résultat | boolean | WP_Error | True if module was activated. Otherwise, a WP_Error instance with the corresponding error. |
public static get_plugin_update_count ( ) : mixed | WP_Error | ||
Résultat | mixed | WP_Error | Number of plugin updates available. Otherwise, a WP_Error instance with the corresponding error. |
public static get_plugins ( ) : WP_REST_Response | WP_Error | ||
Résultat | WP_REST_Response | WP_Error | List of plugins in the site. Otherwise, a WP_Error instance with the corresponding error. |
public static get_settings ( ) : object | ||
Résultat | object | $response { Array of miscellaneous settings. @type bool $holiday-snow Did Jack steal Christmas? } |
public static get_site_data ( ) : array | ||
Résultat | array | Array of Jetpack modules. |
public static get_updateable_data_list ( string | array $selector = '' ) : array | ||
$selector | string | array | Module slug, 'any', or an array of parameters. If empty, it's assumed we're updating a module and we'll try to get its slug. If 'any' the full list is returned. If it's an array of parameters, includes the elements by matching keys. |
Résultat | array |
public static get_updateable_parameters ( string $selector = '' ) : array | ||
$selector | string | Selects a set of options to update, Can be empty, a module slug or 'any'. |
Résultat | array |
public static get_user_connection_data ( ) : object | ||
Résultat | object |
public static get_user_connection_data_permission_callback ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if user is able to unlink. |
public static holiday_snow_option_name ( ) : string | ||
Résultat | string |
public static identity_crisis_mitigation_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has capability 'jetpack_disconnect'. |
public static jetpack_connection_status ( ) : boolean | ||
Résultat | boolean | True if site is connected |
public static jumpstart_activate ( WP_REST_Request $data ) : boolean | WP_Error | ||
$data | WP_REST_Request | { Array of parameters received by request. } |
Résultat | boolean | WP_Error | True if Jumpstart succeeded. Otherwise, a WP_Error instance with the corresponding error. |
public static jumpstart_deactivate ( WP_REST_Request $data ) : boolean | WP_Error | ||
$data | WP_REST_Request | { Array of parameters received by request. } |
Résultat | boolean | WP_Error | True if Jumpstart was disabled or was nothing to dismiss. Otherwise, a WP_Error instance with a message. |
public static jumpstart_toggle ( WP_REST_Request $data ) : boolean | WP_Error | ||
$data | WP_REST_Request | { Array of parameters received by request. } |
Résultat | boolean | WP_Error | True if toggling Jumpstart succeeded. Otherwise, a WP_Error instance with the corresponding error. |
public static manage_modules_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has the capability 'jetpack_manage_modules'. |
public static migrate_stats_and_subscribers ( ) : boolean | ||
Résultat | boolean | | WP_Error True if option is properly set. |
public static prepare_options_for_response ( string $module = '' ) : array | ||
$module | string | Module slug. |
Résultat | array |
public static register_endpoints ( ) |
public static reset_jetpack_options ( WP_REST_Request $data ) : boolean | WP_Error | ||
$data | WP_REST_Request | { Array of parameters received by request. @type string $options Available options to reset are options|modules } |
Résultat | boolean | WP_Error | True if options were reset. Otherwise, a WP_Error instance with the corresponding error. |
public static rest_authorization_required_code ( ) : integer | ||
Résultat | integer |
public static route ( $path, $classname, $method, $constructor_arguments = NULL, $endpoint_arguments = NULL ) |
public static split_options ( array $separate_options, array $grouped_options, string $prefix = '' ) : array | ||
$separate_options | array | Array of options admitted by the module. |
$grouped_options | array | Option saved as array to be splitted. |
$prefix | string | Optional prefix for the separate option keys. |
Résultat | array |
public static start_fresh_connection ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error |
public static unlink_user ( $data ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if user successfully unlinked. |
public static unlink_user_permission_callback ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if user is able to unlink. |
public static update_setting ( WP_REST_Request $data ) : object | ||
$data | WP_REST_Request | |
Résultat | object | Jetpack miscellaneous settings. |
public static update_settings_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has the capability 'update_settings_permission_check'. |
public static validate_services ( string | boolean $value, WP_REST_Request $request, string $param ) : boolean | ||
$value | string | boolean | { Value to check received by request. @type array $visible List of slug of services to share to that are displayed directly in the page. @type array $hidden List of slug of services to share to that are concealed in a folding menu. } |
$request | WP_REST_Request | |
$param | string | Name of the parameter passed to endpoint holding $value. |
Résultat | boolean |
public static view_admin_page_permission_check ( ) : boolean | ||
Résultat | boolean | Whether user has the capability 'jetpack_admin_page'. |
public static $stats_roles |