Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: embed_oembed_html

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
219                           * @since 2.9.0
220                           *
221                           * @see WP_Embed::shortcode()
222                           *
223                           * @param mixed  $cache   The cached HTML result, stored in post meta.
224                           * @param string $url     The attempted embed URL.
225                           * @param array  $attr    An array of shortcode attributes.
226                           * @param int    $post_ID Post ID.
227                           */
228                          return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
229                     }
230                }
231
232                /**
233                 * Filter whether to inspect the given URL for discoverable link tags.
234                 *
235                 * @since 2.9.0
236                 * @since 4.4.0 The default value changed to true.
237                 *
 
Line Code
249                     update_post_meta( $post_ID, $cachekey, $html );
250                     update_post_meta( $post_ID, $cachekey_time, time() );
251                } elseif ( ! $cache ) {
252                     update_post_meta( $post_ID, $cachekey, '{{unknown}}' );
253                }
254
255                // If there was a result, return it
256                if ( $html ) {
257                     /** This filter is documented in wp-includes/class-wp-embed.php */
258                     return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
259                }
260           }
261
262           // Still unknown
263           return $this->maybe_make_link( $url );
264      }
265
266      /**
267       * Delete all oEmbed caches. Unused by core as of 4.0.0.