format.php
Table of Contents
- mpa_ceil_to_step() : int
- Ceil the value to the nearest full step.
- mpa_maybe_intval() : string|int
- mpa_posint() : int
- mpa_prefix() : string
- mpa_unprefix() : string
- mpa_trim_price() : string
- Will trim '5.00' to '5', but leave '5.50' as is.
- mpa_evaluate_numbers() : array<string|int, mixed>
- mpa_strip_html_whitespaces() : string
- mpa_str_to_class_name() : string
- mpa_str_to_method_name() : string
- mpa_kses_link() : string
- mpa_limit() : int|float
- mpa_format_price() : string
Functions
mpa_ceil_to_step()
Ceil the value to the nearest full step.
mpa_ceil_to_step(int $value, int $step) : int
Parameters
- $value : int
- $step : int
Tags
mpa_maybe_intval()
mpa_maybe_intval(string $string) : string|int
Parameters
- $string : string
Tags
mpa_posint()
mpa_posint(int|string $value) : int
Parameters
- $value : int|string
Tags
mpa_prefix()
mpa_prefix(string $string[, string $prefix = 'public' ]) : string
Parameters
- $string : string
- $prefix : string = 'public'
-
Optional. 'public', 'private', 'metabox', 'widget', 'none' or custom prefix string. 'public' by default.
Tags
mpa_unprefix()
mpa_unprefix(string $string[, string $prefix = '' ]) : string
Parameters
- $string : string
- $prefix : string = ''
-
Optional. Custom prefix to remove.
Tags
mpa_trim_price()
Will trim '5.00' to '5', but leave '5.50' as is.
mpa_trim_price(string $price[, string $decimalSeparator = null ]) : string
Parameters
- $price : string
- $decimalSeparator : string = null
-
Optional. Decimal separator from settings by default.
Tags
mpa_evaluate_numbers()
mpa_evaluate_numbers(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
Tags
mpa_strip_html_whitespaces()
mpa_strip_html_whitespaces(string $html) : string
Parameters
- $html : string
Tags
mpa_str_to_class_name()
mpa_str_to_class_name(string $string) : string
Parameters
- $string : string
-
Slug, HTML ID or any other string.
Tags
mpa_str_to_method_name()
mpa_str_to_method_name(string $string) : string
Parameters
- $string : string
-
Slug, HTML ID or any other string.
Tags
mpa_kses_link()
mpa_kses_link(string $text) : string
Parameters
- $text : string
Tags
mpa_limit()
mpa_limit(int|float $number, int|float $min, mixed $max) : int|float
Parameters
- $number : int|float
- $min : int|float
- $max : mixed
Tags
mpa_format_price()
mpa_format_price(float $price[, array<string|int, mixed> $args = [] ]) : string
Parameters
- $price : float
- $args : array<string|int, mixed> = []