Pressbooks\Activation::registerActivationHook PHP Метод

registerActivationHook() публичный Метод

Activation hook
См. также: register_activation_hook()
    function registerActivationHook()
    {
        // Prevent overwriting customizations if Pressbooks has been disabled
        if (!get_site_option('pressbooks-activated')) {
            // Insert Pressbooks description on root blog
            update_blog_option(1, 'blogdescription', 'Simple Book Publishing');
            // Configure theme and remove widgets from root blog
            update_blog_option(1, 'template', 'pressbooks-publisher');
            update_blog_option(1, 'stylesheet', 'pressbooks-publisher');
            delete_blog_option(1, 'sidebars_widgets');
            // Add "activated" key to enable check above
            add_site_option('pressbooks-activated', true);
        }
    }