Tkt_Template_Builder_Admin

The admin-specific functionality of the plugin.

Description
  • enqueues all styles and scripts for admin area
  • alters TinyMCE
  • Add, Remove, Populate, Save metaboxes
  • Add Template CPT
  • Add Template CPT admin list columns
  • Remove row actions in admin list
  • Add Help Tabs
  • Add ShortCodes to TukuToi ShortCodes GUI
Tags
author

Beda Schmid beda@tukutoi.com

Table of Contents

$plugin_name  : string
The ID of this plugin.
$plugin_prefix  : string
The unique prefix of this plugin.
$version  : string
The version of this plugin.
__construct()  : mixed
Initialize the class and set its properties.
add_metaboxes()  : mixed
Add Metaboxe to the Template Editor Screen.
add_shortcodes_to_gui()  : mixed
Add ShortCodes to the GUI.
add_template_admin_list_columns()  : mixed
Add Columns to the Template Posts Admin List.
enqueue_scripts()  : mixed
Register the JavaScript for the admin area.
enqueue_styles()  : mixed
Register the stylesheets for the admin area.
help_tab_edit_template_screen()  : mixed
Add a Help Tab in the Single Template Edit Screen.
modify_editor()  : mixed
Modify the native WP Editor
populate_template_admin_list_columns()  : mixed
Populate the Column Values.
register_template()  : mixed
Register the Post Type acting as Template.
remove_metaboxes()  : mixed
Remove foreign Metaboxes.
remove_row_actions()  : mixed
Remove some of the Template Admin List actions.
save_metabox()  : mixed
Callback to save Metabox settings
template_settings_metabox()  : mixed
Callback to add Metabox
get_ct_options()  : mixed
Get the Options of available Templates
get_settings()  : mixed
Get the Options of a specific Template
get_template_options()  : mixed
Get the Options of available Templates

Properties

$plugin_prefix

The unique prefix of this plugin.

private string $plugin_prefix
Description

The string used to uniquely prefix technical functions of this plugin.

Tags
since
0.0.1
access

private

$version

The version of this plugin.

private string $version
Description

The current version of this plugin.

Tags
since
0.0.1
access

private

Methods

__construct()

Initialize the class and set its properties.

public __construct(string $plugin_name, string $plugin_prefix, string $version, object $declarations) : mixed
Parameters
$plugin_name
(string) The name of this plugin.
$plugin_prefix
(string) The unique prefix of this plugin.
$version
(string) The version of this plugin.
$declarations
(object) The declarations object.
Tags
since
0.0.1
Return
(mixed)

add_shortcodes_to_gui()

Add ShortCodes to the GUI.

public add_shortcodes_to_gui(string $file, string $shortcode) : mixed
Description

This happens only if TukuToi ShortCodes is active.

Parameters
$file
(string) The filepath to the ShortCode GUI Form.
$shortcode
(string) The ShortCode tag for which we add the GUI Form.
Tags
since
1.0.0
Return
(mixed)

add_template_admin_list_columns()

Add Columns to the Template Posts Admin List.

public add_template_admin_list_columns(array<string|int, mixed> $columns) : mixed
Parameters
$columns
(array<string|int, mixed>) The Admin Screen Columns.
Return
(mixed)

enqueue_scripts()

Register the JavaScript for the admin area.

public enqueue_scripts(string $hook_suffix) : mixed
Description

Dependencies:

  • csslint
  • htmlhint
  • jshint
  • wp-codemirror
  • quicktags
Parameters
$hook_suffix
(string) The current admin page.
Return
(mixed)

enqueue_styles()

Register the stylesheets for the admin area.

public enqueue_styles(string $hook_suffix) : mixed
Parameters
$hook_suffix
(string) The current admin page.
Tags
since
0.0.1
Return
(mixed)

help_tab_edit_template_screen()

Add a Help Tab in the Single Template Edit Screen.

public help_tab_edit_template_screen() : mixed
Tags
todo

i18n this.

Return
(mixed)

populate_template_admin_list_columns()

Populate the Column Values.

public populate_template_admin_list_columns(string $column, int $post_id) : mixed
Parameters
$column
(string) The Admin Screen Column.
$post_id
(int) The current Post ID.
Return
(mixed)

remove_metaboxes()

Remove foreign Metaboxes.

public remove_metaboxes() : mixed
Description

We can remove Metaboxes only after they are added. This hook runs at PHP_INT_MAX.

Tags
todo

There is a BUG in ClassicPress see https://github.com/ClassicPress/ClassicPress/issues/777.

Return
(mixed)

remove_row_actions()

Remove some of the Template Admin List actions.

public remove_row_actions(array<string|int, mixed> $actions) : mixed
Parameters
$actions
(array<string|int, mixed>) The available default Posts Row Actions.
Return
(mixed)

save_metabox()

Callback to save Metabox settings

public save_metabox(int $post_id, object $post) : mixed
Parameters
$post_id
(int) The Current Post ID.
$post
(object) The Current Post Object.
Return
(mixed)

template_settings_metabox()

Callback to add Metabox

public template_settings_metabox(object $post, array<string|int, mixed> $metabox) : mixed
Parameters
$post
(object) The Current Post Object.
$metabox
(array<string|int, mixed>) The Metabox Array.
Return
(mixed)

get_settings()

Get the Options of a specific Template

private get_settings(int $template_id) : mixed
Parameters
$template_id
(int) The ID of the current edited Template.
Return
(mixed)

Search results