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
since
1.0

mpa_maybe_intval()

mpa_maybe_intval(string $string) : string|int
Parameters
$string : string
Tags
since
1.0

mpa_posint()

mpa_posint(int|string $value) : int
Parameters
$value : int|string
Tags
since
1.0

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
since
1.0
since
1.3

added the 'metabox' prefix.

since
1.3

added the 'widget' prefix.

since
1.3

added the 'none' prefix.

since
1.3

added the custom prefix support.

mpa_unprefix()

mpa_unprefix(string $string[, string $prefix = '' ]) : string
Parameters
$string : string
$prefix : string = ''

Optional. Custom prefix to remove.

Tags
since
1.0
since
1.3

added the prefix argument.

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
since
1.0

mpa_evaluate_numbers()

mpa_evaluate_numbers(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
since
1.2

mpa_strip_html_whitespaces()

mpa_strip_html_whitespaces(string $html) : string
Parameters
$html : string
Tags
since
1.2

mpa_str_to_class_name()

mpa_str_to_class_name(string $string) : string
Parameters
$string : string

Slug, HTML ID or any other string.

Tags
since
1.2.1

mpa_str_to_method_name()

mpa_str_to_method_name(string $string) : string
Parameters
$string : string

Slug, HTML ID or any other string.

Tags
since
1.2.1
mpa_kses_link(string $text) : string
Parameters
$text : string
Tags
since
1.2.1

mpa_limit()

mpa_limit(int|float $number, int|float $min, mixed $max) : int|float
Parameters
$number : int|float
$min : int|float
$max : mixed
Tags
since
1.3.1

mpa_format_price()

mpa_format_price(float $price[, array<string|int, mixed> $args = [] ]) : string
Parameters
$price : float
$args : array<string|int, mixed> = []

Search results