PHP Class Pressbooks\Activation

Afficher le fichier Open project: pressbooks/pressbooks

Méthodes publiques

Méthode Description
__construct ( ) Constructor
forcePbColors ( integer $id, object $user = null ) Never let a user change [ Your Profile > Admin Color Scheme ]
registerActivationHook ( ) Activation hook
wpmuNewBlog ( integer $blog_id, integer $user_id ) Runs activation function and sets up default WP options for new blog, a.k.a. when a registered user creates a new blog

Private Methods

Méthode Description
isBookSetup ( ) : boolean Determine if book is set up or not to avoid duplication (i.e. if activation functions have run and default options set)
wpmuActivate ( ) Set up default terms for Front Matter and Back Matter Insert default part, chapter, front matter, and back matter Insert default pages (Authors, Cover, TOC, About, Buy, and Access Denied) Remove content generated by wp_install_defaults Anything which needs to run on blog activation must go in this function

Method Details

__construct() public méthode

Constructor
public __construct ( )

forcePbColors() static public méthode

Never let a user change [ Your Profile > Admin Color Scheme ]
static public forcePbColors ( integer $id, object $user = null )
$id integer
$user object (optional)

registerActivationHook() public méthode

Activation hook
See also: register_activation_hook()

wpmuNewBlog() public méthode

Runs activation function and sets up default WP options for new blog, a.k.a. when a registered user creates a new blog
public wpmuNewBlog ( integer $blog_id, integer $user_id )
$blog_id integer
$user_id integer