PHP Class WPSEO_Admin_Banner_Spot, wordpress-seo

显示文件 Open project: yoast/wordpress-seo Class Usage Examples

Public Methods

Method Description
__construct ( string $title, WPSEO_Admin_Banner_Renderer $banner_renderer = null ) WPSEO_Admin_Banner_Spot constructor.
add_banner ( WPSEO_Admin_Banner $banner ) Adds an admin banner.
get_description ( ) : string Returns the description.
get_title ( ) : string Returns the title.
has_banners ( ) : boolean Checks if there are any banners set.
render_banner ( ) : string Renders the banner.
set_description ( string $description ) Sets the description

Protected Methods

Method Description
get_random_banner ( ) : null | WPSEO_Admin_Banner Returns a random banner.

Method Details

__construct() public method

WPSEO_Admin_Banner_Spot constructor.
public __construct ( string $title, WPSEO_Admin_Banner_Renderer $banner_renderer = null )
$title string The title for the spot.
$banner_renderer WPSEO_Admin_Banner_Renderer The renderer for the banner.

add_banner() public method

Adds an admin banner.
public add_banner ( WPSEO_Admin_Banner $banner )
$banner WPSEO_Admin_Banner The banner to add.

get_description() public method

Returns the description.
public get_description ( ) : string
return string

get_random_banner() protected method

Returns a random banner.
protected get_random_banner ( ) : null | WPSEO_Admin_Banner
return null | WPSEO_Admin_Banner

get_title() public method

Returns the title.
public get_title ( ) : string
return string

has_banners() public method

Checks if there are any banners set.
public has_banners ( ) : boolean
return boolean

render_banner() public method

Renders the banner.
public render_banner ( ) : string
return string

set_description() public method

Sets the description
public set_description ( string $description )
$description string The description.