Changeset 3284341
- Timestamp:
- 04/29/2025 06:38:46 PM (8 months ago)
- Location:
- rest-api-post-embeds/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
rest-api-post-embeds.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rest-api-post-embeds/trunk/readme.txt
r3281569 r3284341 2 2 Contributors: jeherve 3 3 Tags: shortcode, embed, posts, jetpack, api 4 Stable tag: 1.5. 14 Stable tag: 1.5.2 5 5 Requires at least: 5.6 6 6 Tested up to: 6.8 … … 141 141 == Changelog == 142 142 143 = 1.5.2 = 144 Release Date: April 29, 2025 145 146 * Featured Image: fix issue where featured image was not displayed in some site configurations. 147 143 148 = 1.5.1 = 144 149 Release Date: April 25, 2025 -
rest-api-post-embeds/trunk/rest-api-post-embeds.php
r3281569 r3284341 5 5 * Description: Embed posts from your site or others' into your posts and pages. 6 6 * Author: Jeremy Herve 7 * Version: 1.5. 17 * Version: 1.5.2 8 8 * Author URI: https://jeremy.hu 9 9 * License: GPL2+ … … 359 359 $featured_image_url = $this->get_wpapi_featured_image( $post->featured_media, $atts ); 360 360 361 if ( empty( $featured_image_url ) ) { 362 continue; 361 if ( ! empty( $featured_image_url ) ) { 362 $article .= sprintf( 363 '<div class="post-embed-post-thumbnail"><a title="%1$s" href="%2$s"><img src="%3$s" alt="%1$s"/></a></div>', 364 esc_attr( $post_title ), 365 esc_url( $post->link ), 366 /** This filter is documented in rest-api-post-embeds.php */ 367 apply_filters( 'jeherve_post_embed_featured_image', esc_url( $featured_image_url ), $atts ) 368 ); 363 369 } 364 365 $article .= sprintf(366 '<div class="post-embed-post-thumbnail"><a title="%1$s" href="%2$s"><img src="%3$s" alt="%1$s"/></a></div>',367 esc_attr( $post_title ),368 esc_url( $post->link ),369 /** This filter is documented in rest-api-post-embeds.php */370 apply_filters( 'jeherve_post_embed_featured_image', esc_url( $featured_image_url ), $atts )371 );372 370 } 373 371 … … 574 572 public function get_wpapi_featured_image( $featured_id, $atts ) { 575 573 if ( ! $atts || ! $featured_id ) { 576 return ;574 return ''; 577 575 } 578 576 … … 587 585 // If no post ID, let's stop right there. 588 586 if ( ! $blog_id ) { 589 return ;587 return ''; 590 588 } 591 589 … … 600 598 $featured_query_hash = substr( md5( $featured_query_url ), 0, 21 ); 601 599 } else { 602 return ;600 return ''; 603 601 } 604 602 … … 627 625 if ( ! is_wp_error( $featured_response ) ) { 628 626 $featured_info = json_decode( $featured_response, true ); 629 $featured_url = $featured_info[' guid']['rendered'];630 } else { 631 return ;627 $featured_url = $featured_info['source_url']; 628 } else { 629 return ''; 632 630 } 633 631
Note: See TracChangeset
for help on using the changeset viewer.