Tribe__Events__Community__Main::getTitle( string $action, string $post_type )
Get title for a page.
Contents
Parameters
- $post_type
-
(string) (Required) The post type being viewed.
- $action
-
(string) (Required) The action being performed.
Return
(string) The title.
Source
File: src/Tribe/Main.php
public function getTitle( $action, $post_type ) {
$i18n['delete'] = array(
Tribe__Events__Main::POSTTYPE => __( 'Remove an Event', 'tribe-events-community' ),
Tribe__Events__Main::VENUE_POST_TYPE => __( 'Remove a Venue', 'tribe-events-community' ),
Tribe__Events__Main::ORGANIZER_POST_TYPE => __( 'Remove an Organizer', 'tribe-events-community' ),
'unknown' => __( 'Unknown Post Type', 'tribe-events-community' ),
);
$i18n['default'] = array(
Tribe__Events__Main::POSTTYPE => __( 'Edit an Event', 'tribe-events-community' ),
Tribe__Events__Main::VENUE_POST_TYPE => __( 'Edit a Venue', 'tribe-events-community' ),
Tribe__Events__Main::ORGANIZER_POST_TYPE => __( 'Edit an Organizer', 'tribe-events-community' ),
'unknown' => __( 'Unknown Post Type', 'tribe-events-community' ),
);
if ( empty( $action ) || 'delete' !== $action ) {
$action = 'default';
}
/**
* Allow users to hook and change the Page Title for all the existing pages.
* Don't remove the 'unknown' key from the array
*/
$i18n = apply_filters( 'tribe_ce_i18n_page_titles', $i18n, $action, $post_type );
if ( ! empty( $i18n[ $action ][ $post_type ] ) ){
return $i18n[ $action ][ $post_type ];
} else {
return $i18n[ $action ]['unknown'];
}
}
Changelog
| Version | Description |
|---|---|
| 1.0 | Introduced. |