Jetpack::enable_module_configurable PHP Method

enable_module_configurable() public static method

public static enable_module_configurable ( $module )
    public static function enable_module_configurable($module)
    {
        $module = Jetpack::get_module_slug($module);
        add_filter('jetpack_module_configurable_' . $module, '__return_true');
    }

Usage Example

Example #1
0
function stats_load()
{
    Jetpack::enable_module_configurable(__FILE__);
    Jetpack::module_configuration_load(__FILE__, 'stats_configuration_load');
    Jetpack::module_configuration_head(__FILE__, 'stats_configuration_head');
    Jetpack::module_configuration_screen(__FILE__, 'stats_configuration_screen');
    // Generate the tracking code after wp() has queried for posts.
    add_action('template_redirect', 'stats_template_redirect', 1);
    add_action('wp_head', 'stats_admin_bar_head', 100);
    add_action('jetpack_admin_menu', 'stats_admin_menu');
    add_action('wp_dashboard_setup', 'stats_register_dashboard_widget');
    // Tell HQ about changed settings
    add_action('update_option_home', 'stats_update_blog');
    add_action('update_option_siteurl', 'stats_update_blog');
    add_action('update_option_blogname', 'stats_update_blog');
    add_action('update_option_blogdescription', 'stats_update_blog');
    add_action('update_option_timezone_string', 'stats_update_blog');
    add_action('add_option_timezone_string', 'stats_update_blog');
    add_action('update_option_gmt_offset', 'stats_update_blog');
    add_action('update_option_page_on_front', 'stats_update_blog');
    add_action('update_option_permalink_structure', 'stats_update_blog');
    add_action('update_option_category_base', 'stats_update_blog');
    add_action('update_option_tag_base', 'stats_update_blog');
    // Tell HQ about changed posts
    add_action('save_post', 'stats_update_post', 10, 1);
    add_filter('jetpack_xmlrpc_methods', 'stats_xmlrpc_methods');
    foreach (stats_get_option('roles') as $role) {
        $role = get_role($role);
        if ($role) {
            $role->add_cap('view_stats');
        }
    }
}
All Usage Examples Of Jetpack::enable_module_configurable
Jetpack