Custom_Background::init()

In this article

Sets up the hooks for the Custom Background admin page.

Source

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 );
	}
}

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.