PHP Class Pressbooks\Activation

ファイルを表示 Open project: pressbooks/pressbooks

Public Methods

Method 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

Method 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 method

Constructor
public __construct ( )

forcePbColors() static public method

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 method

Activation hook
See also: register_activation_hook()

wpmuNewBlog() public method

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