Method | Description | |
---|---|---|
_is_transient_locked ( string $slug ) | ||
_lock_transient ( string $slug, integer $lock_timeout ) | ||
_unlock_transient ( string $slug ) | ||
array_to_object ( array $array ) : stdClass | ||
array_truncate ( array $array, integer $len ) : array | ||
close_tags ( string $html ) : string | ||
error_log ( $error ) : void | ||
function_wrapper ( mixed $function_name, $defaults = [], $return_output_buffer = false ) : |
||
get_comment_form ( integer $post_id = null, array $args = [] ) : string | Gets the comment form for use on a single article page | |
get_current_url ( ) : string | ||
get_object_by_property ( array $array, string $key, mixed $value ) : array | null | ||
get_object_index_by_property ( array $array, string $key, mixed $value ) : boolean | integer | ||
get_wp_title ( string $separator = ' ', string $seplocation = 'left' ) : string | ||
is_array_assoc ( array $arr ) : boolean | ||
is_true ( mixed $value ) : boolean | ||
iseven ( integer $i ) : boolean | ||
isodd ( integer $i ) : boolean | ||
ob_function ( callback $function, array $args = [null] ) : string | Calls a function with an output buffer. This is useful if you have a function that outputs text that you want to capture and use within a twig template. | |
osort ( array &$array, string $prop ) : void | ||
paginate_links ( array $args = [] ) : array | ||
pluck ( array $array, string $key ) | Plucks the values of a certain key from an array of objects | |
start_timer ( ) : float | For measuring time, this will start a timer | |
stop_timer ( integer $start ) : string | For stopping time and getting the data | |
transient ( string $slug, callable $callback, integer $transient_time, integer $lock_timeout = 5, boolean $force = false ) : mixed | A utility for a one-stop shop for Transients | |
trim_words ( string $text, integer $num_words = 55, string | null | false $more = null, string $allowed_tags = 'p a span b i br blockquote' ) : string | ||
warn ( string $message ) : boolean |
Method | Description | |
---|---|---|
handle_transient_locking ( string $slug, callable $callback, integer $transient_time, integer $lock_timeout, boolean $force, boolean $enable_transients ) | Does the dirty work of locking the transient, running the callback and unlocking |
public static _is_transient_locked ( string $slug ) | ||
$slug | string |
public static _lock_transient ( string $slug, integer $lock_timeout ) | ||
$slug | string | |
$lock_timeout | integer |
public static _unlock_transient ( string $slug ) | ||
$slug | string |
public static array_to_object ( array $array ) : stdClass | ||
$array | array | |
return | stdClass |
public static close_tags ( string $html ) : string | ||
$html | string | |
return | string |
public static function_wrapper ( mixed $function_name, $defaults = [], $return_output_buffer = false ) : |
||
$function_name | mixed | or array( $class( string|object ), $function_name ) |
return |
protected static handle_transient_locking ( string $slug, callable $callback, integer $transient_time, integer $lock_timeout, boolean $force, boolean $enable_transients ) | ||
$slug | string | |
$callback | callable | |
$transient_time | integer | Expiration of transients in seconds |
$lock_timeout | integer | How long (in seconds) to lock the transient to prevent race conditions |
$force | boolean | Force callback to be executed when transient is locked |
$enable_transients | boolean | Force callback to be executed when transient is locked |
public static is_array_assoc ( array $arr ) : boolean | ||
$arr | array | |
return | boolean |
public static paginate_links ( array $args = [] ) : array | ||
$args | array | |
return | array |
public static start_timer ( ) : float | ||
return | float |
public static stop_timer ( integer $start ) : string | ||
$start | integer | |
return | string |
public static transient ( string $slug, callable $callback, integer $transient_time, integer $lock_timeout = 5, boolean $force = false ) : mixed | ||
$slug | string | Unique identifier for transient |
$callback | callable | Callback that generates the data that's to be cached |
$transient_time | integer | (optional) Expiration of transients in seconds |
$lock_timeout | integer | (optional) How long (in seconds) to lock the transient to prevent race conditions |
$force | boolean | (optional) Force callback to be executed when transient is locked |
return | mixed |
public static trim_words ( string $text, integer $num_words = 55, string | null | false $more = null, string $allowed_tags = 'p a span b i br blockquote' ) : string | ||
$text | string | |
$num_words | integer | |
$more | string | null | false | text to appear in "Read more...". Null to use default, false to hide |
$allowed_tags | string | |
return | string |