Files
SIGE-WEB-snapshot/wp-content/plugins/aiovg-template-sige/aiovg-custom-templates.php

40 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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' );