Documentation

Packages

MotoPress

Namespaces

MotoPress

Table of Contents

mpa_array_filter_reset()  : array<string|int, mixed>
mpa_array_map_reset()  : array<string|int, mixed>
Applies the callback to the items and resets the indexes of the result array.
mpa_array_unique_reset()  : array<string|int, mixed>
mpa_array_group_by()  : array<string|int, mixed>
mpa_first_key()  : mixed|false
mpa_first_pair()  : array<string|int, mixed>
mpa_array_diff_all()  : array<string|int, mixed>
mpa_explode()  : array<string|int, mixed>
mpa_array_remove()  : mixed
mpa_array_clone()  : array<string|int, mixed>
mpa_combine_subarrays()  : array<string|int, mixed>
Merges nested arrays into one finel array. Preserves numeric indexes.
mpa_is_function_disabled()  : bool
mpa_is_operator()  : bool
mpa_is_post_autosave()  : bool
mpa_is_post_revision()  : bool
mpa_is_flatpickr_l10n()  : bool
mpa_current_year()  : int
mpa_date_format()  : string
Public date format, set in Settings > General.
mpa_format_date()  : string
mpa_parse_date()  : DateTime|mixed
mpa_validate_date()  : string|false
mpa_validate_date_pattern()  : string
mpa_today()  : DateTime
mpa_date_diff()  : int|false
mpa_draft_booking()  : array<string|int, mixed>|WP_Error
mpa_update_status()  : bool|WP_Error
mpa_get_booking()  : Booking|null
mpa_get_bookings()  : array<string|int, mixed>
mpa_get_reservations()  : array<string|int, Reservation>
mpa_get_payment()  : Payment|null
mpa_get_payments()  : array<string|int, mixed>
mpa_get_employee()  : Employee|null
mpa_get_employees()  : array<string|int, mixed>
mpa_get_employees_by_location()  : array<string|int, mixed>
mpa_get_employee_attributes()  : array<string|int, mixed>
mpa_get_location()  : Location|null
mpa_get_locations()  : array<string|int, mixed>
mpa_get_location_categories()  : array<string|int, WP_Term>|array<string|int, mixed>
mpa_get_schedule()  : Schedule|null
mpa_get_schedules()  : array<string|int, mixed>
mpa_get_service()  : Service|null
mpa_get_services()  : array<string|int, mixed>
mpa_get_service_attributes()  : array<string|int, mixed>
mpa_get_service_categories()  : array<string|int, WP_Term>|array<string|int, mixed>
mpa_get_service_category_total_count()  : int
mpa_extract_available_services()  : array<string|int, mixed>
Extracts the minimum information needed for booking/appointment shortcodes.
mpa_get_current_entity()  : AbstractEntity|null
mpa_get_entity()  : AbstractEntity|null
mpa_filter_empty_string()  : bool
mpa_filter_post_slugs()  : array<string|int, mixed>
mpa_filter_term_slugs()  : array<string|int, mixed>
_mpa_filter_object_slugs()  : array<string|int, mixed>
mpa_filter_asset()  : string
Transforms relative path to the asset file with an URL to it.
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
mpa_is_translation_page()  : bool
mpa_translate_string()  : string
mpa_translate_page_id()  : int
mpa_switch_language()  : mixed
mpa_weekday()  : string
mpa_weekday_abbr()  : string
mpa_month()  : string
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
mpapp()  : Plugin
mpa_assets()  : Assets
mpa_path_to()  : string
mpa_url_to()  : string
mpa_languages_dir()  : string
mpa_uploads_dir()  : string
mpa_version()  : string
mpa_get_plugin_data()  : string
mpa_name()  : string
mpa_shortcodes()  : ShortcodesRegistry
mpa_plugin_uri()  : string
mpa_plugin_author()  : string
mpa_is_hotel_booking_active()  : bool
mpa_booking()  : BookingPostType
mpa_employee()  : EmployeePostType
mpa_location()  : LocationPostType
mpa_reservation()  : ReservationPostType
mpa_schedule()  : SchedulePostType
mpa_service()  : ServicePostType
mpa_shortcode()  : ShortcodePostType
mpa_parse_html_attr()  : mixed
mpa_verify_nonce()  : bool
mpa_rest_request_error()  : WP_Error
mpa_rest_failure_error()  : WP_Error
mpa_rest_sanitize_id()  : int
mpa_rest_sanitize_ids()  : array<string|int, int>
mpa_rest_sanitize_date()  : DateTime|null
mpa_rest_sanitize_date_string()  : string
mpa_rest_sanitize_bool()  : bool
mpa_rest_sanitize_cart_items()  : array<string|int, mixed>
mpa_display_template()  : mixed
mpa_render_template()  : string
mpa_locate_template()  : string
mpa_load_template()  : string
mpa_template_dir()  : string
mpa_tmpl_atts()  : string
mpa_tmpl_button()  : string
mpa_tmpl_dashicon()  : string
mpa_tmpl_edit_post_link()  : string
mpa_tmpl_edit_post_link_no_role_checks()  : string
mpa_tmpl_edit_post_links()  : array<string|int, mixed>
mpa_tmpl_form_table()  : string
mpa_tmpl_hidden()  : string
mpa_tmpl_link()  : string
mpa_tmpl_notice()  : string
mpa_tmpl_select()  : string
mpa_tmpl_select_options()  : string
mpa_tmpl_page_select()  : string
mpa_tmpl_placeholder()  : string
mpa_tmpl_aria_placeholder()  : string
mpa_tmpl_required()  : string
mpa_tmpl_required_tip()  : string
mpa_tmpl_price()  : string
mpa_tmpl_price_number()  : string
mpa_tmpl_attr()  : string
mpa_tmpl_dropdown()  : string
Based on Bootstrap 4.
mpa_tmpl_schedule()  : array<string|int, mixed>
mpa_tmpl_term_title()  : string
mpa_tmpl_post_thumbnail()  : string
mpa_tmpl_employees_number()  : string
mpa_tmpl_service_capacity()  : string
mpa_tmpl_id()  : string
mpa_tmpl_preloader()  : string
mpa_format_minutes()  : string
mpa_minutes_to_duration()  : string
mpa_parse_to_minutes()  : int
Convert something like '08:20' into 500.
mpa_format_time()  : string
mpa_parse_time()  : DateTime|mixed
mpa_validate_time()  : string|false
mpa_validate_time_pattern()  : string
mpa_time_format()  : string
Public time format, set in Settings > General.
mpa_time_durations()  : array<string|int, mixed>
mpa_time_stamps()  : array<string|int, mixed>
mpa_timestamp_minutes()  : int
mpa_time_slots()  : array<string|int, TimePeriod>
mpa_next_time_step()  : DateTime
mpa_time_step()  : int
mpa_add_buffer_time()  : TimePeriod
mpa_add_post_metas()  : mixed
mpa_delete_post_metas()  : mixed
mpa_update_post_status()  : bool|WP_Error
mpa_get_status_label()  : string
Retrieve a post status label by it's name.
mpa_get_terms()  : array<string|int, WP_Term>|array<string|int, mixed>
mpa_build_query_order_args()  : array<string|int, mixed>
Notice: the function does not validate the values. Validate all fields first, before passing them to the function.
mpa_get_paged()  : int
mpa_get_post_by_name()  : WP_Post|null
mpa_get_post_class()  : string
Retrieve the classes for the post div.
mpa_get_post_id_by_name()  : int
mpa_get_post_meta()  : mixed
mpa_get_post_thumbnail_size()  : string
mpa_get_posts_per_page()  : int
mpa_get_term_link()  : string
mpa_get_term_attachment_image()  : string
mpa_get_term_attachment_image_src()  : array<string|int, mixed>|false
mpa_get_term_thumbnail_id()  : int
mpa_term_has_thumbnail()  : bool
mpa_get_post_attachment_image_url()  : string
mpa_the_content()  : mixed
mpa_sanitize_html_classes()  : string
mpa_wordpress_at_least()  : bool
mb_convert_encoding()  : mixed
mb_convert_encoding_callback()  : mixed
mb_detect_encoding()  : mixed
mb_validate_encoding()  : mixed

