PluginProbe
CubeWP Framework / trunk
CubeWP Framework vtrunk
trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.8-beta1 1.0.9 1.1.0 1.1.1 1.1.10 All 57 releases
cubewp-framework / cube.php

cube.php in CubeWP Framework trunk, at cube.php

85 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: CubeWP Framework
4 * Plugin URI: https://cubewp.com/
5 * Description: CubeWP is an end-to-end dynamic content framework for WordPress to help you save up to 90% of your coding time.
6 * Version: 1.1.31
7 * Author: CubeWP
8 * Author URI: https://cubewp.com
9 * Text Domain: cubewp-framework
10 * Domain Path: /languages/
11 * License: GPLv2 or later
12 * @package Cubewp
13 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals
15 // Exit if accessed directly.
16 if ( !defined( 'ABSPATH' ) )
17 exit;
18
19 if ( !defined( 'CUBEWP' ) ) {
20 define( 'CUBEWP', 'CubeWp' );
21 }
22
23 /* CWP_PLUGIN_PATH Defines for load Php files */
24 if ( !defined( 'CWP_PLUGIN_PATH' ) ) {
25 define( 'CWP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
26 define( 'CUBEWP_FILES', plugin_dir_path( __FILE__ ).'/cube/' );
27 define( 'CUBEWP_CLASSES', plugin_dir_path( __FILE__ ).'/cube/classes/' );
28 }
29
30 /* CWP_PLUGIN_URI Defines for load JS and CSS files */
31 if ( !defined( 'CWP_PLUGIN_URI' ) ) {
32 define( 'CWP_PLUGIN_URI', plugin_dir_url( __FILE__ ) );
33 }
34
35 /* CUBEWP_POST_CARD_PATH Defines Cubewp Post cards path */
36 /* CUBEWP_POST_CARDS_URL Defines Cubewp Post cards URL */
37 if (! defined('CUBEWP_POST_CARDS_DIR')) {
38 $upload_dir = wp_upload_dir();
39 define('CUBEWP_POST_CARDS_DIR', $upload_dir['basedir'] . '/cubewp-post-cards');
40 // Ensure correct protocol based on current request
41 $current_scheme = is_ssl() ? 'https' : 'http';
42 $baseurl = preg_replace('/^https?:/', $current_scheme . ':', $upload_dir['baseurl']);
43 define('CUBEWP_POST_CARDS_URL', $baseurl . '/cubewp-post-cards');
44 }
45
46 /* CWP_PLUGIN_FILE Defines for file access */
47 if ( !defined( 'CWP_PLUGIN_FILE' ) ) {
48 define( 'CWP_PLUGIN_FILE', __FILE__ );
49 }
50
51 spl_autoload_register( 'CWP_autoload_classes' );
52
53
54 /**
55 * All CubeWP classes files to be loaded automatically.
56 * @param string $className a class name
57 * @since 1.0.0
58 */
59 function CWP_autoload_classes( $className ) {
60
61 // If class does not start with our prefix ( CubeWp ), nothing will return.
62 if ( false === strpos( $className, 'CubeWp' ) ) {
63 return null;
64 }
65 $file_name = 'class-' .str_replace( '_', '-', strtolower( $className ) ).'.php';
66 $file = CUBEWP_CLASSES.$file_name;
67
68 // Checking if exists then include.
69 if ( file_exists( $file ) ) {
70 require $file;
71 }
72 return;
73 }
74
75 /**
76 * Class CubeWp_Load: Loads CubeWP plugin configurations.
77 *
78 * @since 1.0
79 */
80
81 function CWP() {
82 return CubeWp_Load::instance();
83 }
84 CWP();
85