40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
||
/*
|
||
* Plugin Name: AIOVG – Custom Templates
|
||
* Plugin URI: https://plugins360.com
|
||
* Description: This plugin replaces default All-in-One Video Gallery plugin public/templates/videos-template-classic.php file with videos-template-classic.php file inside this plugin directory.
|
||
* Author: Team Plugins360
|
||
*/
|
||
|
||
// Exit if accessed directly
|
||
if ( ! defined( 'WPINC' ) ) {
|
||
die;
|
||
}
|
||
|
||
function aiovg_custom_videos_template( $tpl )
|
||
{
|
||
// $tpl is an absolute path to a file, for example
|
||
// ../public_html/wp-content/plugins/all-in-one-video-gallery/public/templates/videos-template-classic.php
|
||
|
||
$basename = basename( $tpl );
|
||
// $basename is just a filename for example videos-template-classic.php
|
||
|
||
if ( 'single-video.php' == $basename )
|
||
{
|
||
// return path to videos-template-classic.php file in aiovg-custom-templates directory
|
||
return dirname( __FILE__ ) . '/single-video.php';
|
||
}
|
||
else
|
||
{
|
||
if ( 'video-thumbnail-image-left.php' == $basename )
|
||
{
|
||
return dirname( __FILE__ ) . '/video-thumbnail-image-left.php';
|
||
}
|
||
else
|
||
{
|
||
return $tpl;
|
||
}
|
||
}
|
||
}
|
||
|
||
add_filter( 'aiovg_load_template', 'aiovg_custom_videos_template' ); |