Custom_Background::init
Sets up the hooks for the Custom Background admin page.
Method of the class: Custom_Background{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Custom_Background = new Custom_Background(); $Custom_Background->init();
Changelog
| Since 3.0.0 | Introduced. |
Custom_Background::init() Custom Background::init code WP 7.0
public function init() {
$page = add_theme_page(
_x( 'Background', 'custom background' ),
_x( 'Background', 'custom background' ),
'edit_theme_options',
'custom-background',
array( $this, 'admin_page' )
);
if ( ! $page ) {
return;
}
add_action( "load-{$page}", array( $this, 'admin_load' ) );
add_action( "load-{$page}", array( $this, 'take_action' ), 49 );
add_action( "load-{$page}", array( $this, 'handle_upload' ), 49 );
if ( $this->admin_header_callback ) {
add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
}
}