MEETINGLISTLITE
in package
Class MEETINGLISTLITE
Table of Contents
Constants
- CSS_TEMPLATE_CUSTOM = 'custom'
- CSS_TEMPLATE_FULL_WIDTH = 'full_width'
- CSS_TEMPLATE_FULL_WIDTH_FORCE = 'full_width_force'
- MEETINGLISTLITE_VERSION = '1.2.3'
- REWRITE_VERSION = '1.0'
- SETTINGS_GROUP = 'meetinglistlite-group'
- TSML_CDN_URL = 'https://tsml-ui.code4recovery.org/app.js'
Properties
- $instance : null|self
- Singleton instance of the class.
- $plugin_dir : mixed
Methods
- __construct() : mixed
- Constructor method for initializing the plugin.
- activate() : void
- Plugin activation callback.
- assets() : void
- Enqueue plugin styles and scripts.
- create_menu() : void
- Create the plugin's settings menu in the WordPress admin.
- deactivate() : void
- Plugin deactivation callback.
- draw_settings() : void
- Display the plugin's settings page.
- get_instance() : self
- Get an instance of the MEETINGLISTLITE plugin class.
- plugin_setup() : void
- Setup method for initializing the plugin.
- register_settings() : void
- Register plugin settings with WordPress.
- sanitize_base_path() : string
- Sanitize base path input.
- sanitize_css_template() : string
- Sanitize CSS template selection.
- sanitize_custom_css() : string
- Sanitize custom CSS input.
- sanitize_tsml_config() : string
- Validate and sanitize TSML UI config JSON.
- settings_link() : array<string|int, mixed>
- Add a "Settings" link for the plugin in the WordPress admin.
- setup_shortcode() : string
- Setup and render the MEETINGLISTLITE shortcode.
- get_css_by_template() : string
- Get CSS based on template selection.
- get_css_full_width() : string
- Get CSS for Full Width template.
- get_css_full_width_force() : string
- Get CSS for Full Width (Force) template.
- get_default_css() : string
- Get default base CSS (for backward compatibility).
- get_default_tsml_config() : array<string|int, mixed>
- Get default TSML UI configuration.
- get_tsml_config() : array<string|int, mixed>
- Get TSML UI configuration (custom or default).
- register_rewrite_rules() : void
- Register custom rewrite rules.
Constants
CSS_TEMPLATE_CUSTOM
private
mixed
CSS_TEMPLATE_CUSTOM
= 'custom'
CSS_TEMPLATE_FULL_WIDTH
private
mixed
CSS_TEMPLATE_FULL_WIDTH
= 'full_width'
CSS_TEMPLATE_FULL_WIDTH_FORCE
private
mixed
CSS_TEMPLATE_FULL_WIDTH_FORCE
= 'full_width_force'
MEETINGLISTLITE_VERSION
private
mixed
MEETINGLISTLITE_VERSION
= '1.2.3'
REWRITE_VERSION
private
mixed
REWRITE_VERSION
= '1.0'
SETTINGS_GROUP
private
mixed
SETTINGS_GROUP
= 'meetinglistlite-group'
TSML_CDN_URL
private
mixed
TSML_CDN_URL
= 'https://tsml-ui.code4recovery.org/app.js'
Properties
$instance
Singleton instance of the class.
private
static null|self
$instance
= null
$plugin_dir
private
mixed
$plugin_dir
Methods
__construct()
Constructor method for initializing the plugin.
public
__construct() : mixed
activate()
Plugin activation callback.
public
activate() : void
Registers rewrite rules and flushes permalinks.
assets()
Enqueue plugin styles and scripts.
public
assets() : void
This method is responsible for enqueueing the necessary CSS and JavaScript files for the MEETINGLISTLITE plugin to function correctly.
create_menu()
Create the plugin's settings menu in the WordPress admin.
public
static create_menu() : void
This method adds the MEETINGLISTLITE plugin's settings page to the WordPress admin menu. It also adds a settings link in the list of plugins on the plugins page.
deactivate()
Plugin deactivation callback.
public
deactivate() : void
Flushes rewrite rules to clean up.
draw_settings()
Display the plugin's settings page.
public
static draw_settings() : void
This method renders and displays the settings page for the MEETINGLISTLITE plugin in the WordPress admin. It includes form fields for configuring plugin settings such as theme, language, layout, and special keytags.
get_instance()
Get an instance of the MEETINGLISTLITE plugin class.
public
static get_instance() : self
This method ensures that only one instance of the MEETINGLISTLITE class is created during the plugin's lifecycle.
Return values
self —An instance of the MEETINGLISTLITE class.
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.
register_settings()
Register plugin settings with WordPress.
public
static register_settings() : void
This method registers the plugin settings with WordPress using the
register_setting function. It defines the settings for 'meetinglistlite_data_src',
'meetinglistlite_tsml_config', meetinglistlite_google_key, and 'meetinglistlite_custom_css'.
sanitize_base_path()
Sanitize base path input.
public
static sanitize_base_path(string $input) : string
Parameters
- $input : string
-
Raw base path input.
Return values
string —Sanitized base path.
sanitize_css_template()
Sanitize CSS template selection.
public
static sanitize_css_template(string $input) : string
Parameters
- $input : string
-
Raw template selection input.
Return values
string —Sanitized template selection.
sanitize_custom_css()
Sanitize custom CSS input.
public
static sanitize_custom_css(string $input) : string
Parameters
- $input : string
-
Raw CSS input.
Return values
string —Sanitized CSS.
sanitize_tsml_config()
Validate and sanitize TSML UI config JSON.
public
static sanitize_tsml_config(string $input) : string
Parameters
- $input : string
-
Raw JSON input.
Return values
string —Sanitized JSON or empty string if invalid.
settings_link()
Add a "Settings" link for the plugin in the WordPress admin.
public
static settings_link(array<string|int, mixed> $links) : array<string|int, mixed>
This method adds a "Settings" link for the MEETINGLISTLITE plugin in the WordPress admin under the plugins list.
Parameters
- $links : array<string|int, mixed>
-
An array of plugin action links.
Return values
array<string|int, mixed> —An updated array of plugin action links.
setup_shortcode()
Setup and render the MEETINGLISTLITE shortcode.
public
static setup_shortcode([string|array<string|int, mixed> $attrs = [] ]) : string
This method processes the attributes provided to the [tsml_ui] shortcode and sets up the necessary shortcode attributes for rendering the meeting list If no shortcode attributes are provided, default values from plugin options are used.
Parameters
- $attrs : string|array<string|int, mixed> = []
-
Shortcode attributes.
Return values
string —The HTML for the MEETINGLISTLITE shortcode.
get_css_by_template()
Get CSS based on template selection.
private
static get_css_by_template(string $template) : string
Parameters
- $template : string
-
Template identifier.
Return values
string —CSS styles for the template.
get_css_full_width()
Get CSS for Full Width template.
private
static get_css_full_width() : string
Return values
string —CSS styles for Full Width template.
get_css_full_width_force()
Get CSS for Full Width (Force) template.
private
static get_css_full_width_force() : string
Return values
string —CSS styles for Full Width (Force) template.
get_default_css()
Get default base CSS (for backward compatibility).
private
static get_default_css() : string
Return values
string —Default CSS styles.
get_default_tsml_config()
Get default TSML UI configuration.
private
static get_default_tsml_config() : array<string|int, mixed>
We do this because default config is program specific.
Return values
array<string|int, mixed> —Default configuration array.
get_tsml_config()
Get TSML UI configuration (custom or default).
private
static get_tsml_config() : array<string|int, mixed>
Return values
array<string|int, mixed> —Configuration array.
register_rewrite_rules()
Register custom rewrite rules.
private
register_rewrite_rules(string $base_path) : void
Parameters
- $base_path : string
-
The base path for the rewrite rule (e.g., 'meetings'). ** @return void