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

    (@tw2113)

    The BenchPresser

    Hi Joe.

    From the looks of it, the other plugin is using post meta to store the information about the video, and then very likely filtering the playable video in through a WordPress hook like the_content.

    The problem with this, as is, is that the regex we use to capture the urls is never going to have proper access to this value based on how it’s inserted.

    I’m certain it’s possible to come up with SOME way to handle it, but it’s going to be a specific use-case solution that may not fit everyone’s possible situation.

    Thread Starter joekarns

    (@joekarns)

    Thanks for that info. Would you consider custom coding this for me in exchange for a fee? I’m not sure how much work would go into something like this but if you’re interested in discussing this option, feel free to respond here or contact me on skype so we can chat: joe.karns

    Thanks!
    Joe

    Plugin Support Michael Beckwith

    (@tw2113)

    The BenchPresser

    So, I had this filter pointed out to me.

    $content = apply_filters( 'wds_featured_images_from_video_filter_content', $content );

    you should be able to do something like this, but fill in the spots that need it:

    function joe_custom_field_featured_image( $content ) {
    	$pid = get_the_ID();
    	$ytid = get_post_meta( $pid, 'PROVIDE META KEY', true );
    
    	if ( '' != $ytid ) {
    		return 'https://www.youtube.com/watch?v=' . $ytid;
    	}
    
    	return $content;
    }
    add_filter( 'wds_featured_images_from_video_filter_content', 'joe_custom_field_featured_image' );

    Essentially we’re hooking into the filter, and grabbing the current post ID being saved. Then, we use that ID to fetch the post meta that holds the youtube ID.

    If that meta key isn’t empty, we re-construct the youtube url because the regex used won’t like just the youtube ID at the moment, so full url it is.

    If there is not value saved yet, we just return the original content.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can this be customized to trigger by video category?’ is closed to new replies.