wphooks.info - embed_oembed_html

embed_oembed_html

The hook occurs in the following 2 files

wp-includes/class-wp-embed.php:
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
					 *
					 * @since 2.9.0
					 *
					 * @see WP_Embed::shortcode()
					 *
					 * @param mixed  $cache   The cached HTML result, stored in post meta.
					 * @param string $url     The attempted embed URL.
					 * @param array  $attr    An array of shortcode attributes.
					 * @param int    $post_ID Post ID.
					 */
					return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
				}
			}

			/**
			 * Filters whether to inspect the given URL for discoverable link tags.
			 *
			 * @since 2.9.0
			 * @since 4.4.0 The default value changed to true.
			 *
wp-includes/class-wp-embed.php:
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
			if ( $html ) {
				update_post_meta( $post_ID, $cachekey, $html );
				update_post_meta( $post_ID, $cachekey_time, time() );
			} elseif ( ! $cache ) {
				update_post_meta( $post_ID, $cachekey, '{{unknown}}' );
			}

			// If there was a result, return it
			if ( $html ) {
				/** This filter is documented in wp-includes/class-wp-embed.php */
				return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
			}
		}

		// Still unknown
		return $this->maybe_make_link( $url );
	}

	/**
	 * Delete all oEmbed caches. Unused by core as of 4.0.0.