FETCHMEDITATION
in package
Class FETCHMEDITATION
Table of Contents
Constants
- DEFAULT_BOOK = 'JFT'
- DEFAULT_LANGUAGE = 'English'
- DEFAULT_LAYOUT = 'table'
- PLUG_SLUG = 'fetch-meditation'
- SETTINGS_GROUP = 'fetch-meditation-group'
Properties
- $instance : null|self
- Singleton instance of the class.
Methods
- __construct() : mixed
- Constructor method for initializing the plugin.
- create_menu() : void
- draw_settings() : void
- enqueue_backend_files() : void
- enqueue_frontend_files() : void
- get_instance() : self
- plugin_setup() : void
- Setup method for initializing the plugin.
- register_settings() : void
- render_shortcode() : string
- settings_link() : array<string|int, mixed>
- build_layout() : string
- determine_option() : string
- Determines the option value based on the provided attributes or fallbacks to a default value.
- render_select_option() : string
Constants
DEFAULT_BOOK
private
mixed
DEFAULT_BOOK
= 'JFT'
DEFAULT_LANGUAGE
private
mixed
DEFAULT_LANGUAGE
= 'English'
DEFAULT_LAYOUT
private
mixed
DEFAULT_LAYOUT
= 'table'
PLUG_SLUG
private
mixed
PLUG_SLUG
= 'fetch-meditation'
SETTINGS_GROUP
private
mixed
SETTINGS_GROUP
= 'fetch-meditation-group'
Properties
$instance
Singleton instance of the class.
private
static null|self
$instance
= null
Methods
__construct()
Constructor method for initializing the plugin.
public
__construct() : mixed
create_menu()
public
static create_menu() : void
draw_settings()
public
static draw_settings() : void
enqueue_backend_files()
public
enqueue_backend_files(string $hook) : void
Parameters
- $hook : string
enqueue_frontend_files()
public
enqueue_frontend_files() : void
get_instance()
public
static get_instance() : self
Return values
selfplugin_setup()
Setup method for initializing the plugin.
public
plugin_setup() : void
This method checks if the current context is in the admin dashboard or not. If in the admin dashboard, it registers admin-related actions and settings. If not in the admin dashboard, it sets up a shortcode and associated actions.
register_settings()
public
static register_settings() : void
render_shortcode()
public
static render_shortcode([string|array<string|int, mixed> $attrs = [] ]) : string
Parameters
- $attrs : string|array<string|int, mixed> = []
Return values
stringsettings_link()
public
static settings_link(array<string|int, mixed> $links) : array<string|int, mixed>
Parameters
- $links : array<string|int, mixed>
Return values
array<string|int, mixed>build_layout()
private
static build_layout(object $entry, bool $in_block) : string
Parameters
- $entry : object
- $in_block : bool
Return values
stringdetermine_option()
Determines the option value based on the provided attributes or fallbacks to a default value.
private
static determine_option(string|array<string|int, mixed> $attrs, string $option) : string
Parameters
- $attrs : string|array<string|int, mixed>
-
An string or associative array of attributes where the key is the option name.
- $option : string
-
The specific option to fetch (e.g., 'language', 'book', 'layout').
Return values
string —Sanitized and lowercased value of the determined option.
render_select_option()
private
static render_select_option(string $name, string $selected_value, array<string|int, mixed> $options) : string
Parameters
- $name : string
- $selected_value : string
- $options : array<string|int, mixed>