tribe_get_organizer_link( int $post_id = null, bool $full_link = true, bool $echo = false )
Organizer Page Link
Contents
Returns the event Organizer Name with a link to their single organizer page.
Parameters
- $post_id
-
(int) (Optional) Either event id or organizer id, if none specified, current post is used.
Default value: null
- $full_link
-
(bool) (Optional) If true outputs a complete HTML <a> link, otherwise only the URL is output.
Default value: true
- $echo
-
(bool) (Optional) Deprecated. If true, echo the link, otherwise return.
Default value: false
Return
(string) Organizer Name and Url
Source
File: src/functions/template-tags/organizer.php
function tribe_get_organizer_link( $postId = null, $full_link = true, $echo = false ) {
// As of TEC 4.0 this argument is deprecated
// If needed precede the call to this function with echo
if ( $echo != false ) _deprecated_argument( __FUNCTION__, '4.0' );
$org_id = tribe_get_organizer_id( $postId );
if ( class_exists( 'Tribe__Events__Pro__Main' ) && get_post_status( $org_id ) == 'publish' ) {
$url = esc_url_raw( get_permalink( $org_id ) );
if ( $full_link ) {
$name = tribe_get_organizer( $org_id );
$attr_title = the_title_attribute( array( 'post' => $org_id, 'echo' => false ) );
$link = ! empty( $url ) && ! empty( $name ) ? '<a href="' . esc_url( $url ) . '" title="'.$attr_title.'">' . $name . '</a>' : false;
} else {
$link = $url;
}
// Remove this in or before 5.x to fully deprecate the echo arg
if ( $echo ) {
echo apply_filters( 'tribe_get_organizer_link', $link, $postId, $echo, $url );
} else {
return apply_filters( 'tribe_get_organizer_link', $link, $postId, $full_link, $url );
}
}
//Return Organizer Name if Pro is not Active
return tribe_get_organizer( $org_id );
}