Extreme Minimized Version of Related Youtube Videos for Coders
-
Hi again,
I’m starting to get lost customizing all the plugins I’m using. regarding this plugin, I won’t be using all of the wonderful features it has to offer (like shortcodes, etc.), rather I will only be using the following code in my theme (hardcoded):
/* Load the "Related YouTube Videos" API class if it does not exist yet. */ if( !class_exists( 'RelatedYouTubeVideos_API' ) ) { $file = str_replace( '/', DIRECTORY_SEPARATOR, ABSPATH ) . 'lib' . DIRECTORY_SEPARATOR . 'RelatedYouTubeVidoes' . DIRECTORY_SEPARATOR . 'API.php'; if( file_exists( $file ) ) { include_once $file; } } /* Only continue if the API class could be loaded properly. */ if( class_exists( 'RelatedYouTubeVideos_API' ) ) { $RytvAPI = new RelatedYouTubeVideos_API(); /* Do your configuration */ $data = $RytvAPI->validateConfiguration( array( 'relation' => 'postTitle', 'max' => '3', 'width' => 150, 'height' => 150 ) ); /* Search YouTube. */ $results = $RytvAPI->searchYouTube( $data ); /* Create your very own custom HTML */ if( !empty( $results ) ) { foreach( $results as $video ) { $videoID = ( isset( $video['videoID'] ) ) ? $video['videoID'] : ''; $videoLink = ( $videoID !== '' ) ? 'https://www.youtube.com/watch?v=' . $videoID : 'javascript:void(0);'; echo '<a href="' . $videoLink . '"><img src="https://img.youtube.com/vi/' . $videoID . '/0.jpg" alt="" width="150" height="150" /></a>' . "\n"; } } }
I’m hoping to minimize the plugin as much as possible, so if I want to make changes (customizations like making the video thumbnails open in a lightbox, etc.), I will be able to navigate a smaller number of pages to find what code I’ll need to work with to achieve my desired results.
So, my question is: If all I will be using is the code above in my theme, is there a drastically smaller number of files I’ll only need?
I’m hoping you can tell me which files I’ll need to keep (or which files I can delete and still have the plugin work with the hardcoded code above).
This request may be expecting too much from you and if so I completely understand. Regardless, I thank you again for your wonderful contribution;
Dana
https://www.ads-software.com/plugins/related-youtube-videos/
- The topic ‘Extreme Minimized Version of Related Youtube Videos for Coders’ is closed to new replies.