Changeset 59118 for trunk/src/wp-includes/media.php
- Timestamp:
- 09/30/2024 03:17:31 AM (19 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r59008 r59118 5384 5384 global $wpdb; 5385 5385 5386 /** 5387 * Filters the attachment ID to allow short-circuit the function. 5388 * 5389 * Allows plugins to short-circuit attachment ID lookups. Plugins making 5390 * use of this function should return: 5391 * 5392 * - 0 (integer) to indicate the attachment is not found, 5393 * - attachment ID (integer) to indicate the attachment ID found, 5394 * - null to indicate WordPress should proceed with the lookup. 5395 * 5396 * Warning: The post ID may be null or zero, both of which cast to a 5397 * boolean false. For information about casting to booleans see the 5398 * {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. 5399 * Use the === operator for testing the post ID when developing filters using 5400 * this hook. 5401 * 5402 * @param int|null $post_id The result of the post ID lookup. Null to indicate 5403 * no lookup has been attempted. Default null. 5404 * @param string $url The URL being looked up. 5405 */ 5406 $post_id = apply_filters( 'pre_attachment_url_to_postid', null, $url ); 5407 if ( null !== $post_id ) { 5408 return (int) $post_id; 5409 } 5410 5386 5411 $dir = wp_get_upload_dir(); 5387 5412 $path = $url;
Note: See TracChangeset
for help on using the changeset viewer.