Skip to content

mc_phone_format

github-actions[bot] edited this page Jun 3, 2026 · 4 revisions

Format a phone number for display in template tags.

Auto-generated Example

add_filter(
   'mc_phone_format',
    function(
        string $number,
        string string
    ) {
        // Your code here.
        return $number;
    },
    10,
    2
);

Parameters

  • string $number Phone number as saved in $location->location_phone.
  • string string $context 'phone2'. Other variable names: string $context 'phone'., $phone, $phone2

Returns

string Formatted number.

Files

apply_filters( 'mc_phone_format', wp_unslash( $location->location_phone ), 'phone' )
apply_filters( 'mc_phone_format', wp_unslash( $location->location_phone2 ), 'phone2' )

← All Hooks

Clone this wiki locally