| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: F4 Post Tree |
| 5 |
Plugin URI: https://www.f4dev.ch |
| 6 |
Description: Adds a tree to the pages |
| 7 |
Version: 2.0.5 |
| 8 |
Author: FAKTOR VIER |
| 9 |
Author URI: https://www.f4dev.ch |
| 10 |
License: GPLv2 |
| 11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 12 |
Text Domain: f4-tree |
| 13 |
Domain Path: /languages*/ |
| 14 |
if ( !defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
define( 'F4_TREE_VERSION', '2.0.5' ); |
| 18 |
define( 'F4_TREE_SLUG', 'f4-tree' ); |
| 19 |
define( 'F4_TREE_MAIN_FILE', __FILE__ ); |
| 20 |
define( 'F4_TREE_BASENAME', plugin_basename( F4_TREE_MAIN_FILE ) ); |
| 21 |
define( 'F4_TREE_PATH', dirname( F4_TREE_MAIN_FILE ) . DIRECTORY_SEPARATOR ); |
| 22 |
define( 'F4_TREE_URL', plugins_url( '/', F4_TREE_MAIN_FILE ) ); |
| 23 |
define( 'F4_TREE_PLUGIN_FILE', basename( F4_TREE_BASENAME ) ); |
| 24 |
define( 'F4_TREE_PLUGIN_FILE_PATH', F4_TREE_PATH . F4_TREE_PLUGIN_FILE ); |
| 25 |
if ( function_exists( 'ft_tree_fs' ) ) { |
| 26 |
ft_tree_fs()->set_basename( false, __FILE__ ); |
| 27 |
} else { |
| 28 |
if ( !function_exists( 'ft_tree_fs' ) ) { |
| 29 |
// Create a helper function for easy SDK access. |
| 30 |
function ft_tree_fs() { |
| 31 |
global $ft_tree_fs; |
| 32 |
if ( !isset( $ft_tree_fs ) ) { |
| 33 |
// Include Freemius SDK. |
| 34 |
require_once dirname( __FILE__ ) . '/freemius/start.php'; |
| 35 |
$ft_tree_fs = fs_dynamic_init( array( |
| 36 |
'id' => '6913', |
| 37 |
'slug' => 'f4-tree', |
| 38 |
'premium_slug' => 'f4-tree-pro', |
| 39 |
'type' => 'plugin', |
| 40 |
'public_key' => 'pk_9fe9dc7631d539c9f0edd5ec059f2', |
| 41 |
'is_premium' => false, |
| 42 |
'premium_suffix' => 'PRO', |
| 43 |
'navigation' => 'tabs', |
| 44 |
'has_addons' => false, |
| 45 |
'has_paid_plans' => true, |
| 46 |
'menu' => array( |
| 47 |
'slug' => 'f4-tree-settings', |
| 48 |
'support' => false, |
| 49 |
'contact' => false, |
| 50 |
'pricing' => false, |
| 51 |
'parent' => array( |
| 52 |
'slug' => 'options-general.php', |
| 53 |
), |
| 54 |
), |
| 55 |
'is_live' => true, |
| 56 |
'is_org_compliant' => true, |
| 57 |
) ); |
| 58 |
} |
| 59 |
return $ft_tree_fs; |
| 60 |
} |
| 61 |
|
| 62 |
// Init Freemius. |
| 63 |
ft_tree_fs(); |
| 64 |
// Add plugin icon |
| 65 |
ft_tree_fs()->add_filter( 'plugin_icon', function () { |
| 66 |
return F4_TREE_PATH . 'assets/img/f4-tree.jpg'; |
| 67 |
} ); |
| 68 |
// Signal that SDK was initiated. |
| 69 |
do_action( 'ft_tree_fs_loaded' ); |
| 70 |
} |
| 71 |
} |
| 72 |
// Add autoloader |
| 73 |
spl_autoload_register( function ( $class ) { |
| 74 |
$class = ltrim( $class, '\\' ); |
| 75 |
$ns_prefix = 'F4\\TREE\\'; |
| 76 |
if ( strpos( $class, $ns_prefix ) !== 0 ) { |
| 77 |
return; |
| 78 |
} |
| 79 |
$class_name = str_replace( $ns_prefix, '', $class ); |
| 80 |
$class_path = 'modules' . DIRECTORY_SEPARATOR . str_replace( '\\', DIRECTORY_SEPARATOR, $class_name ); |
| 81 |
$class_file = F4_TREE_PATH . $class_path . '.php'; |
| 82 |
if ( file_exists( $class_file ) ) { |
| 83 |
require_once $class_file; |
| 84 |
} |
| 85 |
} ); |
| 86 |
// Init core |
| 87 |
F4\TREE\Core\Hooks::init(); |
| 88 |
// Init modules |
| 89 |
F4\TREE\Tree\Hooks::init(); |