• Resolved Mimicmusic

    (@mimicmusic)


    I have custom field for video that allows me to insert custom video without using text editor? Can i plug it in and just call the meta key of the video i set? Thanks

Viewing 1 replies (of 1 total)
  • Plugin Support Michael Beckwith

    (@tw2113)

    The BenchPresser

    I know we have the filter found on line 113 over at https://plugins.trac.www.ads-software.com/browser/automatic-featured-images-from-videos/tags/1.1.2/automatic-featured-images-from-videos.php#L110 that allows for changing the blob of content to search a video for.

     // Allow developers to filter the content to allow for searching in postmeta or other places.
    $content = apply_filters( 'wds_featured_images_from_video_filter_content', $content, $post_id );
    

    Basically you’d want to just do something like this:

    function mimicmusic_afifv_meta_search( $content, $post_id ) {
        // Fetch and retrieve our meta, return if the field isn't empty.
        $meta = get_post_meta( $post_id, 'my_field', true );
        if ( ! empty( $meta ) ) {
            return $meta;
        }
        // If we had no value, just return the original.
        return $content;
    }
    add_filter( 'wds_featured_images_from_video_filter_content', 'mimicmusic_afifv_meta_search', 10, 2 );
    

    Grab any post meta you have, return that and it’ll be searched for the URL, otherwise the post content will be instead.

Viewing 1 replies (of 1 total)
  • The topic ‘Meta Key Allowed?’ is closed to new replies.