PHP Class Jetpack_Connection_Banner, jetpack

显示文件 Open project: automattic/jetpack Class Usage Examples

Public Methods

Method Description
check_ab_test_not_expired ( null $now = null ) : boolean Checks whether the connection banner A/B test should be ran.
enqueue_banner_scripts ( ) Enqueues JavaScript for new connection banner.
get_dismiss_and_deactivate_url ( ) : string Returns a URL that will dismiss allow the current user to dismiss the connection banner.
get_random_connection_banner_value ( ) : integer Gets the value for which connection banner to show, and initializes if not set.
init ( )
maybe_initialize_hooks ( $current_screen ) Will initialize hooks to display the new and legacy connection banners if the current user can connect Jetpack, if Jetpack has not been deactivated, and if the current page is the plugins page.
network_connect_notice ( ) Renders the legacy network connection banner.
render_banner ( ) Renders the new connection banner.
render_legacy_banner ( ) Renders the legacy connection banner.

Private Methods

Method Description
__construct ( ) Jetpack_Connection_Banner constructor.

Method Details

check_ab_test_not_expired() static public method

Checks whether the connection banner A/B test should be ran.
Since: 4.4.0
static public check_ab_test_not_expired ( null $now = null ) : boolean
$now null
return boolean

enqueue_banner_scripts() public method

Enqueues JavaScript for new connection banner.
Since: 4.4.0

get_dismiss_and_deactivate_url() public method

Returns a URL that will dismiss allow the current user to dismiss the connection banner.
Since: 4.4.0

get_random_connection_banner_value() static public method

Gets the value for which connection banner to show, and initializes if not set.
Since: 4.4.0

init() static public method

static public init ( )

maybe_initialize_hooks() public method

This method should not be called if the site is connected to WordPress.com or if the site is in development mode.
Since: 4.4.0
public maybe_initialize_hooks ( $current_screen )
$current_screen

network_connect_notice() public method

Renders the legacy network connection banner.

render_banner() public method

Renders the new connection banner.
Since: 4.4.0
public render_banner ( )

render_legacy_banner() public method

Renders the legacy connection banner.