misc.php

Table of Contents

mpa_any_value()  : array<string|int, mixed>
mpa_no_value()  : array<string|int, mixed>
mpa_country_code()  : string
mpa_country_label()  : string
mpa_str_starts_with()  : bool
mpa_load_polyfill()  : mixed
mpa_mailer()  : MailerInterface
mpa_create_fields()  : array<string|int, AbstractField>
Usage: <ul> <li>1 argument (only fields, default usage): <code>mpa_create_fields($fields);</code> (get values from wp_options table)</li> <li>2 arguments - fields and prefix: <code>mpa_create_fields($fields, 'metabox'); // $type = 'postmeta', $id = get_the_ID()</code></li> <li>3 arguments - use default type, but custom ID: <code>mpa_create_fields($fields, 'metabox', $postId); // $type = 'postmeta', $id = $postId</code></li> <li>3 arguments: <code>mpa_create_fields($fields, $prefix, $type); // $id = get_the_ID()</code></li> <li>4 arguments: <code>mpa_create_fields($fields, $prefix, $type, $id);</code></li> </ul>
mpa_group_fields()  : array<string|int, mixed>
mpa_shift_days_array()  : array<string|int, mixed>
Works properly only when all values (with indexes 0-6) are present in the array.
mpa_str_ends_with()  : bool
mpa_carry()  : Function
mpa_carry_shift()  : Function
mpa_set_time_limit()  : mixed
mpa_generate_uuid4()  : string
Source: http://php.net/manual/ru/function.uniqid.php#94959
mpa_add_post_uid()  : int|false
Adds UID meta field only if it does not exist.
mpa_payment_manager()  : PaymentManager
mpa_generate_product_name()  : string

Functions

mpa_any_value()

mpa_any_value([mixed $value = '' ][, string $label = '' ]) : array<string|int, mixed>
Parameters
$value : mixed = ''

Optional. '' by default.

$label : string = ''

Optional. '— Any —' by default.

Tags
since
1.0

mpa_no_value()

mpa_no_value([mixed $value = '' ][, string $label = '' ]) : array<string|int, mixed>
Parameters
$value : mixed = ''

Optional. '' by default.

$label : string = ''

Optional. '— Select —' by default.

Tags
since
1.0

mpa_country_code()

mpa_country_code(string $countryLabel) : string
Parameters
$countryLabel : string

Country label like 'Germany' or 'United States (US)'.

Tags
since
1.0

mpa_country_label()

mpa_country_label(string $countryCode) : string
Parameters
$countryCode : string

Country code like 'US'.

Tags
since
1.0

mpa_str_starts_with()

mpa_str_starts_with(string $haystack, string $needle) : bool
Parameters
$haystack : string
$needle : string
Tags
author

MrHus

link
http://stackoverflow.com/a/834355/3918377
since
1.0

mpa_load_polyfill()

mpa_load_polyfill(string $polyfill) : mixed
Parameters
$polyfill : string

Polyfill name, like 'mbstring'.

Tags
since
1.1.0

mpa_mailer()

mpa_mailer() : MailerInterface
Tags
since
1.1.0

mpa_create_fields()

Usage: <ul> <li>1 argument (only fields, default usage): <code>mpa_create_fields($fields);</code> (get values from wp_options table)</li> <li>2 arguments - fields and prefix: <code>mpa_create_fields($fields, 'metabox'); // $type = 'postmeta', $id = get_the_ID()</code></li> <li>3 arguments - use default type, but custom ID: <code>mpa_create_fields($fields, 'metabox', $postId); // $type = 'postmeta', $id = $postId</code></li> <li>3 arguments: <code>mpa_create_fields($fields, $prefix, $type); // $id = get_the_ID()</code></li> <li>4 arguments: <code>mpa_create_fields($fields, $prefix, $type, $id);</code></li> </ul>

mpa_create_fields(array<string|int, mixed> $fields[, string $prefix = 'public' ][, string $type = 'option' ], int $id) : array<string|int, AbstractField>
Parameters
$fields : array<string|int, mixed>

Array of args.

$prefix : string = 'public'

Optional. See allowed prefixes in mpa_prefix(). 'public' by default.

$type : string = 'option'

'option'|'postmeta'|'widget' Optional. The type of the source. 'option' by default.

$id : int

Optional. ID of the post. Only for metaboxes (postmetas). Current post ID by default.

Tags
since
1.1.0
since
1.3

added the prefix argument.

since
1.3

added the type argument.

since
1.3

added the id argument.

mpa_group_fields()

mpa_group_fields(array<string|int, mixed> $fields) : array<string|int, mixed>
Parameters
$fields : array<string|int, mixed>

[Field name => args or AbstractField]

Tags
since
1.1.0

mpa_shift_days_array()

Works properly only when all values (with indexes 0-6) are present in the array.

mpa_shift_days_array(array<string|int, mixed> $daysArray[, int $firstDay = -1 ]) : array<string|int, mixed>
Parameters
$daysArray : array<string|int, mixed>
$firstDay : int = -1

Optional. -1 by default (use settings value).

Tags
since
1.2

mpa_str_ends_with()

mpa_str_ends_with(string $haystack, string $needle) : bool
Parameters
$haystack : string
$needle : string
Tags
since
1.2

mpa_carry()

mpa_carry(callable $function, mixed $carry) : Function
Parameters
$function : callable
$carry : mixed

Value of the last argument.

Tags
since
1.2.1

mpa_carry_shift()

mpa_carry_shift(callable $function, mixed $carry) : Function
Parameters
$function : callable
$carry : mixed

Value of the first argument.

Tags
since
1.2.1

mpa_set_time_limit()

mpa_set_time_limit(int $limit) : mixed
Parameters
$limit : int

The maximum execution time, in seconds. If set to zero, no time limit is imposed.

Tags
since
1.4.0

mpa_generate_uuid4()

Source: http://php.net/manual/ru/function.uniqid.php#94959

mpa_generate_uuid4() : string
Tags
since
1.5.0

mpa_add_post_uid()

Adds UID meta field only if it does not exist.

mpa_add_post_uid(int $postId[, string $uid = '' ]) : int|false
Parameters
$postId : int
$uid : string = ''

Optional. New UUID v4 by default.

Tags
since
1.5.0

mpa_payment_manager()

mpa_payment_manager() : PaymentManager
Tags
since
1.5.0

mpa_generate_product_name()

mpa_generate_product_name(Booking|int $booking) : string
Parameters
$booking : Booking|int

Booking entity or ID.

Tags
since
1.5.0

Search results