| 1 |
<?php |
| 2 |
/** |
| 3 |
* The plugin bootstrap file |
| 4 |
* |
| 5 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 6 |
* admin area. This file also includes all of the dependencies used by the plugin |
| 7 |
* and defines a function that starts the plugin. |
| 8 |
* |
| 9 |
* @link https://easypodcastpro.com |
| 10 |
* @since 1.0.0 |
| 11 |
* @package Podcast_Player |
| 12 |
* |
| 13 |
* @wordpress-plugin |
| 14 |
* Plugin Name: podcast player |
| 15 |
* Plugin URI: https://easypodcastpro.com/podcast-player |
| 16 |
* Description: Host your podcast episodes anywhere, display them only using podcast feed url. Use custom widget or shortcode to display podcast player anywhere on your site. |
| 17 |
* Version: 8.3.2 |
| 18 |
* Author: vedathemes |
| 19 |
* Author URI: https://easypodcastpro.com |
| 20 |
* License: GPL-3.0+ |
| 21 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 22 |
* Text Domain: podcast-player |
| 23 |
* Domain Path: /lang |
| 24 |
*/ |
| 25 |
|
| 26 |
// If this file is called directly, abort. |
| 27 |
if ( ! defined( 'WPINC' ) ) { |
| 28 |
die; |
| 29 |
} |
| 30 |
|
| 31 |
// Currently plugin version. |
| 32 |
define( 'PODCAST_PLAYER_VERSION', '8.3.2' ); |
| 33 |
|
| 34 |
// Define plugin constants. |
| 35 |
define( 'PODCAST_PLAYER_DIR', plugin_dir_path( __FILE__ ) ); |
| 36 |
|
| 37 |
// Define plugin constants. |
| 38 |
define( 'PODCAST_PLAYER_URL', plugin_dir_url( __FILE__ ) ); |
| 39 |
|
| 40 |
// Define plugin constants. |
| 41 |
define( 'PODCAST_PLAYER_BASENAME', plugin_basename( __FILE__ ) ); |
| 42 |
|
| 43 |
// Register PHP autoloader. |
| 44 |
spl_autoload_register( |
| 45 |
function ( $clname ) { |
| 46 |
$namespace = 'Podcast_Player\\'; |
| 47 |
|
| 48 |
// Bail if the class is not in our namespace. |
| 49 |
if ( 0 !== strpos( $clname, $namespace ) ) { |
| 50 |
return; |
| 51 |
} |
| 52 |
|
| 53 |
// Get classname without namespace. |
| 54 |
$carray = array_values( explode( '\\', $clname ) ); |
| 55 |
$clast = count( $carray ) - 1; |
| 56 |
|
| 57 |
// Return if proper array is not available. (Just in case). |
| 58 |
if ( ! $clast ) { |
| 59 |
return; |
| 60 |
} |
| 61 |
|
| 62 |
// Prepend actual classname with 'class-' prefix. |
| 63 |
$carray[ $clast ] = 'class-' . $carray[ $clast ]; |
| 64 |
$clname = implode( '\\', $carray ); |
| 65 |
|
| 66 |
// Generate file path from classname. |
| 67 |
$path = strtolower( |
| 68 |
str_replace( |
| 69 |
array( $namespace, '_' ), |
| 70 |
array( '', '-' ), |
| 71 |
$clname |
| 72 |
) |
| 73 |
); |
| 74 |
|
| 75 |
// Build full filepath. |
| 76 |
$file = PODCAST_PLAYER_DIR . DIRECTORY_SEPARATOR . str_replace( '\\', DIRECTORY_SEPARATOR, $path ) . '.php'; |
| 77 |
|
| 78 |
// If the file exists for the class name, load it. |
| 79 |
if ( file_exists( $file ) ) { |
| 80 |
include $file; |
| 81 |
} |
| 82 |
} |
| 83 |
); |
| 84 |
|
| 85 |
add_action( |
| 86 |
'plugins_loaded', |
| 87 |
function () { |
| 88 |
// Register Podcast player front-end hooks. |
| 89 |
Podcast_Player\Frontend\Register::init(); |
| 90 |
|
| 91 |
// Register Podcast player back-end hooks. |
| 92 |
Podcast_Player\Backend\Register::init(); |
| 93 |
}, |
| 94 |
8 |
| 95 |
); |
| 96 |
|
| 97 |
// Load premium features (if exist). |
| 98 |
if ( file_exists( PODCAST_PLAYER_DIR . '/pp-pro/pp-pro.php' ) ) { |
| 99 |
require_once PODCAST_PLAYER_DIR . '/pp-pro/pp-pro.php'; |
| 100 |
} |
| 101 |
|