Tribe__Events__Pro__Main::oembed_discovery_links_for_recurring_events( string $output )
Outputs oembed resource links on the /all/ pages for recurring events
Contents
Parameters
- $output
-
(string) (Required) Resource links to output
Return
(string)
Source
File: src/Tribe/Main.php
public function oembed_discovery_links_for_recurring_events( $output ) {
$wp_query = tribe_get_global_query_object();
if ( $output ) {
return $output;
}
if ( ! tribe_is_showing_all() ) {
return $output;
}
if ( is_null( $wp_query ) || empty( $wp_query->posts[0] ) ) {
return $output;
}
$post = $wp_query->posts[0];
$post_id = $post->ID;
$output = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( add_query_arg( 'post_id', $post_id, get_permalink( $post_id ) ) ) ) . '" />' . "\n";
if ( class_exists( 'SimpleXMLElement' ) ) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( add_query_arg( 'post_id', $post_id, get_permalink( $post_id ) ), 'xml' ) ) . '" />' . "\n";
}
return $output;
}
Changelog
| Version | Description |
|---|---|
| 4.2 | Introduced. |