Changeset 59700 for trunk/src/wp-includes/embed.php
- Timestamp:
- 01/24/2025 01:30:27 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/embed.php
r59493 r59700 332 332 * 333 333 * @since 4.4.0 334 * @since 6.8.0 Output was adjusted to only embed if the post supports it. 334 335 */ 335 336 function wp_oembed_add_discovery_links() { 336 337 $output = ''; 337 338 338 if ( is_singular() ) {339 if ( is_singular() && is_post_embeddable() ) { 339 340 $output .= '<link rel="alternate" title="' . _x( 'oEmbed (JSON)', 'oEmbed resource link name' ) . '" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 340 341 … … 539 540 * 540 541 * @since 4.4.0 542 * @since 6.8.0 Output was adjusted to only embed if the post type supports it. 541 543 * 542 544 * @param WP_Post|int $post Post ID or post object. 543 545 * @param int $width The requested width. 544 * @return array|false Response data on success, false if post doesn't exist 545 * or is not publicly viewable.546 * @return array|false Response data on success, false if post doesn't exist, 547 * is not publicly viewable or post type is not embeddable. 546 548 */ 547 549 function get_oembed_response_data( $post, $width ) { … … 554 556 555 557 if ( ! is_post_publicly_viewable( $post ) ) { 558 return false; 559 } 560 561 if ( ! is_post_embeddable( $post ) ) { 556 562 return false; 557 563 }
Note: See TracChangeset
for help on using the changeset viewer.