Constants

TABLE_CLASS

TABLE_CLASS ='posts-data-table'

TABLE_WRAPPER_CLASS

TABLE_WRAPPER_CLASS ='posts-table-wrapper'

Methods

array_pad_and_slice()

array_pad_and_slice(array  $array,integer  $size,mixed  $pad): array

Combination of array_pad and array_slice.

Parameters

array $array

Input array

integer $size

The size of the array to return

mixed $pad

What to pad with

Returns

array —

The result

array_diff_assoc()

array_diff_assoc(array  $array1,array  $array2): array

Similar to <code>array_diff_assoc</code>, but does a loose type comparison on array values (== not ===).

Supports multi-dimensional arrays, but doesn't support passing more than two arrays.

Parameters

array $array1

The main array to compare against

array $array2

The array to compare with

Returns

array —

All entries in $array1 which are not present in $array2 (including key check)

list_pluck_array()

list_pluck_array(array  $list,array|string  $keys = array()): array

Similar to <code>wp_list_pluck</code> or <code>array_column</code> but plucks several keys from the source array.

Parameters

array $list

The array of arrays to extract the keys from

array|string $keys

The list of keys to pluck

Returns

array —

An array returned in the same order as $list, but where each item in the array contains just the specified $keys

string_list_to_array()

string_list_to_array(  $arg)

Parameters

$arg

empty_if_false()

empty_if_false(  $var)

Parameters

$var

maybe_parse_bool()

maybe_parse_bool(  $maybe_bool)

Parameters

$maybe_bool

set_object_vars()

set_object_vars(  $object,array  $vars)

Parameters

$object
array $vars

sanitize_list_arg()

sanitize_list_arg(  $arg,  $allow_space = false)

Parameters

$arg
$allow_space

sanitize_list_arg_allow_space()

sanitize_list_arg_allow_space(  $arg)

Parameters

$arg

sanitize_numeric_list_arg()

sanitize_numeric_list_arg(  $arg)

Parameters

$arg

sanitize_string_or_bool_arg()

sanitize_string_or_bool_arg(  $arg)

Parameters

$arg

sanitize_class_name()

sanitize_class_name(  $class)

Parameters

$class

get_the_term_names()

get_the_term_names(  $post,  $taxonomy,  $sep = ', ')

Parameters

$post
$taxonomy
$sep

get_all_term_children()

get_all_term_children(  $term_ids,  $taxonomy,  $include_parents = false)

Parameters

$term_ids
$taxonomy
$include_parents

convert_to_term_ids()

convert_to_term_ids(  $terms,  $taxonomy)

Parameters

$terms
$taxonomy

get_acf_field_object()

get_acf_field_object(  $field,  $post_id = false)

Parameters

$field
$post_id

is_acf_active()

is_acf_active()

jquery_to_php_date_format()

jquery_to_php_date_format(string  $jquery_date_format): string

Convert a jQuery date format to a PHP one. E.g. 'dd-mm-yy' becomes 'd-m-Y'.

Parameters

string $jquery_date_format

The jQuery date format to convert.

Returns

string —

The equivalent PHP date format.

is_european_date_format()

is_european_date_format(  $format)

Parameters

$format

is_unix_epoch_time()

is_unix_epoch_time(mixed  $value): boolean

Is the value passed a valid UNIX epoch time (i.e. seconds elapsed since 1st January 1970)?

Not a perfect implementation as it will return false for valid timestamps representing dates between 31st October 1966 and 3rd March 1973, but this is needed to prevent valid dates held in numeric formats (e.g. 20171201) being wrongly interpreted as timestamps.

Parameters

mixed $value

The value to check

Returns

boolean —

True if $value is a valid epoch timestamp

strtotime()

strtotime(string  $date): integer|boolean

Convert a date string to a timestamp. A wrapper around strtotime which accounts for dates already formatted as a timestamp.

Parameters

string $date

The date to convert to a timestamp.

Returns

integer|boolean —

The timestamp (number of seconds since the Epoch) for this date, or false on failure.

is_valid_search_term()

is_valid_search_term(  $search_term)

Parameters

$search_term

get_image_size_width()

get_image_size_width(  $size)

Parameters

$size

doing_lazy_load()

doing_lazy_load()

format_post_link()

format_post_link(  $post,  $link_text = '',  $link_class = '')

Parameters

$post
$link_text
$link_class

get_asset_url()

get_asset_url(  $path = '')

Parameters

$path

get_wrapper_class()

get_wrapper_class()

get_table_class()

get_table_class()

include_template()

include_template(  $template_name)

Parameters

$template_name