wp_embed_defaults example


    public function fetch( $provider$url$args = '' ) {
        $args = wp_parse_args( $argswp_embed_defaults( $url ) );

        $provider = add_query_arg( 'maxwidth', (int) $args['width']$provider );
        $provider = add_query_arg( 'maxheight', (int) $args['height']$provider );
        $provider = add_query_arg( 'url', urlencode( $url )$provider );
        $provider = add_query_arg( 'dnt', 1, $provider );

        /** * Filters the oEmbed URL to be fetched. * * @since 2.9.0 * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs. * * @param string $provider URL of the oEmbed provider. * @param string $url URL of the content to be embedded. * @param array $args Optional. Additional arguments for retrieving embed HTML. * See wp_oembed_get() for accepted arguments. Default empty. */

    public function get_embed_handler_html( $attr$url ) {
        $rawattr = $attr;
        $attr    = wp_parse_args( $attrwp_embed_defaults( $url ) );

        ksort( $this->handlers );
        foreach ( $this->handlers as $priority => $handlers ) {
            foreach ( $handlers as $id => $handler ) {
                if ( preg_match( $handler['regex']$url$matches ) && is_callable( $handler['callback'] ) ) {
                    $return = call_user_func( $handler['callback']$matches$attr$url$rawattr );
                    if ( false !== $return ) {
                        /** * Filters the returned embed HTML. * * @since 2.9.0 * * @see WP_Embed::shortcode() * * @param string|false $return The HTML result of the shortcode, or false on failure. * @param string $url The embed URL. * @param array $attr An array of shortcode attributes. */
Home | Imprint | This part of the site doesn't use cookies.