CACHE_PATH
CACHE_PATH
_deprecated_argument(string $function_name, string $release, string $message = null)
Mark a function argument as deprecated and inform when it has been used.
This function is to be used whenever a deprecated function argument is used. Before this function is called, the argument must be checked for whether it was used by comparing it to its default value or evaluating whether it is empty.
There is a hook deprecated_argument_run
that will be called that can be used
to get the backtrace up to what file and function used the deprecated
argument.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
Example Usage:
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '0.9' );
}
string | $function_name | The function that was called. |
string | $release | The release of TriTan CMS that deprecated the argument used. |
string | $message | Optional. A message regarding the change. Default null. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_deprecated_class(string $class_name, string $release, string $replacement = null)
Mark a class as deprecated and inform when it has been used.
There is a hook deprecated_class_run that will be called that can be used to get the backtrace up to what file, function/class called the deprecated class.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
This function is to be used in every class that is deprecated.
string | $class_name | The class that was called. |
string | $release | The release of TriTan CMS that deprecated the class. |
string | $replacement | Optional. The class that should have been called. Default null. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_deprecated_class_method(string $method_name, string $release, string $replacement = null)
Mark a class's method as deprecated and inform when it has been used.
There is a hook deprecated_class_method_run that will be called that can be used to get the backtrace up to what file, function/class called the deprecated method.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
This function is to be used in every class's method that is deprecated.
string | $method_name | The class method that was called. |
string | $release | The release of TriTan CMS that deprecated the class's method. |
string | $replacement | Optional. The class method that should have been called. Default null. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_deprecated_function(string $function_name, string $release, string $replacement = null)
Mark a function as deprecated and inform when it has been used.
There is a hook deprecated_function_run that will be called that can be used to get the backtrace up to what file and function called the deprecated function.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
This function is to be used in every function that is deprecated.
string | $function_name | The function that was called. |
string | $release | The release of TriTan CMS that deprecated the function. |
string | $replacement | Optional. The function that should have been called. Default null. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_deprecated_hook(string $hook, string $release, string $replacement = null, string $message = null)
Marks a deprecated action or filter hook as deprecated and throws a notice.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
string | $hook | The hook that was used. |
string | $release | The release of TriTan CMS that deprecated the hook. |
string | $replacement | Optional. The hook that should have been used. |
string | $message | Optional. A message regarding the change. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_escape(string $string) : mixed
A wrapper for htmLawed which is a set of functions for html purifier
string | $string |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
_file_get_contents(string $filename, boolean $use_include_path = false, boolean $context = true)
Custom function to use curl, fopen, or use file_get_contents if curl is not available.
Uses trigger_include_path_search
, resource_context
and stream_context_create_options
filters.
string | $filename | Resource to read. |
boolean | $use_include_path | Whether or not to use include path. |
boolean | $context | Whether or not to use a context resource. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
_include(string $file, boolean $once = false, boolean|\Closure $show_errors = true) : boolean
Special function for files including
string | $file | |
boolean | $once | |
boolean|\Closure | $show_errors | If bool error will be processed, if Closure - only Closure will be called |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
_include_once(string $file, boolean|\Closure $show_errors = true) : boolean
Special function for files including
string | $file | |
boolean|\Closure | $show_errors | If bool error will be processed, if Closure - only Closure will be called |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
_incorrectly_called(string $function_name, string $message, string $release)
Mark something as being incorrectly called.
There is a hook incorrectly_called_run that will be called that can be used to get the backtrace up to what file and function called the deprecated function.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
string | $function_name | The function that was called. |
string | $message | A message explaining what has been done incorrectly. |
string | $release | The release of TriTan CMS where the message was added. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
_require(string $file, boolean $once = false, boolean|\Closure $show_errors = true) : boolean
Special function for files including
string | $file | |
boolean | $once | |
boolean|\Closure | $show_errors | If bool error will be processed, if Closure - only Closure will be called |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
_require_once(string $file, boolean|\Closure $show_errors = true) : boolean
Special function for files including
string | $file | |
boolean|\Closure | $show_errors | If bool error will be processed, if Closure - only Closure will be called |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
_rmdir(string $dir)
Removes directory recursively along with any files.
string | $dir | Directory that should be removed. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
_t(\type $msgid, \type $domain = '') : string
Displays the returned translated text.
\type | $msgid | The translated string. |
\type | $domain | Domain lookup for translated text. |
Translated text according to current locale.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
_trigger_error(string $message, string $level = E_USER_NOTICE)
Wrapper function for the core PHP function: trigger_error.
This function makes the error a little more understandable for the end user to track down the issue.
string | $message | Custom message to print. |
string | $level | Predefined PHP error constant. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
_ttcms_cache_init()
Sets up object cache global scope and assigns it based on the type of caching system used.
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
_ttcms_cleanup_file_header_comment(string $str) : string
Strip close comment and close php tags from file headers.
string | $str | Header comment to clean up. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
_ttcms_image_optimizer(string $pathToImage, string $pathToOptimizded) : string
Image optimizer.
string | $pathToImage | Path to original image. |
string | $pathToOptimizded | Path to where optimized image should be saved. |
Optimized image.
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
_ttcms_phpmailer(boolean $bool = true)
Sets up PHPMailer global scope.
boolean | $bool | Set whether to use exceptions for error handling. Default: true. |
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.4 |
_ttcms_random_lib() : \type
Sets up random number and string generator global scope.
package |
Default |
---|---|
file |
app/functions/global-function.php |
since | 0.9 |
activate_plugin(string $id) : mixed
Wrapper function for PluginsRepository::activate() and activates plugin based on $_GET['id'].
string | $id | ID of the plugin to be activated. |
Activates plugin if it exists.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
add_admin_submenu(string $location, string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Add an admin submenu page link.
Uses adminsubmenu$location_{$menu_route} filter hook.
string | $location | Submenu location. |
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
add_dashboard_submenu(string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Adds an admin dashboard submenu page link.
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
add_files_cache_directory()
Adds missing files to site's cache directory.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.5 |
add_options_submenu(string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Adds an options submenu page link.
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
add_parsecode(\type $tag, \type $func) : \type
\type | $tag | |
\type | $func |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
global |
type $parsecode_tags |
add_plugins_submenu(string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Adds a plugin submenu page link.
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
add_post_meta(integer $post_id, string $meta_key, mixed $meta_value, boolean $unique = false) : integer|false
Add meta data field to a post.
integer | $post_id | Post ID. |
string | $meta_key | Metadata name. |
mixed | $meta_value | Metadata value. Must be serializable if non-scalar. |
boolean | $unique | Optional. Whether the same key should not be added. Default false. |
Meta ID on success, false on failure.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
add_query_arg(string $key, string $value, string $url) : string
Retrieves a modified URL query string.
Uses query_arg_port
filter hook.
string | $key | A query variable key. |
string | $value | A query variable value, or a URL to act upon. |
string | $url | A URL to act upon. |
Returns modified url query string.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
add_site_user_meta(integer $site_id, array $params = array())
Adds user meta data for specified site.
integer | $site_id | Site ID. |
array | $params | Parameters to set (assign_id or role). |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
add_sites_submenu(string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Adds a sites submenu page link.
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
add_trailing_slash(string $string) : string
Appends a trailing slash.
Will remove trailing forward and backslashes if it exists already before adding a trailing forward slash. This prevents double slashing a string or path.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string | $string | What to add the trailing slash to. |
String with trailing slash added.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
add_user_meta(integer $user_id, string $meta_key, mixed $meta_value, boolean $unique = false) : integer|false
Adds meta data to a user.
integer | $user_id | User ID. |
string | $meta_key | Metadata name. |
mixed | $meta_value | Metadata value. |
boolean | $unique | Optional. Whether the same key should not be added. Default false. |
Meta ID on success, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
add_user_to_site(object|integer $user, object|integer $site, string $role) : integer
Add user to a site.
object|integer | $user | User to add to a site. |
object|integer | $site | Site to add user to. |
string | $role | Role to assign to user for this site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
add_users_submenu(string $menu_title, string $menu_route, string $screen, string $permission = null) : false|string
Adds a users submenu page link.
string | $menu_title | The text to be used for the menu. |
string | $menu_route | The route part of the url. |
string | $screen | Unique name of menu's screen. |
string | $permission | The permission required for this menu to be displayed to the user. |
Return the new menu or false if permission is not met.
package |
Default |
---|---|
file |
app/functions/menu-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.8 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
admin_url(string $path = '', string $scheme = 'admin') : string
Returns the url to the admin area for a given site.
string | $path | Optional. Path relative to the admin url. Default empty. |
string | $scheme | Optional. The scheme to use. Accepts 'http' or 'https', to force those schemes. Default 'admin'. |
Admin url link with optional path appended.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
ae(string $perm) : string
Checks if logged in user can access menu, tab, or page.
string | $perm | Permission to check for. |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
all(array $ps)
Example usage:
it("should do a bunch of calculations", all([ 1+1 == 2, 1+2 == 1249 ]);
array | $ps | Array of callables. |
package |
TriTan CMS |
---|
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
array_to_object(array $array)
Takes an array and turns it into an object.
array | $array | Array of data. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
array_unique_compact(mixed $a) : mixed
Strips out all duplicate values and compact the array.
mixed | $a | An array that be compacted. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
auto_increment(string $table = 'deprecated', integer $pk = 'deprecated') : integer
Auto increments the table's primary key.
string | $table | Table in the document. |
integer | $pk | Primary key field name. |
package |
TriTan CMS |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
beautify_filename(string $filename) : string
Beautifies a filename for use.
string | $filename | Filename to beautify. |
Beautified filename.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
blacklisted_usernames() : array
An extensive list of blacklisted usernames.
Uses blacklisted_usernames
filter.
Array of blacklisted usernames.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
check_mime_type(string $file, integer $mode) : boolean
Checks the mime type of a file.
string | $file | File to check. |
integer | $mode | Perform a full check or extension check only. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
checked(mixed $checked, mixed $current = true, boolean $echo = true) : string
Outputs the html checked attribute.
Compares the first two arguments and if identical marks as checked
mixed | $checked | One of the values to compare |
mixed | $current | (true) The other value to compare if not just true |
boolean | $echo | Whether to echo or just return the string |
html attribute or empty string
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
checked_selected_helper(\any $helper, \any $current, boolean $echo, string $type) : string
Private helper function for checked, selected, and disabled.
Compares the first two arguments and if identical marks as $type
\any | $helper | One of the values to compare |
\any | $current | (true) The other value to compare if not just true |
boolean | $echo | Whether to echo or just return the string |
string | $type | The type of checked|selected|disabled we are doing |
html attribute or empty string
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
compare_releases(string $current, string $latest, string $operator = '>') : boolean
Compares release values.
string | $current | Current release value. |
string | $latest | Latest release value. |
string | $operator | Operand use to compare current and latest release values. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
concat_ws(string $separator, \type $string1, \type $string2) : \type
Concatenation with separator.
string | $separator | Delimeter to used between strings. |
\type | $string1 | Left string. |
\type | $string2 | Right string. |
package |
Default |
---|---|
since | 0.9 |
create_site_directories(integer $site_id, object $site, boolean $update) : boolean
Create the needed directories when a new site is created.
integer | $site_id | Site ID. |
object | $site | Site object. |
boolean | $update | Whether the site is being created or updated. |
Returns true on success and false otherwise.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
current_user_can(string $perm) : boolean
Checks the permission of the logged in user.
string | $perm | Permission to check for. |
Return true if permission matches or false otherwise.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9.8 |
current_user_has_role(string $role) : boolean
Checks the role of the logged in user.
string | $role | The role to check for. |
True if user has role, false otherwise.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9.9 |
deactivate_plugin(string $id) : mixed
Wrapper function for PluginsRepository::deactivate() and deactivates plugin based on $_GET['id'].
string | $id | ID of the plugin to be deactivated. |
Deactivates plugin if it exists and is active.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
delete_post_meta(integer $post_id, string $meta_key, mixed $meta_value = '') : boolean
Remove metadata matching criteria from a post.
You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching key, if needed.
integer | $post_id | Post ID. |
string | $meta_key | Metadata name. |
mixed | $meta_value | Optional. Metadata value. Must be serializable if non-scalar. Default empty. |
True on success, false on failure.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
delete_post_meta_by_mid(integer $mid) : boolean
Delete post meta data by meta ID.
integer | $mid |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
delete_site_directories(integer $site_id, object $old_site) : boolean
Deletes the site directory when the site is deleted.
integer | $site_id | Site ID. |
object | $old_site | Site object. |
Returns true on success and false otherwise.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
delete_site_tables(integer $site_id, object $old_site)
Deletes site tables when site is deleted.
integer | $site_id | Site ID. |
object | $old_site | Site object. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
delete_site_user_meta(integer $site_id, object $old_site)
Deletes user meta data when site/user is deleted.
integer | $site_id | Site ID. |
object | $old_site | Site object of site that was deleted. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
delete_user_meta(integer $user_id, string $meta_key, mixed $meta_value = '') : boolean
Remove metadata matching criteria from a user.
You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching key, if needed.
integer | $user_id | User ID |
string | $meta_key | Metadata name. |
mixed | $meta_value | Optional. Metadata value. |
True on success, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
delete_user_meta_by_mid(integer $mid) : boolean
Delete user meta data by meta ID.
integer | $mid |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
delete_user_option(integer $user_id, string $option_name, boolean $global = false) : boolean
Delete user option with global site capability.
User options are just like user metadata except that they have support for global site options. If the 'global' parameter is false, which it is by default it will prepend the TriTan CMS table prefix to the option name.
integer | $user_id | User ID |
string | $option_name | User option name. |
boolean | $global | Optional. Whether option name is global or site specific. Default false (site specific). |
True on success, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
directory_listing(string $dir, string $bool = "dirs")
Get an array that represents directory tree.
string | $dir | Directory path |
string | $bool | Include sub directories |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
disabled(mixed $disabled, mixed $current = true, boolean $echo = true) : string
Outputs the html disabled attribute.
Compares the first two arguments and if identical marks as disabled
mixed | $disabled | One of the values to compare |
mixed | $current | (true) The other value to compare if not just true |
boolean | $echo | Whether to echo or just return the string |
html attribute or empty string
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
do_parsecode(string $content) : string
Search content for parsecodes and filter parsecodes through their hooks.
If there are no parsecode tags defined, then the content will be returned without any filtering. This might cause issues when plugins are disabled but the parsecode will still show up in the post or content.
string | $content | Content to search for parsecodes |
Content with parsecodes filtered out.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
do_parsecode_tag(array $m = 'deprecated') : mixed
Regular Expression callable for do_parsecode() for calling parsecode hook.
array | $m | Regular expression match array |
False on failure.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
does_option_exist(string $option_key = 'deprecated') : boolean
Checks if a key exists in the option table.
string | $option_key | Key to check against. |
package |
TriTan CMS |
---|---|
file |
app/functions/db-function.php |
since | 0.9.4 |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
does_user_have_sites(integer $user_id) : boolean
Checks if the requested user is an admin of any sites or has any admin roles.
integer | $user_id | ID of user to check. |
Returns true if user has sites and false otherwise.
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
email_exists(string $email) : string|false
Checks whether the given email exists.
Uses email_exists
filter.
string | Email to check. |
The user's ID on success, and false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
esc_attr(string $string) : string
Escaping for HTML attributes.
string | $string |
Escaped HTML attribute.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
esc_attr__(string $string, \type $domain = 'tritan-cms') : string
Retrieve the translation of a string and escapes it for safe use in an attribute.
string | $string | String to translate. |
\type | $domain | Optional. Unique identifier for retrieving translated string. Default: 'tritan-cms'. |
Translated string.
package |
Default |
---|---|
since | 0.9.9 |
esc_html(string $string) : string
Escaping for HTML blocks.
string | $string |
Escaped HTML block.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
esc_html__(string $string, \type $domain = 'tritan-cms') : string
Retrieve the translation of a string and escapes it for safe use in HTML blocks.
string | $string | String to translate. |
\type | $domain | Optional. Unique identifier for retrieving translated string. Default: 'tritan-cms'. |
Translated string.
package |
Default |
---|---|
since | 0.9.9 |
esc_js(string $string) : string
Escaping for inline javascript.
Example usage:
$esc_js = json_encode("Joshua's \"code\"");
$attribute = esc_js("alert($esc_js);");
echo '<input type="button" value="push" onclick="'.$attribute.'" />';
string | $string |
Escaped inline javascript.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
esc_textarea(string $string) : string
Escaping for textarea.
string | $string |
Escaped string.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
esc_url(string $url, array $scheme = array('http', 'https'), boolean $encode = false) : string
Escaping for url.
string | $url | The url to be escaped. |
array | $scheme | Optional. An array of acceptable schemes. |
boolean | $encode | Whether url params should be encoded. |
The escaped $url after the esc_url
filter is applied.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
file_mod_time(string $file)
Returns the datetime of when the content of file was changed.
file app/functions/deprecated-function.php
string | $file | Absolute path to file. |
package |
TriTan CMS |
---|---|
since | 0.9 |
flatten_array(array $array) : array
Turns multi-dimensional array into a regular array.
array | $array | The array to convert. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9.9 |
foot_release() : string
Prints installed TriTan release in admin footer.
package |
TriTan CMS |
---|---|
since | 0.9 |
generate_php_encryption() : boolean
Generates the encryption table if it does not exist.
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
generate_timezone_list() : array
Prints a list of timezones which includes current time.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
get_age(string $birthdate = '0000-00-00') : mixed
Get age by birthdate.
string | $birthdate | User's birth date. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
get_all_post_types() : array
Function used to dynamically generate post screens based on post type.
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9 |
get_all_posts(string $post_type = null, integer $limit, null|integer $offset = null, $status = 'all') : array
Retrieve all published posts or all published posts by post type.
string | $post_type | Post type. |
integer | $limit | Number of posts to show. |
null|integer | $offset | The offset of the first row to be returned. |
$status |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
get_base_url() : string
Retrieves TriTan CMS site root url.
TriTan CMS root url.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
get_css_directory_uri() : string
Retrieve css directory uri.
TriTan CMS css url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_current_site_id() : integer
Retrieve the current site id.
Site ID.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
global |
int $site_id |
get_current_user_id() : integer
Get the current user's ID
The current user's ID, or 0 if no user is logged in.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
get_file_ext(string $filename) : string
Return the file extension of the given filename.
string | $filename |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
get_file_size(string $file, integer $digits = 2) : string|boolean
string | $file | Filepath |
integer | $digits | Digits to display |
Size (KB, MB, GB, TB) or boolean
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
get_footer_release() : \mixed.
Frontend portal footer powered by and release.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_functions_in_file(string $filename, boolean $sort = false)
Returns an array of function names in a file.
string | $filename | The path to the file. |
boolean | $sort | If true, sort results by function name. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
get_http_response_code(string $url) : integer
Retrieves a response code from the header of a given resource.
string | $url | URL of resource/website. |
HTTP response code.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_image_directory_uri() : string
Retrieve image directory uri.
TriTan CMS image url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.4 |
get_initials(integer $id, integer $initials = 2) : string
Shows selected user's initials instead of his/her's full name.
Uses get_initials
filter.
integer | $id | User ID |
integer | $initials | Number of initials to show. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_javascript_directory_uri() : string
Retrieve javascript directory uri.
TriTan CMS javascript url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_layouts_header( $layout_dir = '') : mixed
Returns the layout header information
$layout_dir |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
get_less_directory_uri() : string
Retrieve less directory uri.
TriTan CMS less url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_mu_plugin_url() : string
Returns full base url of MU Plugins.
MU Plugin base url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_multisite_users() : array
Retrieve a list of users based on site.
Users data.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
get_name(integer $id, \bool $reverse = false) : string
Returns the name of a particular user.
Uses get_name
filter.
integer | $id | User ID. |
\bool | $reverse |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_parsecode_regex() : string
Retrieve the parsecode regular expression for searching.
The regular expression combines the parsecode tags in the regular expression in a regex class.
The regular expression contains 6 different sub matches to help with parsing.
1 - An extra [ to allow for escaping parsecodes with double [[]] 2 - The parsecode name 3 - The parsecode argument list 4 - The self closing / 5 - The content of a parsecode when it wraps some content. 6 - An extra ] to allow for escaping parsecodes with double [[]]
The parsecode search regular expression
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
package |
TriTan CMS |
---|
get_perm_roles() : mixed
Retrieves a list of roles from the roles table.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_permalink(integer|\TriTan\Common\Post\Post $post) : string
A function which retrieves a TriTan CMS post's permalink.
Purpose of this function is for the {$posttype}_link
filter.
integer|\TriTan\Common\Post\Post | $post | Post id or Post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_plugin_data(string $plugin_file, boolean $markup = true, boolean $translate = true) : array
Parses the plugin contents to retrieve plugin's metadata.
The metadata of the plugin's data searches for the following in the plugin's header. All plugin data must be on its own line. For plugin description, it must not have any newlines or only parts of the description will be displayed and the same goes for the plugin data. The below is formatted for printing.
/* Plugin Name: Name of Plugin Plugin URI: Link to plugin information Description: Plugin Description Author: Plugin author's name Author URI: Link to the author's web site Version: Plugin version value. Text Domain: Optional. Unique identifier, should be same as the one used in load_plugin_textdomain()
The first 8kB of the file will be pulled in and if the plugin data is not within that first 8kB, then the plugin author should correct their plugin and move the plugin data headers to the top.
The plugin file is assumed to have permissions to allow for scripts to read the file. This is not checked however and the file is only opened for reading.
string | $plugin_file | Path to the plugin file |
boolean | $markup | Optional. If the returned data should have HTML markup applied. Default true. |
boolean | $translate | Optional. If the returned data should be translated. Default true. |
{ Plugin data. Values will be empty if not supplied by the plugin.
@type string $Name Name of the plugin. Should be unique.
@type string $Title Title of the plugin and link to the plugin's site (if set).
@type string $Description Plugin description.
@type string $Author Author's name.
@type string $AuthorURI Author's website address (if set).
@type string $Version Plugin version.
@type string $TextDomain Plugin textdomain.
@type string $DomainPath Plugins relative directory path to .mo files.
@type bool $Network Whether the plugin can only be activated network-wide.
}
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
get_plugin_url() : string
Returns full base url of Plugins.
Plugin base url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_post(integer|\TriTan\Common\Post\Post|null $post, boolean $object = true) : array|object
Retrieves post data given a post ID or post array.
integer|\TriTan\Common\Post\Post|null | $post | Post ID or post object. |
boolean | $object | If set to true, data will return as an object, else as an array. Default: true. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_author(integer $post_id, boolean $reverse = false) : string
A function which retrieves a TriTan CMS post author.
Purpose of this function is for the post_author
filter.
integer | $post_id | The unique id of a post. |
boolean | $reverse | If first name should appear first or not. Default is false. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_author_id(integer $post_id) : string
A function which retrieves a TriTan CMS post author id.
Purpose of this function is for the post_author_id
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_by(string $field, integer|string $value)
Retrieve post by a given field from the post table.
string | $field | The field to retrieve the post with. |
integer|string | $value | A value for $field (_id, post_id, post_slug). |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_content(integer $post_id) : string
A function which retrieves a TriTan CMS post content.
Purpose of this function is for the post_content
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_created_date(string $format = 'U', \bool $gmt = false, integer $post = null, \bool $translate = false) : string
Retrieves TriTan CMS post created date.
string | $format | |
\bool | $gmt | |
integer | $post | The unique id of a post. |
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_created_time(\string $format = 'U', \bool $gmt = false, $post = null, \bool $translate = false) : string
A function which retrieves TriTan CMS post created time.
Purpose of this function is for the post_created_time
filter.
\string | $format | |
\bool | $gmt | |
$post | ||
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_custom(integer $post_id) : array
Retrieve post meta fields, based on post ID.
The post meta fields are retrieved from the cache where possible, so the function is optimized to be called more than once.
integer | $post_id | The post's id. |
Post meta for the given post.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_custom_keys(integer $post_id) : array|void
Retrieve meta field names for a post.
If there are no meta fields, then nothing (null) will be returned.
integer | $post_id | The post's id. |
Array of the keys, if retrieved.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_custom_values(string $key = '', integer $post_id) : array|null
Retrieve values for a custom post field.
The parameters must not be considered optional. All of the post meta fields will be retrieved and only the meta field key values returned.
string | $key | Optional. Meta field key. Default empty. |
integer | $post_id | The post's id. |
Meta field values.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_date(integer $post_id, string $type = 'published') : string
A function which retrieves TriTan CMS post date.
Uses call_user_func_array()
function to return appropriate post date function.
Dynamic part is the variable $type, which calls the date function you need.
integer | $post_id | The unique id of a post. |
string | $type | Type of date to return: created, published, modified. Default: published. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_datetime(integer $post_id) : string
A function which retrieves TriTan CMS post datetime.
Purpose of this function is for the post_datetime
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_dropdown_list(string $slug = null, integer $post_id) : array
Retrieves all posts
string | $slug | Post slug. |
integer | $post_id | Post id. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_id(string $post_slug = null) : integer
A function which retrieves a TriTan CMS post id.
string | $post_slug | The unique slug of a post. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
get_post_meta(integer $post_id, string $key = '', boolean $single = false) : mixed
Retrieve post meta field for a post.
integer | $post_id | Post ID. |
string | $key | Optional. The meta key to retrieve. By default, returns data for all keys. Default empty. |
boolean | $single | Optional. Whether to return a single value. Default false. |
Will be an array if $single is false. Will be value of meta data field if $single is true.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_meta_by_mid(integer $mid) : array|boolean
Get post meta data by meta ID.
integer | $mid |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_modified(integer $post_id) : string
A function which retrieves TriTan CMS post modified datetime.
Purpose of this function is for the post_modified
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_modified_date(\string $format = 'U', \bool $gmt = false, $post = null, \bool $translate = false) : string
A function which retrieves TriTan CMS post modified date.
\string | $format | |
\bool | $gmt | |
$post | ||
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_modified_time(\string $format = 'U', \bool $gmt = false, $post = null, \bool $translate = false) : string
A function which retrieves TriTan CMS post modified time.
\string | $format | |
\bool | $gmt | |
$post | ||
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_parent(integer $post_id) : string
A function which retrieves TriTan CMS post parent.
Purpose of this function is for the post_parent
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_parent_id(integer $post_id) : string
A function which retrieves TriTan CMS post parent id.
Purpose of this function is for the post_parent_id
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_posttype(integer $post_id) : string
A function which retrieves TriTan CMS post posttype.
Purpose of this function is for the post_posttype
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_posttype_id(integer $post_id) : string
A function which retrieves TriTan CMS post posttype id.
Purpose of this function is for the post_posttype_id
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_posttype_link(\into $post_id) : string
A function which retrieves a TriTan CMS post posttype link.
Purpose of this function is for the post_posttype_link
filter.
\into | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_posttype_slug(integer $post_id) : string
A function which retrieves a TriTan CMS post posttype slug.
Purpose of this function is for the post_posttype_slug
filter.
integer | $post_id | The unique id of a post. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
get_post_published_date(\string $format = 'U', \bool $gmt = false, $post = null, \bool $translate = false) : string
A function which retrieves TriTan CMS post published date.
\string | $format | |
\bool | $gmt | |
$post | ||
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_published_time(\string $format = 'U', \bool $gmt = false, $post = null, \bool $translate = false) : string
A function which retrieves TriTan CMS post published time.
\string | $format | |
\bool | $gmt | |
$post | ||
\bool | $translate |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_show_in_menu(integer $post_id) : string
A function which retrieves TriTan CMS post show in menu.
Purpose of this function is for the post_show_in_menu
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_show_in_search(integer $post_id) : string
A function which retrieves TriTan CMS post show in search.
Purpose of this function is for the post_show_in_search
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_sidebar(integer $post_id) : string
A function which retrieves TriTan CMS post sidebar.
Purpose of this function is for the post_sidebar
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_slug(integer $post_id) : string
A function which retrieves a TriTan CMS post slug.
Purpose of this function is for the post_slug
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_status(integer $post_id) : string
A function which retrieves a TriTan CMS post status.
Purpose of this function is for the post_status
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
get_post_time(integer $post_id, string $type = 'published') : string
A function which retrieves TriTan CMS post time.
Uses call_user_func_array()
function to return appropriate post time function.
Dynamic part is the variable $type, which calls the date function you need.
integer | $post_id | The unique id of a post. |
string | $type | Type of date to return: created, published, modified. Default: published. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_title(integer $post_id) : string
A function which retrieves a TriTan CMS post title.
Purpose of this function is for the post_title
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_post_type_name(integer $post_id) : string
A function which retrieves a TriTan CMS post posttype name.
Purpose of this function is for the post_posttype_name
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
get_posttype(integer|\TriTan\Common\Posttype\Posttype $posttype, boolean $object = true) : array|object
Retrieves post type data given a post type ID or post type array.
integer|\TriTan\Common\Posttype\Posttype | $posttype | Posttype ID or postttype object. |
boolean | $object | If set to true, data will return as an object, else as an array. Default: true. |
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9 |
get_posttype_by(string $field, integer|string $value)
Retrieve post type by a given field from the post type table.
string | $field | The field to retrieve the post type with. |
integer|string | $value | A value for $field (_id, post_id, posttype_slug). |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
get_posttype_description(integer $posttype_id) : string
A function which retrieves a TriTan CMS posttype description.
Purpose of this function is for the posttype_description
filter.
integer | $posttype_id | The unique id of a posttype. |
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
get_posttype_permalink(integer $posttype_id) : string
A function which retrieves a TriTan CMS posttype's permalink.
Purpose of this function is for the posttype_permalink
filter.
integer | $posttype_id | Posttype id. |
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
get_posttype_slug(integer $posttype_id) : string
A function which retrieves a TriTan CMS posttype slug.
Purpose of this function is for the posttype_slug
filter.
integer | $posttype_id | The unique id of a posttype. |
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
get_posttype_title(integer $posttype_id) : string
A function which retrieves a TriTan CMS post type title.
Purpose of this function is for the posttype_title
filter.
integer | $posttype_id | The unique id of a posttype. |
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
get_private_site_upload_url( $path = '') : string
Returns full base url of a site's private upload url.
$path |
Site's private upload base url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_private_site_url( $path = '') : string
Returns full base url of a site's private url.
$path |
Site's private base url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_relative_url(integer|\TriTan\Common\Post\Post $post) : string
A function which retrieves a TriTan CMS post's relative url.
Purpose of this function is for the {$posttype}_relative_url
filter.
integer|\TriTan\Common\Post\Post | $post | Post id or Post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.5 |
get_role_by_id(integer $role) : array
Returns the values of a requested role.
integer | $role | The id of the role to check for. |
Returned values of the role.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
get_secure_cookie_data(string $key) : mixed
Retrieves data from a secure cookie.
string | $key | COOKIE key. |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
get_site(integer|\TriTan\Common\Site\Site|null $site, boolean $object = true) : array|object
Retrieves site data given a site ID or post array.
integer|\TriTan\Common\Site\Site|null | $site | Site ID or object. |
boolean | $object | If set to true, data will return as an object, else as an array. Default: true. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
get_site_details(integer|string|array $fields = null, boolean $get_all = true) : boolean|\TriTan\Error|\TriTan\Site
Retrieve the details of a site from the site document and site options.
integer|string|array | $fields | A site's id or an array of site data. |
boolean | $get_all | Whether to retrieve all data or only data from site document. |
Site details on success or false.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_domain(integer $site_id) : string
A function which retrieves TriTan CMS site domain.
Purpose of this function is for the site_domain
filter.
integer | $site_id | The unique id of a site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_name(integer $site_id) : string
A function which retrieves TriTan CMS site name.
Purpose of this function is for the site_name
filter.
integer | $site_id | The unique id of a site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_owner(integer $site_id) : string
A function which retrieves TriTan CMS site owner.
Purpose of this function is for the site_owner
filter.
integer | $site_id | The unique id of a site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_path(integer $site_id) : string
A function which retrieves TriTan CMS site path.
Purpose of this function is for the site_path
filter.
integer | $site_id | The unique id of a site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_status(integer $site_id) : string
A function which retrieves TriTan CMS site status.
Purpose of this function is for the site_status
filter.
integer | $site_id | The unique id of a site. |
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
get_site_themes(string $active = null) : array
Get a list of themes available for a specific site.
string | $active | The name to check against. |
Theme options to choose from.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_theme_directory_uri() : string
Retrieve theme directory URI.
TriTan CMS theme directory uri.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_theme_url() : string
Returns full base url of a site's theme.
Site's theme base url.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_user_avatar(string $email, integer $s = 80, string $class = '') : string
Retrieve the avatar `<img>` tag for user.
string | User's email address. |
|
integer | $s | Height and width of the avatar image file in pixels. Default 80. |
string | $class | Class to add to |
<img>
tag for user's avatar or default otherwise.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_user_avatar_url(string $email) : string
Retrieves the avatar url.
string | Email address of user. |
The url of the avatar that was found, or default if not found.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
get_user_by(string $field, integer|string $value)
Retrieve user info by a given field from the user's table.
string | $field | The field to retrieve the user with. |
integer|string | $value | A value for $field (id, uname or email). |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
get_user_meta(integer $user_id, string $key = '', boolean $single = false) : mixed
Retrieve user meta field for a user.
integer | $user_id | User ID. |
string | $key | Optional. The meta key to retrieve. By default, returns data for all keys. |
boolean | $single | Whether to return a single value. |
Will be an array if $single is false. Will be value of meta data field if $single is true.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_user_meta_by_mid(integer $mid) : array|boolean
Get user meta data by meta ID.
integer | $mid |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_user_option(string $option, integer $user) : mixed
Retrieve user option that can be either per Site or global.
If the user ID is not given, then the current user will be used instead. If the user ID is given, then the user data will be retrieved. The filter for the result, will also pass the original option name and finally the user data object as the third parameter.
The option will first check for the per site name and then the global name.
Uses get_user_option_$option
filter.
string | $option | User option name. |
integer | $user | Optional. User ID. |
User option value on success, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_user_roles(integer $active = null)
Retrieve a list of available user roles.
integer | $active |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_user_value(string $id, string $field) : mixed
Retrieve requested field from usermeta document based on user's id.
string | $id | User ID. |
string | $field | Data requested of particular user. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_userdata(mixed $user_id) : \User|false
Retrieve user info by user_id.
mixed | $user_id | User's id. |
User array on success, false on failure.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
get_users_by_siteid(integer $site_id) : object
Retrieves a list of users by site_id
integer | $site_id | Site id. Default: 0. |
User object.
package |
Default |
---|---|
since | 0.9.9 |
get_users_dropdown(integer $active = null) : array
Print a dropdown list of users.
integer | $active | If working with active record, it will be the user's id. |
Dropdown list of users.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_users_list(\type $active = null)
Retrieve a list of all users.
\type | $active |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_users_reassign(integer $user_id) : array
Print a dropdown list of users.
integer | $user_id | If working with active record, it will be the user's id. |
Dropdown list of users.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
get_users_sites(integer $user_id) : array
Get an array of sites by user.
integer | $user_id | The user's id. |
package |
Default |
---|---|
since | 0.9.9 |
has_posts() : integer|null
This function checks to see if the current TriTan CMS query has any results to loop over.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
hash_equals(string $known_string, string $user_string) : boolean
Timing attack safe string comparison
Compares two strings using the same time whether they're equal or not. This function should be used to mitigate timing attacks; for instance, when testing crypt() password hashes.
string | $known_string | The string of known length to compare against |
string | $user_string | The user-supplied string |
Returns TRUE when the two strings are equal, FALSE otherwise.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
hasPermission(string $perm) : boolean
Checks the permission of the logged in user.
string | $perm | Permission to check for. |
Return true if permission matches or false otherwise.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
head_release_meta() : string
Prints generator meta tag in admin head.
package |
TriTan CMS |
---|---|
since | 0.9 |
home_url(string $path = '', string|null $scheme = null) : string
Returns the url for a given site where the front end is accessible.
The protocol will be 'https' if is_ssl()
evaluates to true; If $scheme
is
'http' or 'https', is_ssl()
is overridden.
string | $path | Optional. Path relative to the home url. Default empty. |
string|null | $scheme | Optional. Scheme to give the home URL context. Accepts 'http', 'https', 'relative', or null. Default null. |
Home url link with optional path appended.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
html_purify(string $string, boolean $is_image = false) : string
Makes content safe to print on screen.
This function should only be used on output. With the exception of uploading images, never use this function on input. All inputted data should be accepted and then purified on output for optimal results. For output of images, make sure to escape with esc_url().
string | $string | Text to purify. |
boolean | $is_image |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9.9 |
is_admin() : boolean
Whether the current request is for an administrative interface.
True if an admin screen, otherwise false.
package |
Default |
---|---|
file |
app/functions.php e.g. |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
is_duplicate_function(string $filename)
Checks a given file for any duplicated named user functions.
string | $filename |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
is_login() : boolean
Whether the current request is for a login interface.
True if login screen, otherwise false.
package |
Default |
---|---|
file |
app/functions.php e.g. |
since | 0.9.9 |
is_plugin_activated(string $plugin) : boolean
Wrapper function for PluginsRepository::isActivated() and checks if a particular plugin is activated
string | $plugin | Name of plugin file. |
False if plugin is not activated and true if it is activated.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
is_post_parent(integer $post_id) : boolean|array
Checks if a post has any children.
integer | $post_id | Post id to check. |
False if not, array of children if true.
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
is_post_posttype_exist(integer $posttype_id) : boolean
Checks if a given posttype exists on posts.
integer | $posttype_id | Posttype id to check for. |
True if exists, false otherwise;
package |
Default |
---|---|
since | 0.9.9 |
is_ssl() : boolean
Determines if SSL is used.
Checks if base_url
filter hook is present.
True if SSL, otherwise false.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
is_ttcms_error(mixed $object) : boolean
Check whether variable is an TriTan CMS Error.
Returns true if $object is an object of the \TriTan\Error
class.
mixed | $object | Check if unknown variable is an |
True, if \TriTan\Error
. False, if not \TriTan\Error
.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
is_ttcms_exception(mixed $object) : boolean
Check whether variable is an TriTan CMS Exception.
Returns true if $object is an object of the \TriTan\Exception\BaseException
class.
mixed | $object | Check if unknown variable is an |
True, if \TriTan\Exception\BaseException
. False, if not \TriTan\Exception\BaseException
.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
is_user_logged_in() : boolean
Checks if a visitor is logged in or not.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
it(string $m, mixed $p)
Example usage:
it("should sum two numbers", 1+1==2); it("should display an red X for a failing test", 1+1==3);
string | $m | Message. |
mixed | $p | Callable. |
package |
TriTan CMS |
---|
load_activated_plugins(string $plugins_dir = '') : mixed
Wrapper function for PluginsRepository::load() and loads all activated plugins for inclusion.
string | $plugins_dir | Loads plugins from specified folder |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
load_core_locale() : string
Loads the current or default locale.
The locale.
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
load_default_textdomain(string $domain, string $path) : boolean
Load default translated strings based on locale.
string | $domain | Text domain. Unique identifier for retrieving translated strings. |
string | $path | Path to the .mo file. |
True on success, false on failure.
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
load_plugin_textdomain(string $domain, string $plugin_rel_path = false) : boolean
Load a plugin's translated strings.
If the path is not given then it will be the root of the plugin directory.
string | $domain | Unique identifier for retrieving translated strings |
string | $plugin_rel_path | Optional. Relative path to TTCMS_PLUGIN_DIR where the locale directory resides. Default false. |
True when textdomain is successfully loaded, false otherwise.
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
load_textdomain(string $domain, string $path) : boolean
Load a .mo file into the text domain.
string | $domain | Text domain. Unique identifier for retrieving translated strings. |
string | $path | Path to the .mo file. |
True on success, false on failure.
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
login_url(string $redirect = '', string $path = '', string|null $scheme = 'login') : string
Returns the login url for a given site.
string | $redirect | Path to redirect to on log in. |
string | $path | Optional. Path relative to the login url. Default empty. |
string|null | $scheme | Optional. Scheme to give the home URL context. Accepts 'http', 'https', 'relative', or null. Default 'login'. |
Returns the login url.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9 |
make_clickable(string $value, array $protocols = array('http', 'mail'), array $attributes = array()) : string
Turn all URLs into clickable links.
string | $value | |
array | $protocols | http/https, ftp, mail, twitter |
array | $attributes |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
new_site_data(integer $site_id, object $site, boolean $update) : integer|boolean
Populates site options and user meta for site admin after new site is created.
integer | $site_id | Site id of the newly created site. |
object | $site | Site object of newly created site. |
boolean | $update | Whether the site is being created or updated. |
Returns the site id if successful and false otherwise.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
number_posts_per_type(string $slug) : integer
Returns the number of posts within a given post type.
string | $slug | Post type slug. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
parsecode_atts(array $pairs, array $atts) : array
Combine user attributes with known attributes and fill in defaults when needed.
The pairs should be considered to be all of the attributes which are supported by the caller and given as a list. The returned attributes will only contain the attributes in the $pairs list.
If the $atts list has unsupported attributes, then they will be ignored and removed from the final returned list.
array | $pairs | Entire list of supported attributes and their defaults. |
array | $atts | User defined attributes in parsecode tag. |
Combined and filtered attribute list.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
parsecode_parse_atts(string $text) : array
Retrieve all attributes from the parsecodes tag.
The attributes list has the attribute name as the key and the value of the attribute as the value in the key/value pair. This allows for easier retrieval of the attributes, since all attributes have to be known.
string | $text |
List of attributes and their value.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
global |
type $parsecode_tags |
package |
TriTan CMS |
---|
php_like(string $pattern, string $subject) : boolean
SQL Like operator in PHP.
Returns true
if match else false
.
Example Usage:
php_like('%uc%','Lucy'); //true
php_like('%cy', 'Lucy'); //true
php_like('lu%', 'Lucy'); //true
php_like('%lu', 'Lucy'); //false
php_like('cy%', 'Lucy'); //false
string | $pattern | |
string | $subject |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
plugin_basename(string $filename)
Wrapper function for PluginFile::basename() method and extracts the file name of a specific plugin.
string | $filename | Plugin's file name. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
plugin_dir_path(string $filename) : string
Wrapper function for PluginFile::path() method.
Get the filesystem directory path (with trailing slash) for the plugin FILE passed in.
string | $filename | The filename of the plugin (FILE). |
The filesystem path of the directory that contains the plugin.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
plugin_dir_url(string $file) : string
Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.
string | $file | The filename of the plugin (FILE). |
the URL path of the directory that contains the plugin.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
plugins_url(string $path = '', string $plugin = '') : string
Retrieves a URL within the plugins or mu-plugins directory.
Defaults to the plugins directory URL if no arguments are supplied.
string | $path | Optional. Extra path appended to the end of the URL, including the relative directory if $plugin is supplied. Default empty. |
string | $plugin | Optional. A full path to a file inside a plugin or mu-plugin.
The URL will be relative to its directory. Default empty.
Typically this is done by passing |
Plugins URL link with optional paths appended.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
package |
Default |
---|---|
since | 0.9.9 |
package |
Default |
---|---|
since | 0.9.9 |
process_email_html(string $text, string $title) : string
Process the HTML version of the text.
Uses email_template_body
filter hook.
string | $text | |
string | $title |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
reassign_posts(integer $user_id, integer $assign_id)
Reassigns posts to a different user.
integer | $user_id | ID of user being removed. |
integer | $assign_id | ID of user to whom posts will be assigned. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
reassign_sites(integer $user_id, array $params = array())
Reassigns sites to a different user.
integer | $user_id | ID of user being removed. |
array | $params | User parameters (assign_id and role). |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
recently_published_widget() : \5
Recently published widget.
recently published posts.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9.8 |
register_activation_hook(string $filename, string $function)
Wrapper function for PluginRegisterActivationHook::activation() method.
When a plugin is activated, the action activate_pluginname
hook is called.
pluginname
is replaced by the actually file name of the plugin being activated.
So if the plugin is located at 'plugin/sample/sample.plugin.php', then the hook will
call 'activate_sample.plugin.php'.
string | $filename | Plugin's filename. |
string | $function | The function that should be triggered by the hook. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
register_deactivation_hook(string $filename, string $function)
Wrapper function for PluginRegisterActivationHook::deactivation() method.
When a plugin is deactivated, the action deactivate_pluginname
hook is called.
pluginname
is replaced by the actually file name of the plugin being deactivated.
So if the plugin is located at 'plugin/sample/sample.plugin.php', then the hook will
call 'deactivate_sample.plugin.php'.
string | $filename | Plugin's filename. |
string | $function | The function that should be triggered by the hook. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
remove_all_parsecodes()
Clear all parsecodes.
This function is simple, it clears all of the parsecode tags by replacing the parsecodes global by a empty array. This is actually a very efficient method for removing all parsecodes.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
remove_parsecode(string $tag)
Removes hook for parsecode.
string | $tag | parsecode tag to remove hook for. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
remove_trailing_slash(string $string) : string
Removes trailing forward slashes and backslashes if they exist.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string | $string | What to remove the trailing slashes from. |
String without the trailing slashes.
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
reset_password(integer $user_id) : integer|\TriTan\Exception\Exception
Resets a user's password.
integer | $user_id | ID of user who's password is to be reset. Default: 0. |
User id on success or Exception on failure.
package |
Default |
---|---|
since | 0.9.9 |
role_perm(integer $id)
Used on the Role screen for permissions.
integer | $id | Role id. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
safe_truncate(string $string, integer $length, string $append = '...') : string
Truncate a string to a specified length without cutting a word off
string | $string | The string to truncate |
integer | $length | The length to truncate the string to |
string | $append | Text to append to the string IF it gets truncated, defaults to '...' |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
sanitize_filename(string $filename, boolean $beautify = true) : string
Sanitizes a filename.
string | $filename | Name of file to sanitize. |
boolean | $beautify | Whether or not to beautify the sanitized filename. |
Sanitized filename for use.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
sanitize_url(string $url, boolean $encode = false) : string
Sanitizes a url to be used safely.
Example usage:
$url = "http://www.example.com/?message=test&<script>alert('XSS');</script>";
sanitize_url($url); //returns 'http://www.example.com/?message=test&38;';
string | $url | The url to be sanitized. |
boolean | $encode | Whether url params should be encoded. |
The sanitized $url after the sanitize_url
filter is applied.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9.8 |
selected(mixed $selected, mixed $current = true, boolean $echo = true) : string
Outputs the html selected attribute.
Compares the first two arguments and if identical marks as selected
mixed | $selected | One of the values to compare |
mixed | $current | (true) The other value to compare if not just true |
boolean | $echo | Whether to echo or just return the string |
html attribute or empty string
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
send_email_change_email(array $user, array $userdata) : boolean|\PHPMailer\PHPMailer\Exception
Email sent to user with changed/updated email.
array | $user | Original user array. |
array | $userdata | Updated user array. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
send_new_user_email(integer $user_id, string $pass) : boolean|\PHPMailer\PHPMailer\Exception
Email sent to new user when account is created.
integer | $user_id | User id. |
string | $pass | Plaintext password. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9.9 |
send_password_change_email(integer $user, string $password, array $userdata) : boolean|\PHPMailer\PHPMailer\Exception
Email sent to user with changed/updated password.
integer | $user | User array. |
string | $password | Plaintext password. |
array | $userdata | Updated user array. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
send_reset_password_email(integer $user, string $password) : boolean|\PHPMailer\PHPMailer\Exception
Email sent to user with new generated password.
integer | $user | User array. |
string | $password | Plaintext password. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
set_email_template(string $body) : string
Add the template to the message body.
Looks for {content} into the template and replaces it with the message.
Uses email_template
filter hook.
string | $body | The message to templatize. |
$email The email surrounded by template.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
set_url_scheme(string $url, string|null $scheme = null) : string
Sets the scheme for a URL.
string | $url | Absolute URL that includes a scheme |
string|null | $scheme | Optional. Scheme to give $url. Currently 'http', 'https', 'login', 'admin', 'relative', 'rest' or null. Default null. |
$url URL with chosen scheme.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.4 |
site_domain_exists(string $sitedomain) : boolean
Checks whether the given site domain exists.
string | $sitedomain | Site domain to check against. |
If site domain exists, return true otherwise return false.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
site_exists(string $site_domain, string $site_path) : boolean
Checks whether the given site exists.
string | $site_domain | Site domain to check against. |
string | $site_path | Site path to check against. |
If site exists, return true otherwise return false.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
site_url(string $path = '', string $scheme = null) : string
Returns the url for a given site.
Returns 'https' if is_ssl()
evaluates to true and 'http' otherwise. If $scheme
is
'http' or 'https', is_ssl()
is overridden.
string | $path | Optional. Route relative to the site url. Default '/'. |
string | $scheme | Optional. Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'admin', or 'relative'. Default null. |
Site url link.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
strip_parsecodes(string $content) : string
Remove all parsecode tags from the given content.
string | $content | Content to remove parsecode tags. |
Content without parsecode tags.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
subdomain_as_directory() : string
Subdomain as directory function uses the subdomain of the install as a directory.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
t__(\type $msgid, \type $domain = '') : string
Displays the returned translated text.
\type | $msgid | The translated string. |
\type | $domain | Domain lookup for translated text. |
Translated text according to current locale.
package |
Default |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
template_vars_replacement(string $template) : string
Replace variables in the template.
Uses email_template_tags
filter hook.
string | $template | Template with variables. |
Template with variables replaced.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
the_content(integer $post_id) : string
The TriTan CMS post filter.
Uses the_content
filter.
integer | $post_id | The unique id of a post. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
the_created_date(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post created date.
string | $format | Format to use for retrieving the date the post was written. Accepts 'G', 'U', or php date format value specified in 'date_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
the_created_time(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post created time.
string | $format | Format to use for retrieving the time the post was written. Accepts 'G', 'U', or php date format value specified in 'time_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
the_modified_date(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post published date.
string | $format | Format to use for retrieving the date the post was published. Accepts 'G', 'U', or php date format value specified in 'date_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
the_modified_time(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post modified time.
string | $format | Format to use for retrieving the time the post was modified. Accepts 'G', 'U', or php date format value specified in 'time_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
the_permalink(integer|array $post)
Displays the permalink for the current post.
Uses the_permalink
filter.
integer|array | $post | Post ID or post array. |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
the_posts(string $post_type = null, integer $limit, null|integer $offset = null, string $status = 'all') : object
Wrapper function for get_all_posts.
string | $post_type | The post type. |
integer | $limit | Number of posts to show. |
null|integer | $offset | The offset of the first row to be returned. |
string | $status | Should it retrieve all statuses, published, draft, etc.? |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
the_published_date(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post published date.
string | $format | Format to use for retrieving the date the post was published. Accepts 'G', 'U', or php date format value specified in 'date_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
the_published_time(string $format = '', integer|\TriTan\Common\Post\Post $post = null) : string|integer|false
Retrieves TriTan CMS post published time.
string | $format | Format to use for retrieving the time the post was published. Accepts 'G', 'U', or php date format value specified in 'time_format' option. Default empty. |
integer|\TriTan\Common\Post\Post | $post | Post array or post id. |
Formatted date string or Unix timestamp if $format is 'U' or 'G'. False on failure.
package |
Default |
---|---|
since | 0.9.9 |
themes_url(string $path = '', string $theme = '') : string
Retrieves a URL within a site's theme directory.
Defaults to the site's theme directory URL if no arguments are supplied.
string | $path | Optional. Extra path appended to the end of the URL, including the relative directory if $theme is supplied. Default empty. |
string | $theme | Optional. A full path to a file inside a theme.
The URL will be relative to its directory. Default empty.
Typically this is done by passing |
Site's theme URL link with optional paths appended.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
throws(string $exp, \Closure $cb) : boolean
Example usage:
it("should pass when the expected exception is thrown", throws("InvalidArgumentException", function () { throw new InvalidArgumentException; }));
string | $exp | Exception to check for. |
\Closure | $cb |
package |
TriTan CMS |
---|
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
tinymce_link_list() : array
Returns a list of internal links for TinyMCE.
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9.8 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_admin_url(string $path = '', string $scheme = 'admin') : string
Returns the url to the admin area for a given site.
string | $path | Optional. Path relative to the admin url. Default empty. |
string | $scheme | Optional. The scheme to use. Accepts 'http' or 'https', to force those schemes. Default 'admin'. |
Admin url link with optional path appended.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
ttcms_authenticate(string $login, string $password, string $rememberme)
Logs a user in after the login information has checked out.
string | $login | User's username or email address. |
string | $password | User's password. |
string | $rememberme | Whether to remember the user. |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
ttcms_authenticate_user(string $login, string $password, string $rememberme)
Checks a user's login information.
string | $login | User's username or email address. |
string | $password | User's password. |
string | $rememberme | Whether to remember the user. |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
ttcms_autop(\unknown $pee, \number $br = 1) : string|mixed
\unknown | $pee | |
\number | $br |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_between(mixed $val, mixed $min, mixed $max) : boolean
Used to retrieve values within a range.
mixed | $val | |
mixed | $min | |
mixed | $max |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_clear_auth_cookie()
Removes all cookies associated with authentication.
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
ttcms_delete_post(integer $post_id) : boolean|\TriTan\Common\Post\Post
Deletes a post from the post document.
integer | $post_id | The id of the post to delete. |
Post on success, false otherwise.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
ttcms_delete_posttype(integer $posttype_id) : boolean
Deletes a posttype from the posttype document.
integer | $posttype_id | The id of the posttype to delete. |
package |
Default |
---|---|
since | 0.9.9 |
ttcms_delete_site(integer $site_id, boolean $exception = false) : boolean|\TriTan\Error
Deletes a site.
integer | $site_id | ID of site to delete. |
boolean | $exception | Whether to throw an exception. |
Returns true on delete or throw an Exception or Error if failed.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
ttcms_delete_site_user(integer $user_id, array $params = array(), boolean $exception = false) : boolean|\TriTan\Exception\Exception|\TriTan\Error
Delete site user.
integer | $user_id | The id of user to be deleted. |
array | $params | User parameters (assign_id and role). |
boolean | $exception | Whether or not to throw an exception. |
Returns true if successful or will throw and exception or error otherwise.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.9 |
ttcms_delete_user(integer $user_id, integer $assign_id = null) : boolean
Deletes a user from the usermeta document. To delete user entirely from the system, see `ttcms_delete_site_user`.
integer | $user_id | ID of user being deleted. |
integer | $assign_id | ID of user to whom posts will be assigned. Default: NULL. |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_dropdown_languages(string $active = '')
Retrieves a list of available locales.
string | $active |
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
ttcms_editor(string $selector = null)
Renders an editor.
string | $selector | HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_encode_email(string $string) : string
Searches for plain email addresses in given $string and encodes them (by default) with the help of ttcms_encode_email_str().
Regular expression is based on based on John Gruber's Markdown. http://daringfireball.net/projects/markdown/
string | $string | Text with email addresses to encode |
$string Given text with encoded email addresses
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.9 |
ttcms_encode_email_str(string $string) : string
Encodes each character of the given string as either a decimal or hexadecimal entity, in the hopes of foiling most email address harvesting bots.
Based on Michel Fortin's PHP Markdown: http://michelf.com/projects/php-markdown/ Which is based on John Gruber's original Markdown: http://daringfireball.net/projects/markdown/ Whose code is based on a filter by Matthew Wickline, posted to the BBEdit-Talk with some optimizations by Milian Wolff.
string | $string | Text with email addresses to encode |
$string Given text with encoded email addresses
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9.9 |
ttcms_enqueue_css(string $config, string|array $asset, boolean|string $minify = false, string|null $plugin_slug = null) : string
Enqueues stylesheets.
Uses default_css_pipeline
, plugin_css_pipeline
and theme_css_pipeline
filter hooks.
Example Usage:
ttcms_enqueue_css('default', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
ttcms_enqueue_css('plugin', ['fontawesome','select2-css'], false, plugin_basename( dirname(__FILE__) ))
ttcms_enqueue_css('theme', 'style.css')
string | $config | Set whether to use |
string|array | $asset | Relative path or URL to stylesheet(s) to enqueue. |
boolean|string | $minify | Enable css assets pipeline (concatenation and minification).
Use a string that evaluates to |
string|null | $plugin_slug | Plugin slug to set plugin's asset location |
Stylesheet asset(s).
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_enqueue_js(string $config, string|array $asset, boolean|string $minify = false, string|null $plugin_slug = null) : string
Enqueues javascript.
Uses default_js_pipeline
, plugin_js_pipeline
and theme_js_pipeline
filter hooks.
Example Usage:
ttcms_enqueue_js('default', 'jquery-ui')
ttcms_enqueue_js('plugin', 'select2-js', false, plugin_basename( dirname(__FILE__) ))
ttcms_enqueue_js('theme', 'config.js')
string | $config | Set whether to use |
string|array | $asset | Relative path or URL to javascripts(s) to enqueue. |
boolean|string | $minify | Enable js assets pipeline (concatenation and minification).
Use a string that evaluates to |
string|null | $plugin_slug | Plugin slug to set plugin's asset location. |
Javascript asset(s).
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_error_handler( $type, $string, $file, $line)
Default Error Handler
Sets the default error handler to handle PHP errors and exceptions.
$type | ||
$string | ||
$file | ||
$line |
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
ttcms_error_log(string|array $value)
Set Error Log for Debugging.
string|array | $value | The data to be catched. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
ttcms_file_exists(string $filename, boolean $throw = true) : boolean
Checks whether a file or directory exists.
string | $filename | Path to the file or directory. |
boolean | $throw | Determines whether to do a simple check or throw an exception. Default: true. |
If file does not exist.
true if the file or directory specified by $filename exists; false otherwise.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_generate_password(integer $length = 12, boolean $special_chars = true, boolean $extra_special_chars = false) : string
Generates a random password drawn from the defined set of characters.
Uses random_lib
library to create passwords with far less predictability.
integer | $length | Optional. The length of password to generate. Default 12. |
boolean | $special_chars | Optional. Whether to include standard special characters. Default true. |
boolean | $extra_special_chars | Optional. Whether to include other special characters. Default false. |
The system generated password.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9.7 |
ttcms_get_current_user() : object
Returns object of data for current user.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
ttcms_get_file_data(string $file, array $default_headers, string $context = '') : array
Retrieve metadata from a file.
Searches for metadata in the first 8kB of a file, such as a plugin or layout. Each piece of metadata must be on its own line. Fields can not span multiple lines, the value will get cut at the end of the first line.
If the file data is not within that first 8kB, then the author should correct their plugin file and move the data headers to the top.
string | $file | Path to the file. |
array | $default_headers | List of headers, in the format array('HeaderKey' => 'Header Name'). |
string | $context | Optional. If specified adds filter hook "extra_{$context}_headers". Default empty. |
Array of file headers in HeaderKey => Header Value
format.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_get_mu_plugins() : array
Load an array of must-use plugin files
Files to include
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
ttcms_get_site_dropins() : array
Load an array of dropin files per site.
Files to include
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
ttcms_get_theme_routers() : array
Load an array of theme routers per site.
Files to include
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_home_url(string $path = '', string|null $scheme = null) : string
Returns the url for a given site where the front end is accessible.
The protocol will be 'https' if is_ssl()
evaluates to true; If $scheme
is
'http' or 'https', is_ssl()
is overridden.
string | $path | Optional. Path relative to the home url. Default empty. |
string|null | $scheme | Optional. Scheme to give the home URL context. Accepts 'http', 'https', 'relative', or null. Default null. |
Home url link with optional path appended.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
ttcms_insert_post(array $postdata, boolean $exception = false) : integer|\TriTan\Exception\Exception|null
Insert or update a post.
All of the $postdata
array fields have filters associated with the values. The filters
have the prefix 'pre_' followed by the field name. An example using 'post_status' would have
the filter called, 'pre_post_status' that can be hooked into.
array | $postdata | An array of data that is used for insert or update.
|
boolean | $exception | Whether or not to throw an exception. |
The newly created post's post_id or throws an exception or returns null if the post could not be created or updated.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
ttcms_insert_posttype(array $posttypedata, $exception = false) : integer|\Exception|null
Insert or update a posttype.
All of the $posttypedata
array fields have filters associated with the values. The filters
have the prefix 'pre_' followed by the field name. An example using 'posttype_title' would have
the filter called, 'pre_posttype_title' that can be hooked into.
array | $posttypedata | An array of data that is used for insert or update.
|
$exception |
The newly created posttype's posttype_id, Exception or returns null if the posttype could not be created or updated.
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
ttcms_insert_site(array|\TriTan\Common\Site\Site $sitedata, boolean $exception = false) : integer|\TriTan\Exception\Exception|\TriTan\Error
Insert a site into the database.
Some of the $sitedata
array fields have filters associated with the values. Exceptions are
'site_owner', 'site_registered' and 'sitemodified' The filters have the prefix 'pre'
followed by the field name. An example using 'site_name' would have the filter called,
'pre_site_name' that can be hooked into.
array|\TriTan\Common\Site\Site | $sitedata | { An array or Site array of user data arguments.
} |
boolean | $exception | Whether to throw and exception or error. |
The newly created site's site_id or throws an Exception or Error if the site could not be created.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
ttcms_insert_user(array|object|\TriTan\Common\User\User $userdata) : integer|\TriTan\Exception\Exception
Insert a user into the database.
Most of the $userdata
array fields have filters associated with the values. Exceptions are
'user_id', 'user_url', 'user_admin_layout', 'user_admin_sidebar', 'user_admin_skin',
'user_registered' and 'usermodified'. The filters have the prefix 'pre' followed by
the field name. An example using 'user_bio' would have the filter called, 'pre_user_bio' that
can be hooked into.
array|object|\TriTan\Common\User\User | $userdata | { An array, object or User object of user data arguments.
} |
The newly created user's user_id or throws an exception if the user could not be created.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
ttcms_is_writable(string $path)
Alternative to PHP's native is_writable function due to a Window's bug.
string | $path | Path to check. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_list_sort(array $objects, \string/array $orderby = array(), string $order = 'ASC', boolean $preserve_keys = false) : array
Sort array of objects by field.
Example Usage:
ttcms_list_sort($post,'post_id','ASC', false);
array | $objects | Array of objects to sort. |
\string/array | $orderby | Name of field or array of fields to filter by. |
string | $order | (ASC|DESC) |
boolean | $preserve_keys | Whether to preserve keys. |
Returns a sorted array.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_load_file(string $file, boolean $once = true, boolean|\Closure $show_errors = true) : mixed
Special function for file includes.
string | $file | File which should be included/required. |
boolean | $once | File should be included/required once. Default true. |
boolean|\Closure | $show_errors | If true error will be processed, if Closure - only Closure will be called. Default true. |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
ttcms_logger_activity_log_purge()
Purges the activity log of old records.
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
ttcms_logger_activity_log_write( $action, $process, $record, $uname)
Write Activity Logs to Database.
$action | ||
$process | ||
$record | ||
$uname |
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
ttcms_login_url(string $redirect = '', string $path = '', string|null $scheme = 'login') : string
Returns the login url for a given site.
string | $redirect | Path to redirect to on log in. |
string | $path | Optional. Path relative to the login url. Default empty. |
string|null | $scheme | Optional. Scheme to give the home URL context. Accepts 'http', 'https', 'relative', or null. Default 'login'. |
Returns the login url.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9 |
ttcms_maintenance_mode(object $app) : boolean|\route
Returns the maintenance mode route.
object | $app | The application object. |
package |
TriTan CMS |
---|---|
since | 0.9.9 |
ttcms_monolog(string $name, string $message)
Custom error log function for better PHP logging.
string | $name | Log channel and log file prefix. |
string | $message | Message printed to log. |
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
ttcms_nodeq_login_details()
Login Details Email
Function used to send login details to new user.
package |
Default |
---|---|
file |
app/functions/nodeq-function.php |
since | 0.9 |
ttcms_normalize_path(string $path) : string
Normalize a filesystem path.
string | $path | Path to normalize. |
Normalized path.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_optimized_image_upload(string $image) : string
Returns an optimized image for use.
string | $image | Original image file. |
Optimized image file.
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_php_check_includes(string $filename)
Performs a check within a php script and returns any other files that might have been required or included.
string | $filename | PHP script to check. |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_php_check_syntax(string $filename, boolean $check_includes = true) : void|\TriTan\Exception\Exception
Performs a syntax and error check of a given PHP script.
string | $filename | PHP script/file to check. |
boolean | $check_includes | If set to true, will check if other files have been included. |
If file does not exist or is not readable.
If file contains duplicate function names.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_plugin_activate_message(string $plugin_name)
Plugin success message when plugin is activated successfully.
string | $plugin_name | The name of the plugin that was just activated. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_plugin_deactivate_message(string $plugin_name)
Plugin success message when plugin is deactivated successfully.
string | $plugin_name | The name of the plugin that was just deactivated. |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_pluralize(integer $quantity, string $singular, string $plural = null) : string
Pluralizes a word if quantity is not one.
Example Usage:
ttcms_pluralize(4, 'cat'); // cats
ttcms_pluralize(3, 'kitty'); // kitties
ttcms_pluralize(2, 'octopus', 'octopii'); // octopii
ttcms_pluralize(1, 'mouse', 'mice'); // mouse
integer | $quantity | Number of items. |
string | $singular | Singular form of word. |
string | $plural | Plural form of word; function will attempt to deduce plural form from singular if not provided. |
Pluralized word if quantity is not one, otherwise singular.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_post_slug_exist(integer|null $post_id, string $slug, string $post_type) : boolean
Checks if a slug exists among records from the post document.
integer|null | $post_id | Post id to check against or null. |
string | $slug | Slug to search for. |
string | $post_type | The post type to filter. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
ttcms_post_status_label(string $status) : string
Adds label to post's status.
string | $status |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
ttcms_posttype_slug_exist(integer $posttype_id, string $slug) : boolean
Checks if a slug exists among records from the posttype document.
integer | $posttype_id | Posttype id to check against. |
string | $slug | Slug to search for. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_remove_accents(string $string) : string
Converts all accent characters to ASCII characters.
If there are no accent characters, then the string given is just returned.
string | $string | Text that might have accent characters |
Filtered string with replaced "nice" characters.
package |
Default |
---|---|
file |
app/functions/domain-function.php |
since | 0.9 |
ttcms_sanitize_string(string $string, string $fallback_string = 'deprecated', string $context = 'save') : string
Sanitizes a string, or returns a fallback string.
Specifically, HTML and PHP tags are stripped. Further actions can be added via the plugin API. If $string is empty and $fallback_string is set, the latter will be used.
string | $string | The string to be sanitized. |
string | $fallback_string | Optional. A string to use if $string is empty. |
string | $context | Optional. The operation for which the string is sanitized |
The sanitized string.
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
ttcms_seconds_to_time(\numeric $seconds)
Converts seconds to time format.
\numeric | $seconds |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_set_auth_cookie(array $user, string $rememberme = '')
Sets auth cookie.
array | $user | User data array. |
string | $rememberme | Should user be remembered for a length of time? |
package |
Default |
---|---|
file |
app/functions/auth-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/logger-function.php |
since | 0.9 |
ttcms_site_slug_exist(integer|null $site_id, string $slug) : boolean
Checks if a slug exists among records from the site document.
integer|null | $site_id | Site id to check against or null. |
string | $slug | Slug to search for. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.9 |
ttcms_site_status_label(string $status) : string
Adds status label for site's table.
string | $status | Status to check for. |
Sites status.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
ttcms_site_url(string $path = '', string $scheme = null) : string
Returns the url for a given site.
Returns 'https' if is_ssl()
evaluates to true and 'http' otherwise. If $scheme
is
'http' or 'https', is_ssl(
) is overridden.
string | $path | Optional. Route relative to the site url. Default '/'. |
string | $scheme | Optional. Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'admin', or 'relative'. Default null. |
Site url link.
package |
Default |
---|---|
file |
app/functions/link-function.php |
since | 0.9.9 |
ttcms_slugify(string $title, string $table = null) : string
Creates unique slug based on title
string | $title | Text to be slugified. |
string | $table | Table the text is saved to (i.e. post, posttype) |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
ttcms_system_backup(\type $source, \type $destination) : mixed
Create a backup of TriTan CMS install.
\type | $source | Path/directory to zip. |
\type | $destination | Target for zipped file. |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_unique_post_slug(string $original_slug, string $original_title, integer|null $post_id, string $post_type) : string
Creates a unique post slug.
string | $original_slug | Original slug of post. |
string | $original_title | Original title of post. |
integer|null | $post_id | Unique post id or null. |
string | $post_type | Post type of post. |
Unique post slug.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.8 |
ttcms_unique_posttype_slug(string $original_slug, string $original_title, integer $posttype_id) : string
Creates a unique posttype slug.
string | $original_slug | Original slug of posttype. |
string | $original_title | Original title of posttype. |
integer | $posttype_id | Unique posttype id. |
Unique posttype slug.
package |
Default |
---|---|
since | 0.9.8 |
ttcms_unique_site_slug(string $original_slug, string $original_title, integer|null $site_id) : string
Creates a unique site slug.
string | $original_slug | Original slug of site. |
string | $original_title | Original title of site. |
integer|null | $site_id | Unique site id or null. |
Unique site slug.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9.8 |
ttcms_update_post(array|object $postdata, \bool $exception = false) : integer|\TriTan\Exception\Exception|null
Update a post in the post document.
See \ttcms_insert_post() For what fields can be set in $postdata.
array|object | $postdata | An array of post data or a post object. |
\bool | $exception |
The updated post's id or throw an Exception or return null if post could not be updated.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9.9 |
ttcms_update_posttype(array|object $posttypedata = array(), $exception = false) : integer|\Exception|null
Update a posttype in the post document.
See \ttcms_insert_posttype() For what fields can be set in $posttypedata.
array|object | $posttypedata | An array of posttype data or a posttype object. |
$exception |
The updated posttype's id, Exception or return null if posttype could not be updated.
package |
Default |
---|---|
file |
app/functions/posttype-function.php |
since | 0.9.9 |
ttcms_update_site(integer|object|\TriTan\Common\Site\Site $sitedata, \bool $exception = false) : integer|\TriTan\Exception\Exception|\TriTan\Error
Update a site in the database.
See ttcms_insert_site() For what fields can be set in $sitedata.
integer|object|\TriTan\Common\Site\Site | $sitedata | An array of site data or a site object or site id. |
\bool | $exception |
The updated site's id or throw an Exception or Error if the site could not be updated.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
ttcms_update_user(object|\TriTan\Common\User\User $userdata) : integer|\TriTan\Exception\Exception
Update a user in the database.
It is possible to update a user's password by specifying the 'user_pass' value in the $userdata parameter array.
See \ttcms_insert_user() For what fields can be set in $userdata.
object|\TriTan\Common\User\User | $userdata | An array of user data or a user object of type stdClass or User. |
The updated user's id or throw an Exception if the user could not be updated.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
ttcms_user_status_label(string $status) : string
Adds label to user's status.
string | $status |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
ttcms_validate_plugin(string $plugin_name)
Validates a plugin and checks to make sure there are no syntax and/or parsing errors.
Uses activate_plugin
, activate_$plugin_name
, and activated_plugin
actions hooks.
string | $plugin_name | Name of the plugin file (i.e. disqus.plugin.php). |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
ttcms_validation_check(mixed $data)
Checks data to make sure it is a valid request.
mixed | $data |
package |
Default |
---|---|
file |
app/functions/hook-function.php |
since | 0.9 |
unicoder(string $string) : mixed
Converts a string into unicode values.
string | $string |
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
update_main_site() : boolean
Update main site based Constants in config file.
package |
Default |
---|---|
file |
app/functions/site-function.php |
since | 0.9 |
update_meta_cache(string $meta_type, integer|array $array_ids) : array|false
Update the metadata cache for the specified arrays.
string | $meta_type | Type of array metadata is for (e.g., post or user) |
integer|array | $array_ids | Array or comma delimited list of array IDs to update cache for |
Metadata cache for the specified arrays, or false on failure.
package |
TriTan CMS |
---|---|
file |
app/functions/db-function.php |
since | 0.9 |
update_post_meta(integer $post_id, string $meta_key, mixed $meta_value, mixed $prev_value = '') : integer|boolean
Update post meta field based on post ID.
Use the $prev_value parameter to differentiate between meta fields with the same key and post ID.
If the meta field for the post does not exist, it will be added.
integer | $post_id | Post ID. |
string | $meta_key | Metadata key. |
mixed | $meta_value | Metadata value. Must be serializable if non-scalar. |
mixed | $prev_value | Optional. Previous value to check before removing. Default empty. |
Meta ID if the key didn't exist, true on successful update, false on failure.
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
update_post_meta_by_mid(integer $mid, string $meta_key, string $meta_value) : boolean
Update post meta data by meta ID.
integer | $mid | |
string | $meta_key | |
string | $meta_value |
package |
Default |
---|---|
file |
app/functions/post-function.php |
since | 0.9 |
update_post_relative_url_posttype(integer $id, string $old_slug, string $new_slug)
Update post's relative url if posttype slug has been updated.
integer | $id | Unique Posttype id. |
string | $old_slug | Old posttype slug. |
string | $new_slug | New posttype slug. |
package |
Default |
---|---|
file |
app/functions/db-function.php |
since | 0.9.6 |
update_user_meta(integer $user_id, string $meta_key, mixed $meta_value, mixed $prev_value = '') : integer|boolean
Update user meta field based on user ID.
Use the $prev_value parameter to differentiate between meta fields with the same key and user ID.
If the meta field for the user does not exist, it will be added.
integer | $user_id | User ID. |
string | $meta_key | Metadata key. |
mixed | $meta_value | Metadata value. |
mixed | $prev_value | Optional. Previous value to check before removing. |
Meta ID if the key didn't exist, true on successful update, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
update_user_meta_by_mid(integer $mid, string $meta_key, mixed $meta_value) : boolean
Update user meta data by meta ID.
integer | $mid | |
string | $meta_key | |
mixed | $meta_value |
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
update_user_option(integer $user_id, string $option_name, mixed $newvalue, boolean $global = false) : integer|boolean
Update user option with global site capability.
User options are just like user metadata except that they have support for global site options. If the 'global' parameter is false, which it is by default it will prepend the TriTan CMS table prefix to the option name.
Deletes the user option if $newvalue is empty.
integer | $user_id | User ID. |
string | $option_name | User option name. |
mixed | $newvalue | User option value. |
boolean | $global | Optional. Whether option name is global or site specific. Default false (site specific). |
User meta ID if the option didn't exist, true on successful update, false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
package |
Default |
---|---|
file |
app/functions.php |
since | 0.9 |
username_exists(string $username) : string|false
Checks whether the given username exists.
Uses username_exists
filter.
string | $username | Username to check. |
The user's ID on success, and false on failure.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
validate_email(string $email) : boolean
Validates an email address.
Uses validate_email
filter.
Example Usage:
if(validate_email('email@gmail.com')) {
//do something;
}
string | Email address to validate. |
True if valid, false otherwise.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
validate_url(string $url) : boolean
Validates a url.
Example Usage:
if(validate_url('https://google.com/')) {
//do something;
}
string | $url | Url to validate. |
True if valid, false otherwise.
package |
TriTan CMS |
---|---|
file |
app/functions/core-function.php |
since | 0.9 |
validate_username(string $username) : boolean
Checks whether the given username is valid.
Uses validate_username
filter.
Example Usage:
if(validate_username('batman')) {
//do something;
}
string | $username | Username to check. |
Whether given username is valid.
package |
Default |
---|---|
file |
app/functions/user-function.php |
since | 0.9 |
win_is_writable(string $path) : true
Single file writable atribute check.
Thanks to legolas558.users.sf.net
string | $path |
package |
TriTan CMS |
---|---|
file |
app/functions/deprecated-function.php |
since | 0.9 |
withMock(\Closure $cb) : boolean
Example usage:
it('should use SomeInterface to do Something', withMock(function () { $mock = Mockery::mock('SomeInterface'); $mock->shouldReceive('someMethod') ->with('someValue') ->once() ->andReturn(true);
$sut = new SystemToTest($mock);
$sut->test();
}));
\Closure | $cb |
package |
TriTan CMS |
---|