Matterport Developer Filters
Filters and actions in the Matterport extension. Add them to your theme's functions.php or a small plugin. For the template helper functions, see Template functions.
Detecting tours
| Filter |
What it changes |
epl_mp_string_to_check |
The list of domains (words) a link must contain to count as a tour. Receives the array from the Matterport Domains setting. |
epl_mp_get_keys |
The listing fields checked for tours. Default: property_external_link, property_external_link_2, property_external_link_3, property_com_mini_web, property_com_mini_web_2, property_com_mini_web_3. |
epl_matterport_meta_keys |
The same field list, per listing. Receives $keys and $post_id. |
epl_matterport_is_valid_url |
Whether a single link counts as a tour. Receives $is_tour, $url, $post_id and $meta_key. |
// Also treat links from my-tours.example.com as tours.
add_filter( 'epl_mp_string_to_check', function ( $domains ) {
$domains[] = 'my-tours.example.com';
return $domains;
} );
Labels
| Filter |
What it changes |
epl_button_label_{field} |
The button label for a tour in one field, for example epl_button_label_property_external_link_2. Receives the label. |
epl_mp_admin_label |
The 3D Tour label text in the listings admin. Receives $label and the listing's tour links. |
// Call the second tour "Virtual Tour".
add_filter( 'epl_button_label_property_external_link_2', function () {
return 'Virtual Tour';
} );
Around the tour
These actions run around each embedded tour. From the [epl_matterport] shortcode they receive arguments; from the 3D View setting they receive none.
| Action |
Runs |
Shortcode arguments |
epl_matterport_container_before |
Before the tour container |
$post_id, $urls |
epl_matterport_display_before |
Inside the container, before the tour |
$post_id, $key, $url, $count |
epl_matterport_display_after |
Inside the container, after the tour |
$post_id, $key, $url, $count |
epl_matterport_container_after |
After the tour container |
$post_id, $urls |
// Heading above each tour.
add_action( 'epl_matterport_display_before', function () {
echo '<h3>3D Tour</h3>';
} );
Settings
| Filter |
What it changes |
epl_mp_settings_tab, epl_mp_buttons_tab, epl_mp_3d_view_tab |
The fields on each settings tab. |
epl_matterport_get_install_settings |
The default settings saved when the extension is activated. |
epl_mp_languages_directory |
The folder translations are loaded from. |
See also: Matterport Settings, [epl_matterport] Shortcode and Matterport FAQ and Troubleshooting.