Changeset 59700 for trunk/src/wp-includes/post.php
- Timestamp:
- 01/24/2025 01:30:27 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r59657 r59700 2477 2477 2478 2478 /** 2479 * Determines whether a post is embeddable. 2480 * 2481 * @since 6.8.0 2482 * 2483 * @param int|WP_Post|null $post Optional. Post ID or `WP_Post` object. Defaults to global $post. 2484 * @return bool Whether the post should be considered embeddable. 2485 */ 2486 function is_post_embeddable( $post = null ) { 2487 $post = get_post( $post ); 2488 2489 if ( ! $post ) { 2490 return false; 2491 } 2492 2493 $post_type = get_post_type_object( $post->post_type ); 2494 2495 if ( ! $post_type ) { 2496 return false; 2497 } 2498 2499 $is_embeddable = $post_type->embeddable; 2500 2501 /** 2502 * Filter whether a post is embeddable. 2503 * 2504 * @since 6.8.0 2505 * 2506 * @param bool $is_embeddable Whether the post is embeddable. 2507 * @param WP_Post $post Post object. 2508 */ 2509 return apply_filters( 'is_post_embeddable', $is_embeddable, $post ); 2510 } 2511 2512 /** 2479 2513 * Retrieves an array of the latest posts, or posts matching the given criteria. 2480 2514 *
Note: See TracChangeset
for help on using the changeset viewer.