Functions

mpa_array_filter_reset()

mpa_array_filter_reset(array<string|int, mixed> $array[, callable $callback = null ]) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$callback : callable = null

Optional. Null by default.

Tags
since
1.0

mpa_array_map_reset()

Applies the callback to the items and resets the indexes of the result array.

mpa_array_map_reset(callable $callback, array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$callback : callable
$items : array<string|int, mixed>
Tags
since
1.0

mpa_array_unique_reset()

mpa_array_unique_reset(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
since
1.0

mpa_array_group_by()

mpa_array_group_by(array<string|int, mixed> $array, int|string $key) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$key : int|string
Tags
since
1.0

mpa_first_key()

mpa_first_key(array<string|int, mixed> $array) : mixed|false
Parameters
$array : array<string|int, mixed>
Tags
since
1.0

mpa_first_pair()

mpa_first_pair(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
since
1.0

mpa_array_diff_all()

mpa_array_diff_all(array<string|int, mixed> &$array1, array<string|int, mixed> &$array2) : array<string|int, mixed>
Parameters
$array1 : array<string|int, mixed>
$array2 : array<string|int, mixed>
Tags
since
1.2

mpa_explode()

mpa_explode(string $string[, string $delimiter = ',' ]) : array<string|int, mixed>
Parameters
$string : string
$delimiter : string = ','

Optional. ',' by default.

Tags
since
1.2

mpa_array_remove()

mpa_array_remove(array<string|int, mixed> &$array, mixed $value) : mixed
Parameters
$array : array<string|int, mixed>
$value : mixed
Tags
since
1.2.1

mpa_array_clone()

mpa_array_clone(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
$vars : array<string|int, mixed>
Tags
since
1.2.1

mpa_combine_subarrays()

Merges nested arrays into one finel array. Preserves numeric indexes.

mpa_combine_subarrays(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
since
1.2.1

mpa_is_function_disabled()

mpa_is_function_disabled(string $functionName) : bool
Parameters
$functionName : string
Tags
since
1.0

mpa_is_operator()

mpa_is_operator(mixed $value) : bool
Parameters
$value : mixed
Tags
since
1.0

mpa_is_post_autosave()

mpa_is_post_autosave(int|WP_Post $post) : bool
Parameters
$post : int|WP_Post
Tags
since
1.0

mpa_is_post_revision()

mpa_is_post_revision(int|WP_Post $post) : bool
Parameters
$post : int|WP_Post
Tags
since
1.0

mpa_is_flatpickr_l10n()

mpa_is_flatpickr_l10n(string $language) : bool
Parameters
$language : string

Language like "en", "uk", "ru" etc.

Tags
since
1.2.1

mpa_current_year()

mpa_current_year() : int
Tags
since
1.0

mpa_date_format()

Public date format, set in Settings > General.

mpa_date_format() : string
Tags
since
1.0

mpa_format_date()

mpa_format_date(DateTime $date[, string $format = 'public' ]) : string
Parameters
$date : DateTime
$format : string = 'public'

Optional. 'public', 'internal' ('Y-m-d') or custom date format. 'public' by default.

Tags
since
1.0

mpa_parse_date()

mpa_parse_date(string|DateTime $date[, mixed $default = false ]) : DateTime|mixed
Parameters
$date : string|DateTime

Only the internal format is acceptable as a string: 'Y-m-d'.

$default : mixed = false

Optional. False by default (same return value as in the DateTime::createFromFormat()).

Tags
since
1.0
since
1.2.1

the argument $date accepts DateTime object.

mpa_validate_date()

mpa_validate_date(string $dateString[, mixed $default = false ]) : string|false
Parameters
$dateString : string

Only the internal format is acceptable - 'Y-m-d'.

$default : mixed = false

Optional. False by default.

Tags
since
1.0

mpa_validate_date_pattern()

mpa_validate_date_pattern() : string
Tags
since
1.0

mpa_today()

mpa_today([string $modifier = '' ]) : DateTime
Parameters
$modifier : string = ''

Optional. Modifier like '+1 day'. Empty by default.

Tags
since
1.0

mpa_date_diff()

mpa_date_diff(DateTime $origin, DateTime $target[, string $units = 'minutes' ]) : int|false
Parameters
$origin : DateTime
$target : DateTime
$units : string = 'minutes'

Optional. Only 'minutes' are available at the moment.

Tags
since
1.2

mpa_draft_booking()

mpa_draft_booking([array<string|int, mixed> $args = [] ]) : array<string|int, mixed>|WP_Error
Parameters
$args : array<string|int, mixed> = []

Optional. @param bool $args['payment'] Whether to create a payment post also. By default: only if payments are enabled in the plugin settings. @param bool $args['wp_error'] Whether to return a WP_Error on failure. True by default. @param bool $args['clean'] Whether to delete a booking post if failed to create a payment post. True by default.

Tags
since
1.5.0

mpa_update_status()

mpa_update_status(Booking|Payment $entity, string $status[, bool $wpError = false ]) : bool|WP_Error
Parameters
$entity : Booking|Payment
$status : string
$wpError : bool = false

Optional. Whether to return a WP_Error on failure. False by default.

Tags
since
1.5.0

mpa_get_booking()

mpa_get_booking(int $id[, bool $forceReload = false ]) : Booking|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

mpa_get_bookings()

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

Optional.

Tags
see
AbstractRepository::findAll()
since
1.0

mpa_get_reservations()

mpa_get_reservations(int $bookingId[, bool $forceReload = false ]) : array<string|int, Reservation>
Parameters
$bookingId : int
$forceReload : bool = false

Optional. False by default.

Tags
since
1.0

mpa_get_payment()

mpa_get_payment(int $id[, bool $forceReload = false ]) : Payment|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.5.0

mpa_get_payments()

mpa_get_payments([array<string|int, mixed> $args = ['fields' => ['id' => 'name']] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = ['fields' => ['id' => 'name']]

Optional.

Tags
since
1.5.0
see
AbstractRepository::findAll()

mpa_get_employee()

mpa_get_employee(int $id[, bool $forceReload = false ]) : Employee|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

mpa_get_employees()

mpa_get_employees([array<string|int, mixed> $args = ['fields' => ['id' => 'name']] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = ['fields' => ['id' => 'name']]

Optional.

Tags
see
AbstractRepository::findAll()
since
1.0

mpa_get_employees_by_location()

mpa_get_employees_by_location(int|array<string|int, int> $location[, array<string|int, mixed> $args = ['fields' => ['id' => 'name']] ]) : array<string|int, mixed>
Parameters
$location : int|array<string|int, int>
$args : array<string|int, mixed> = ['fields' => ['id' => 'name']]

Optional.

Tags
since
1.2

TODO: move this to the \MotoPress\Appointment\Helpers\EmployeeHelper

mpa_get_employee_attributes()

mpa_get_employee_attributes(int|Employee $employee[, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$employee : int|Employee
$args : array<string|int, mixed> = []

Optional. @param bool $args['show_contacts'] True by default. @param bool $args['show_social_networks'] True by default. @param bool $args['show_additional_info'] True by default.

Tags
since
1.2

TODO: move this to the \MotoPress\Appointment\Helpers\EmployeeHelper

mpa_get_location()

mpa_get_location(int $id[, bool $forceReload = false ]) : Location|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

mpa_get_locations()

mpa_get_locations([array<string|int, mixed> $args = ['fields' => ['id' => 'name']] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = ['fields' => ['id' => 'name']]

Optional.

Tags
see
AbstractRepository::findAll()
since
1.0

mpa_get_location_categories()

mpa_get_location_categories(int $locationId[, string|array<string|int, mixed> $fields = ['slug' => 'name'] ][, array<string|int, mixed> $args = [] ]) : array<string|int, WP_Term>|array<string|int, mixed>
Parameters
$locationId : int

Optional. 0 by default.

$fields : string|array<string|int, mixed> = ['slug' => 'name']

Optional. 'all', field name or key-value pair. ['slug' => 'name'] by default.

$args : array<string|int, mixed> = []

Optional.

Tags
since
1.1.0

mpa_get_schedule()

mpa_get_schedule(int $id[, bool $forceReload = false ]) : Schedule|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

mpa_get_schedules()

mpa_get_schedules([array<string|int, mixed> $args = ['fields' => ['id' => 'title']] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = ['fields' => ['id' => 'title']]

Optional.

Tags
see
AbstractRepository::findAll()
since
1.0

mpa_get_service()

mpa_get_service(int $id[, bool $forceReload = false ]) : Service|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

mpa_get_services()

mpa_get_services([array<string|int, mixed> $args = ['fields' => ['id' => 'title']] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = ['fields' => ['id' => 'title']]

Optional.

Tags
see
AbstractRepository::findAll()
since
1.0

mpa_get_service_attributes()

mpa_get_service_attributes(int|Service $service[, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$service : int|Service
$args : array<string|int, mixed> = []

Optional. @param bool $args['show_price'] True by default. @param bool $args['show_duration'] True by default.

Tags
since
1.2

mpa_get_service_categories()

mpa_get_service_categories(int $serviceId[, string|array<string|int, mixed> $fields = ['slug' => 'name'] ][, array<string|int, mixed> $args = [] ]) : array<string|int, WP_Term>|array<string|int, mixed>
Parameters
$serviceId : int

Optional. 0 by default.

$fields : string|array<string|int, mixed> = ['slug' => 'name']

Optional. 'all', field name or key-value pair. ['slug' => 'name'] by default.

$args : array<string|int, mixed> = []

Optional.

Tags
since
1.0

mpa_get_service_category_total_count()

mpa_get_service_category_total_count(WP_Term|int $term) : int
Parameters
$term : WP_Term|int
Tags
since
1.2

mpa_extract_available_services()

Extracts the minimum information needed for booking/appointment shortcodes.

mpa_extract_available_services() : array<string|int, mixed>

For example:

    $bookableServices = [
        134 => [
            'name'       => "Man's Haircut",
            'categories' => [
                'barbershop' => 'Barbershop',
                'haircuts'   => 'Haircuts'
            ],
            'employees'  => [
                125 => [
                    'name'      => 'John Doe',
                    'schedule'  => 131,
                    'locations' => [
                        129 => 'Barbershop'
                    ]
                ]
            ]
        ],
        135 => [
            'name'       => "Woman's Haircut",
            'categories' => [
                'uncategorized' => 'Uncategorized'
            ],
            'employees'  => [
                127 => [
                    'name'      => 'Mary Doe',
                    'schedule'  => 133,
                    'locations' => [
                        130 => 'Hairdressing Salon'
                    ]
                ]
            ]
        ]
    ];
Tags
since
1.0

mpa_get_current_entity()

mpa_get_current_entity() : AbstractEntity|null
Tags
since
1.2

mpa_get_entity()

mpa_get_entity(int $postId) : AbstractEntity|null
Parameters
$postId : int

Optional. Current post by default.

Tags
since
1.2

mpa_filter_empty_string()

mpa_filter_empty_string(string $string) : bool
Parameters
$string : string
Tags
since
1.2

mpa_filter_post_slugs()

mpa_filter_post_slugs(array<string|int, mixed> $args[, array<string|int, mixed> $keys = [] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Args to filter.

$keys : array<string|int, mixed> = []

Optional. Keys to filter. All keys by default.

Tags
since
1.2

mpa_filter_term_slugs()

mpa_filter_term_slugs(array<string|int, mixed> $args[, array<string|int, mixed> $keys = [] ][, string|array<string|int, mixed> $taxonomy = 'any' ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Args to filter.

$keys : array<string|int, mixed> = []

Optional. Keys to filter. All keys by default.

$taxonomy : string|array<string|int, mixed> = 'any'

Optional. Taxonomy name, or array of taxonomies, to which filter should be limited. 'any' by default.

Tags
since
1.2

_mpa_filter_object_slugs()

_mpa_filter_object_slugs(string $objectType, array<string|int, mixed> $args, array<string|int, mixed> $keys, array<string|int, mixed> $queryArgs) : array<string|int, mixed>
Parameters
$objectType : string

'post'|'taxonomy'

$args : array<string|int, mixed>

Args to filter.

$keys : array<string|int, mixed>

Keys to filter.

$queryArgs : array<string|int, mixed>

Additional query args.

Tags
since
1.2

mpa_filter_asset()

Transforms relative path to the asset file with an URL to it.

mpa_filter_asset(string $asset[, string $pluginUrl = MotoPressAppointmentPLUGIN_URL ]) : string
Parameters
$asset : string

Asset file (script or stylesheet).

$pluginUrl : string = MotoPressAppointmentPLUGIN_URL

Optional. Appointment Booking by default.

Tags
since
1.2.1
since
1.5.0

skips the absolute URLs.

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> = []

mpa_is_translation_page()

mpa_is_translation_page([string $postType = '' ]) : bool
Parameters
$postType : string = ''

Optional.

Tags
since
1.0

mpa_translate_string()

mpa_translate_string(string $string, array<string|int, mixed> ...$args) : string
Parameters
$string : string
$args : array<string|int, mixed>

Optional.

Tags
since
1.1.0

mpa_translate_page_id()

mpa_translate_page_id(int $pageId) : int
Parameters
$pageId : int
Tags
since
1.5.0

mpa_switch_language()

mpa_switch_language([string|null $language = null ]) : mixed
Parameters
$language : string|null = null

Optional. Default language by default.

Tags
since
1.0

mpa_weekday()

mpa_weekday(int $dayNumber) : string
Parameters
$dayNumber : int

0-6 (Sunday-Saturday).

Tags
since
1.2

mpa_weekday_abbr()

mpa_weekday_abbr(int $dayNumber) : string
Parameters
$dayNumber : int

0-6 (Sunday-Saturday).

Tags
since
1.2

mpa_month()

mpa_month(int $monthNumber) : string
Parameters
$monthNumber : int

1-12 (January-February).

Tags
since
1.2

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

mpapp()

mpapp() : Plugin
Tags
since
1.0

mpa_assets()

mpa_assets() : Assets
Tags
since
1.0

mpa_path_to()

mpa_path_to(string $file[, string $pluginDir = MotoPressAppointmentPLUGIN_DIR ]) : string
Parameters
$file : string

Relative path to the plugin file.

$pluginDir : string = MotoPressAppointmentPLUGIN_DIR

Optional. Appointment Booking by default.

Tags
since
1.0
since
1.2.1

added the pluginDir argument.

mpa_url_to()

mpa_url_to(string $file[, string $pluginUrl = MotoPressAppointmentPLUGIN_URL ]) : string
Parameters
$file : string

Relative path to the plugin file.

$pluginUrl : string = MotoPressAppointmentPLUGIN_URL

Optional. Appointment Booking by default.

Tags
since
1.0
since
1.2.1

added the pluginUrl argument.

mpa_languages_dir()

mpa_languages_dir([string $path = 'relative' ]) : string
Parameters
$path : string = 'relative'

'relative'|'absolute' Optional. 'relative' by default (that suits well textdomain functions, like load_plugin_textdomain()).

Tags
since
1.2.1

mpa_uploads_dir()

mpa_uploads_dir() : string
Tags
since
1.0

mpa_version()

mpa_version() : string
Tags
since
1.0

mpa_get_plugin_data()

mpa_get_plugin_data() : string
Tags
since
1.0

mpa_name()

mpa_name() : string
Tags
since
1.1.0

mpa_shortcodes()

mpa_shortcodes() : ShortcodesRegistry
Tags
since
1.2

mpa_plugin_uri()

mpa_plugin_uri() : string
Tags
since
1.5.0

mpa_plugin_author()

mpa_plugin_author() : string
Tags
since
1.5.0

mpa_is_hotel_booking_active()

mpa_is_hotel_booking_active() : bool
Tags
since
1.14.0

mpa_booking()

mpa_booking() : BookingPostType
Tags
since
1.2

mpa_employee()

mpa_employee() : EmployeePostType
Tags
since
1.2

mpa_location()

mpa_location() : LocationPostType
Tags
since
1.2

mpa_reservation()

mpa_reservation() : ReservationPostType
Tags
since
1.2

mpa_schedule()

mpa_schedule() : SchedulePostType
Tags
since
1.2

mpa_service()

mpa_service() : ServicePostType
Tags
since
1.2

mpa_shortcode()

mpa_shortcode() : ShortcodePostType
Tags
since
1.2

mpa_parse_html_attr()

mpa_parse_html_attr(string $attribute, string $html[, mixed $default = '' ]) : mixed
Parameters
$attribute : string
$html : string
$default : mixed = ''

Optional. '' by default.

Tags
since
1.3

mpa_verify_nonce()

mpa_verify_nonce(string $action[, string $nonceField = 'mpa_nonce' ]) : bool
Parameters
$action : string

Action name. May be unprefixed.

$nonceField : string = 'mpa_nonce'

Optional. 'mpa_nonce' by default.

Tags
since
1.0

mpa_rest_request_error()

mpa_rest_request_error(string $message) : WP_Error
Parameters
$message : string
Tags
since
1.0

mpa_rest_failure_error()

mpa_rest_failure_error(string $message) : WP_Error
Parameters
$message : string
Tags
since
1.5.0

mpa_rest_sanitize_id()

mpa_rest_sanitize_id(string|int $id) : int
Parameters
$id : string|int
Tags
since
1.0

mpa_rest_sanitize_ids()

mpa_rest_sanitize_ids(string|array<string|int, mixed> $ids) : array<string|int, int>
Parameters
$ids : string|array<string|int, mixed>
Tags
since
1.0

mpa_rest_sanitize_date()

mpa_rest_sanitize_date(string|DateTime $date) : DateTime|null
Parameters
$date : string|DateTime
Tags
since
1.0

mpa_rest_sanitize_date_string()

mpa_rest_sanitize_date_string(string $dateString) : string
Parameters
$dateString : string
Tags
since
1.0

mpa_rest_sanitize_bool()

mpa_rest_sanitize_bool(mixed $value) : bool
Parameters
$value : mixed
Tags
since
1.2.1

mpa_rest_sanitize_cart_items()

mpa_rest_sanitize_cart_items(mixed $input) : array<string|int, mixed>
Parameters
$input : mixed
Tags
since
1.4.0

mpa_display_template()

mpa_display_template(array<string|int, mixed> ...$args) : mixed
Parameters
$args : array<string|int, mixed>
Tags
since
1.0

mpa_render_template()

mpa_render_template(array<string|int, mixed> ...$args) : string
Parameters
$args : array<string|int, mixed>
Tags
since
1.0

mpa_locate_template()

mpa_locate_template(string|array<string|int, mixed> $templates) : string
Parameters
$templates : string|array<string|int, mixed>
Tags
since
1.0

mpa_load_template()

mpa_load_template(string $template_file[, array<string|int, mixed> $template_args = [] ]) : string
Parameters
$template_file : string
$template_args : array<string|int, mixed> = []

Optional.

Tags
since
1.0

mpa_template_dir()

mpa_template_dir() : string
Tags
since
1.0

mpa_tmpl_atts()

mpa_tmpl_atts(array<string|int, mixed> $atts[, bool $allowEmpty = true ]) : string
Parameters
$atts : array<string|int, mixed>
$allowEmpty : bool = true

Optional. True by default.

Tags
since
1.0
since
1.2

added optional parameter $allowEmpty.

mpa_tmpl_button()

mpa_tmpl_button(string $label[, array<string|int, mixed> $atts = [] ]) : string
Parameters
$label : string
$atts : array<string|int, mixed> = []

Optional. @param string $atts['class'] 'button' by default. @param string $atts['type'] 'button' by default.

Tags
since
1.0

mpa_tmpl_dashicon()

mpa_tmpl_dashicon(string $name[, string $class = '' ]) : string
Parameters
$name : string
$class : string = ''

Optional. Additional class to set. '' by default.

Tags
since
1.0

mpa_tmpl_edit_post_link()

mpa_tmpl_edit_post_link(int $postId[, string $title = '' ]) : string
Parameters
$postId : int
$title : string = ''

Optional.

Tags
since
1.0

mpa_tmpl_edit_post_link_no_role_checks()

mpa_tmpl_edit_post_link_no_role_checks(int $postId) : string
Parameters
$postId : int
Tags
since
1.15.0

mpa_tmpl_edit_post_links()

mpa_tmpl_edit_post_links(array<string|int, mixed> $postsList) : array<string|int, mixed>
Parameters
$postsList : array<string|int, mixed>

[Post ID => Post title]

Tags
since
1.0

mpa_tmpl_form_table()

mpa_tmpl_form_table(array<string|int, mixed> $fields[, array<string|int, mixed> $args = [] ]) : string
Parameters
$fields : array<string|int, mixed>

Array of [label, field].

$args : array<string|int, mixed> = []

Not to be confused with 'atts'. Optional.

Tags
since
1.0

mpa_tmpl_hidden()

mpa_tmpl_hidden(string $name, mixed $value[, array<string|int, mixed> $atts = [] ]) : string
Parameters
$name : string
$value : mixed
$atts : array<string|int, mixed> = []

Optional.

Tags
since
1.0
mpa_tmpl_link(string $href[, string $title = '' ][, array<string|int, mixed> $atts = [] ]) : string
Parameters
$href : string
$title : string = ''

Optional.

$atts : array<string|int, mixed> = []

Optional.

Tags
since
1.0

mpa_tmpl_notice()

mpa_tmpl_notice(string $type, string $messageHtml[, bool $isDismissible = true ]) : string
Parameters
$type : string

success|info|warning|error|none

$messageHtml : string
$isDismissible : bool = true

Optional. True by default.

Tags
since
1.0

mpa_tmpl_select()

mpa_tmpl_select(array<string|int, mixed> $options, mixed|array<string|int, mixed> $selected[, array<string|int, mixed> $atts = [] ]) : string
Parameters
$options : array<string|int, mixed>
$selected : mixed|array<string|int, mixed>
$atts : array<string|int, mixed> = []

Optional.

Tags
since
1.0

mpa_tmpl_select_options()

mpa_tmpl_select_options(array<string|int, mixed> $options, mixed|array<string|int, mixed> $selected) : string
Parameters
$options : array<string|int, mixed>
$selected : mixed|array<string|int, mixed>
Tags
since
1.0

mpa_tmpl_page_select()

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

Optional.

Tags
since
1.5.0
see
wp_dropdown_pages()
see
PageSelectField::renderInput()

mpa_tmpl_placeholder()

mpa_tmpl_placeholder() : string
Tags
since
1.0

mpa_tmpl_aria_placeholder()

mpa_tmpl_aria_placeholder() : string
Tags
since
1.1.0

mpa_tmpl_required()

mpa_tmpl_required() : string
Tags
since
1.0

mpa_tmpl_required_tip()

mpa_tmpl_required_tip() : string
Tags
since
1.0

mpa_tmpl_price()

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

Optional.

Tags
since
1.0

mpa_tmpl_price_number()

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

Optional. See mpa_tmpl_price() for details.

Tags
since
1.4.0

mpa_tmpl_attr()

mpa_tmpl_attr(string $name, mixed $value[, bool $allowEmpty = false ]) : string
Parameters
$name : string
$value : mixed
$allowEmpty : bool = false

Optional. False by default.

Tags
since
1.2

mpa_tmpl_dropdown()

Based on Bootstrap 4.

mpa_tmpl_dropdown(string $label, array<string|int, mixed> $actions[, array<string|int, mixed> $args = [] ]) : string
Parameters
$label : string
$actions : array<string|int, mixed>
$args : array<string|int, mixed> = []

Optional. @param bool $args['inline'] False by default. @param string $args['class'] '' by default. @param string $args['button_class'] 'button button-secondary' by default.

Tags
see
https://getbootstrap.com/docs/4.0/components/dropdowns/#single-button-dropdowns
since
1.2

mpa_tmpl_schedule()

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

mpa_tmpl_term_title()

mpa_tmpl_term_title(WP_Term $term[, array<string|int, mixed> $args = [] ]) : string
Parameters
$term : WP_Term
$args : array<string|int, mixed> = []

Optional. @param bool $args['show_count'] True by default.

Tags
since
1.2

mpa_tmpl_post_thumbnail()

mpa_tmpl_post_thumbnail(int|WP_Post $post[, string|array<string|int, int> $size = 'post-thumbnail' ][, array<string|int, mixed> $args = [] ]) : string
Parameters
$post : int|WP_Post
$size : string|array<string|int, int> = 'post-thumbnail'

Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). 'post-thumbnail' by default.

$args : array<string|int, mixed> = []

Optional. @param bool $args['add_link'] Wrap image with the link. True by default.

Tags
since
1.2

mpa_tmpl_employees_number()

mpa_tmpl_employees_number(int $number) : string
Parameters
$number : int
Tags
since
1.2

mpa_tmpl_service_capacity()

mpa_tmpl_service_capacity(Service $service) : string
Parameters
$service : Service
Tags
see
mpa_tmpl_service_capacity()

in assets/dev/functions/entity.js.

since
1.2

mpa_tmpl_id()

mpa_tmpl_id(string $string[, bool $allowUnderscore = false ]) : string
Parameters
$string : string

Any string.

$allowUnderscore : bool = false

Optional. False by default.

Tags
since
1.2.1

mpa_tmpl_preloader()

mpa_tmpl_preloader() : string
Tags
since
1.11.0

mpa_format_minutes()

mpa_format_minutes(int $minutes[, string $format = 'public' ]) : string
Parameters
$minutes : int
$format : string = 'public'

Optional. 'public', 'internal' ('H:i') or custom time format. 'public' by default.

Tags
since
1.0

mpa_minutes_to_duration()

mpa_minutes_to_duration(int $minutes) : string
Parameters
$minutes : int
Tags
since
1.0

mpa_parse_to_minutes()

Convert something like '08:20' into 500.

mpa_parse_to_minutes(string $timeString) : int
Parameters
$timeString : string

Time in format 'H:i' ('XX:XX'; the function will not check if the format is OK).

Tags
since
1.0

mpa_format_time()

mpa_format_time(DateTime $time[, string $format = 'public' ]) : string
Parameters
$time : DateTime
$format : string = 'public'

Optional. 'public', 'internal' ('H:i') or custom time format. 'public' by default.

Tags
since
1.0

mpa_parse_time()

mpa_parse_time(string|DateTime $time[, mixed $default = false ]) : DateTime|mixed
Parameters
$time : string|DateTime

Only the internal format is acceptable as a string: 'H:i'.

$default : mixed = false

Optional. False by default (same return value as in the DateTime::createFromFormat()).

Tags
since
1.0
since
1.2.1

the argument $time accepts DateTime object.

mpa_validate_time()

mpa_validate_time(string $timeString) : string|false
Parameters
$timeString : string

Only the internal format is acceptable - 'H:i'.

Tags
since
1.0

mpa_validate_time_pattern()

mpa_validate_time_pattern() : string
Tags
since
1.0

mpa_time_format()

Public time format, set in Settings > General.

mpa_time_format() : string
Tags
since
1.0

mpa_time_durations()

mpa_time_durations(int $min[, int $max = 1439 ]) : array<string|int, mixed>
Parameters
$min : int

Optional. 0 by default.

$max : int = 1439

Optional. 1439 by default (the latest time (in minutes): 23:59).

Tags
since
1.0

mpa_time_stamps()

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

Optional. @param int $args['time_step'] Time step from the settings by default. @param string $args['map_function'] mpa_format_minutes() by default. @param int $args['min'] 0 by default. @param int $args['max'] 1439 by default (the latest time (in minutes): 23:59).

Tags
since
1.0

mpa_timestamp_minutes()

mpa_timestamp_minutes(DateTime $time) : int
Parameters
$time : DateTime
Tags
since
1.2.1

mpa_time_slots()

mpa_time_slots(TimePeriod|array<string|int, TimePeriod>|TimePeriods $time, array<string|int, mixed> $args) : array<string|int, TimePeriod>
Parameters
$time : TimePeriod|array<string|int, TimePeriod>|TimePeriods
$args : array<string|int, mixed>

@param int $args['duration'] Required. Service duration (minutes). @param int $args['time_step'] Optional. Length of the time slot step. Time step from the settings by default. @param int $args['buffer_before'] Optional. Buffer time before the service (in minutes). 0 by default. @param int $args['buffer_after'] Optional. Buffer time after the service (in minutes). 0 by default. @param DateTime $args['min_time'] Optional. No limitations by default. @param string $args['alignment'] Optional. 'hour'|'none'. Alignment from the settings by default.

Tags
since
1.2.1

mpa_next_time_step()

mpa_next_time_step(DateTime $time[, array<string|int, mixed> $args = [] ]) : DateTime
Parameters
$time : DateTime
$args : array<string|int, mixed> = []

Optional. @param int $args['time_step'] Time step from the settings by default. @param string $args['alignment'] Alignment from the settings by default.

Tags
since
1.2.1

mpa_time_step()

mpa_time_step() : int
Tags
since
1.2.1

mpa_add_buffer_time()

mpa_add_buffer_time(TimePeriod|string $timePeriod, Service $service) : TimePeriod
Parameters
$timePeriod : TimePeriod|string
$service : Service
Tags
since
1.4.0

mpa_add_post_metas()

mpa_add_post_metas(int $postId, string $metaName, array<string|int, mixed> $metaValues) : mixed
Parameters
$postId : int
$metaName : string
$metaValues : array<string|int, mixed>
Tags
since
1.0

mpa_delete_post_metas()

mpa_delete_post_metas(int $postId, string $metaName, array<string|int, mixed> $metaValues) : mixed
Parameters
$postId : int
$metaName : string
$metaValues : array<string|int, mixed>
Tags
since
1.0

mpa_update_post_status()

mpa_update_post_status(int $postId, string $postStatus[, bool $wpError = false ]) : bool|WP_Error
Parameters
$postId : int
$postStatus : string
$wpError : bool = false

Optional. Whether to return a WP_Error on failure. False by default.

Tags
since
1.5.0

mpa_get_status_label()

Retrieve a post status label by it's name.

mpa_get_status_label(string $status) : string
Parameters
$status : string
Tags
since
1.0
todo

Use translations from default WordPress textdomain.

mpa_get_terms()

mpa_get_terms(int $postId, string $taxonomy[, string|array<string|int, mixed> $fields = ['slug' => 'name'] ][, array<string|int, mixed> $args = [] ]) : array<string|int, WP_Term>|array<string|int, mixed>
Parameters
$postId : int

Gets all available terms for 0.

$taxonomy : string
$fields : string|array<string|int, mixed> = ['slug' => 'name']

Optional. 'all', field name or key-value pair. ['slug' => 'name'] by default.

$args : array<string|int, mixed> = []

Optional.

Tags
since
1.0

mpa_build_query_order_args()

Notice: the function does not validate the values. Validate all fields first, before passing them to the function.

mpa_build_query_order_args(array<string|int, mixed> $args[, array<string|int, mixed> $failResponse = [] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Shortcode or other args.

$failResponse : array<string|int, mixed> = []

Optional. [] by default.

Tags
see
https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
since
1.2

mpa_get_paged()

mpa_get_paged() : int
Tags
since
1.2

mpa_get_post_by_name()

mpa_get_post_by_name(string $postName, string $postType[, array<string|int, mixed> $args = [] ]) : WP_Post|null
Parameters
$postName : string

The post's slug.

$postType : string
$args : array<string|int, mixed> = []

Optional. Custom query args for get_posts(). [] by default.

Tags
since
1.2

mpa_get_post_class()

Retrieve the classes for the post div.

mpa_get_post_class([string|array<string|int, mixed> $class = '' ][, int|WP_Post|null $postId = null ]) : string
Parameters
$class : string|array<string|int, mixed> = ''

Optional. One or more classes to add to the class list. '' by default.

$postId : int|WP_Post|null = null

Optional. Post ID or post object. Current post by default (null).

Tags
since
1.2

mpa_get_post_id_by_name()

mpa_get_post_id_by_name(string $postName, string $postType[, array<string|int, mixed> $args = [] ]) : int
Parameters
$postName : string
$postType : string
$args : array<string|int, mixed> = []

Optional. Custom query args for get_posts(). [] by default.

Tags
since
1.2

mpa_get_post_meta()

mpa_get_post_meta(int $postId[, string $metaName = '' ][, bool $isSingle = false ][, mixed $default = '' ]) : mixed
Parameters
$postId : int
$metaName : string = ''

Optional. '' by default (all fields of the post).

$isSingle : bool = false

Optional. False by default.

$default : mixed = ''

Optional. Default value for single meta. '' by default.

Tags
since
1.2

mpa_get_post_thumbnail_size()

mpa_get_post_thumbnail_size(string $postType[, string $view = '' ][, string $defaultSize = 'post-thumbnail' ]) : string
Parameters
$postType : string
$view : string = ''

Optional. '' by default.

$defaultSize : string = 'post-thumbnail'

Optional. 'post-thumbnail' by default.

Tags
since
1.2

mpa_get_posts_per_page()

mpa_get_posts_per_page() : int
Tags
since
1.2
mpa_get_term_link(WP_Term|int|string $term[, string $taxonomy = '' ]) : string
Parameters
$term : WP_Term|int|string

The term object, ID, or slug whose link will be retrieved.

$taxonomy : string = ''

Optional. '' by default.

Tags
since
1.2

mpa_get_term_attachment_image()

mpa_get_term_attachment_image(WP_Term|int $term[, string|array<string|int, int> $size = 'thumbnail' ]) : string
Parameters
$term : WP_Term|int
$size : string|array<string|int, int> = 'thumbnail'

Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). 'thumbnail' by default.

Tags
since
1.2

mpa_get_term_attachment_image_src()

mpa_get_term_attachment_image_src(WP_Term|int $term[, string|array<string|int, int> $size = 'thumbnail' ]) : array<string|int, mixed>|false
Parameters
$term : WP_Term|int
$size : string|array<string|int, int> = 'thumbnail'

Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). 'thumbnail' by default.

Tags
since
1.2

mpa_get_term_thumbnail_id()

mpa_get_term_thumbnail_id(WP_Term|int $term) : int
Parameters
$term : WP_Term|int
Tags
since
1.2

mpa_term_has_thumbnail()

mpa_term_has_thumbnail(WP_Term|int $term) : bool
Parameters
$term : WP_Term|int
Tags
since
1.2

mpa_get_post_attachment_image_url()

mpa_get_post_attachment_image_url(int $postId[, string|array<string|int, int> $size = 'thumbnail' ]) : string
Parameters
$postId : int
$size : string|array<string|int, int> = 'thumbnail'

Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). 'thumbnail' by default.

Tags
since
1.4.0

mpa_the_content()

mpa_the_content() : mixed
Tags
global

bool $mpaDoingContent

since
1.2

mpa_sanitize_html_classes()

mpa_sanitize_html_classes(string $string) : string
Parameters
$string : string
Tags
since
1.2

mpa_wordpress_at_least()

mpa_wordpress_at_least(string $version) : bool
Parameters
$version : string

Version to check.

Tags
since
1.6.2

mb_convert_encoding()

mb_convert_encoding(mixed $s, mixed $toEncoding[, mixed $fromEncoding = null ]) : mixed
Parameters
$s : mixed
$toEncoding : mixed
$fromEncoding : mixed = null
Tags
link
https://github.com/symfony/polyfill-mbstring
since
1.1.0

mb_detect_encoding()

mb_detect_encoding(mixed $s[, mixed $encodings = null ][, mixed $strict = false ]) : mixed
Parameters
$s : mixed
$encodings : mixed = null
$strict : mixed = false
Tags
link
https://github.com/symfony/polyfill-mbstring
since
1.1.0

Search results