Using WordPress ‘enable_update_services_configuration’ PHP filter

The enable_update_services_configuration WordPress PHP filter allows you to control the visibility of the Update Services section in the Writing settings screen.

Usage

add_filter('enable_update_services_configuration', 'your_custom_function');
function your_custom_function($enable) {
    // Your custom code here

    return $enable;
}

Parameters

  • $enable (bool) – Whether to enable the Update Services settings area. Default is true.

More information

See WordPress Developer Resources: enable_update_services_configuration

Examples

Disable Update Services section

Disable the Update Services section in the Writing settings screen.

add_filter('enable_update_services_configuration', 'disable_update_services_section');
function disable_update_services_section($enable) {
    return false;
}

Enable Update Services section for admins only

Enable the Update Services section in the Writing settings screen only for administrators.

add_filter('enable_update_services_configuration', 'admin_only_update_services_section');
function admin_only_update_services_section($enable) {
    if (current_user_can('manage_options')) {
        return true;
    }
    return false;
}

Enable Update Services section based on user role

Enable the Update Services section in the Writing settings screen only for users with the ‘editor’ role.

add_filter('enable_update_services_configuration', 'editor_role_update_services_section');
function editor_role_update_services_section($enable) {
    $user = wp_get_current_user();
    if (in_array('editor', $user->roles)) {
        return true;
    }
    return false;
}

Enable Update Services section based on user capability

Enable the Update Services section in the Writing settings screen only for users with the ‘publish_posts’ capability.

add_filter('enable_update_services_configuration', 'publish_posts_capability_update_services_section');
function publish_posts_capability_update_services_section($enable) {
    if (current_user_can('publish_posts')) {
        return true;
    }
    return false;
}

Enable Update Services section based on custom condition

Enable the Update Services section in the Writing settings screen only when a custom condition is met.

add_filter('enable_update_services_configuration', 'custom_condition_update_services_section');
function custom_condition_update_services_section($enable) {
    // Check custom condition
    $custom_condition = true;

    if ($custom_condition) {
        return true;
    }
    return false;
}