Documentation

FETCHMEDITATION

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

Properties

$instance

Singleton instance of the class.

private static null|self $instance = null

Methods

__construct()

Constructor method for initializing the plugin.

public __construct() : mixed

enqueue_backend_files()

public enqueue_backend_files(string $hook) : void
Parameters
$hook : string

plugin_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.

render_shortcode()

public static render_shortcode([string|array<string|int, mixed> $attrs = [] ]) : string
Parameters
$attrs : string|array<string|int, mixed> = []
Return values
string
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
string

determine_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>
Return values
string

        
On this page

Search results