Helpers
Helpers class - contains utility functions.
Namespace: WebberZone\Snippetz\Util
Since: 2.0.0
Source: includes/util/class-helpers.php line 22
Methods
process_placeholders() static
Replace placeholders with their content.
Since: 1.4.0
Line: 32
static public function process_placeholders( $input ): string;
| Type | Name | Description |
|---|---|---|
string | $input | Content with placeholders to be replaced. |
Returns: string — Content with placeholders replaced.
get_first_post_year() static
Get the year of the first post.
Since: 1.4.0
Line: 77
static public function get_first_post_year( ): string|bool;
Returns: string|bool — Year fo the first post or false if error.
get_reading_time() static
Calculate the estimated reading time for a given piece of $content.
Since: 1.8.0
Line: 112
static public function get_reading_time( $content = ..., $args = ... ): string|void;
| Type | Name | Description |
|---|---|---|
string | $content | Content use to determine reading time. |
array | $args | { |
Returns: string|void — Estimated reading time if $args[‘echo’] set to false, void if true.
is_snippets_enabled() static
Is snippets enabled?
Line: 159
static public function is_snippets_enabled( ): boolean;
Returns: boolean — True if snippets are enabled. False if not.
sanitize_args() static
Sanitize args.
Since: 2.2.0
Line: 171
static public function sanitize_args( $args ): array;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
Returns: array — Sanitized array of arguments.