Popup
in package
Generates the popup structure.
Creates a popup where content will be inserted for help links.
Tags
Table of Contents
Properties
- $content : string
- The popup content.
Methods
- __construct() : mixed
- Constructor method.
- build() : mixed
- Outputs popup.
- format_content() : mixed
- Formats content for popup.
- get_instance() : Popup
- Returns the single instance of the class.
- link() : mixed
- Outputs popup link.
- output() : mixed
- Manually outputs a popup.
- update_content() : mixed
- Updates the content of the popup.
Properties
$content
The popup content.
public
string
$content
Methods
__construct()
Constructor method.
public
__construct() : mixed
Tags
build()
Outputs popup.
public
build() : mixed
Tags
format_content()
Formats content for popup.
public
static format_content([int $post_id = null ][, string $url = null ][, string $raw_content = null ]) : mixed
Parameters
- $post_id : int = null
-
The ID of the post.
- $url : string = null
-
The url of the post or page whose content to fetch.
- $raw_content : string = null
-
Raw content to be used directly.
Tags
get_instance()
Returns the single instance of the class.
public
static get_instance() : Popup
Return values
Popup —The single instance of the class.
link()
Outputs popup link.
public
static link([int $post_id = null ][, string $link_text = null ][, string $url = null ][, string $raw_content = null ]) : mixed
Parameters
- $post_id : int = null
-
The ID of the post from which to retrieve the content.
- $link_text : string = null
-
Optional. The text to display. Defaults to ? icon.
- $url : string = null
-
Optional. The full url of the page to display.
- $raw_content : string = null
-
Optional. Raw content to be used directly.
Tags
output()
Manually outputs a popup.
public
output(mixed $content) : mixed
Parameters
- $content : mixed
Tags
update_content()
Updates the content of the popup.
public
update_content(string $new_content) : mixed
Parameters
- $new_content : string
-
The new content to be displayed in the popup.