Skip to content

Commit

Permalink
refactored theme.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nadimtuhin committed Oct 20, 2015
1 parent 9ac05db commit 5ac6581
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions theme.php
Original file line number Diff line number Diff line change
@@ -1,55 +1,7 @@
<?php
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}

if ( ! defined( 'ONEPAGER_VERSION' ) ) {
define( 'ONEPAGER_VERSION', '1.2.3.3' );
}

if ( ! defined( 'ONEPAGER_PHP_VERSION' ) ) {
define( 'ONEPAGER_PHP_VERSION', '5.4' );
}

if ( ! defined( 'ONEPAGER_URL' ) ) {
define( 'ONEPAGER_URL', get_stylesheet_directory_uri()."/tx-onepager" );
}

require( __DIR__ . "/constants.php" );

function onepager_php_version_check() {
if ( ! version_compare( PHP_VERSION, ONEPAGER_PHP_VERSION, '<' ) ) {
return;
}

$notice =
'You are running ancient version of PHP-<strong>%s</strong>.
Onepager requires at least PHP <strong>%s</strong> to run smoothly.
<br/>Please update your PHP version to run this plugin and keep you website secure.';

wp_die( sprintf( $notice, PHP_VERSION, ONEPAGER_PHP_VERSION ) );
}

onepager_php_version_check();


require( ONEPAGER_PATH . '/app/inc/support.php' );
require( ONEPAGER_PATH . '/src/functions.php' );
require( ONEPAGER_PATH . '/src/theme_helpers.php' );
require( ONEPAGER_PATH . '/vendor/autoload.php' );

require( ONEPAGER_PATH . '/app/Onepager.php' );
require( ONEPAGER_PATH . '/app/bootstrap.php' );

require( ONEPAGER_PATH . '/app/Api/routes.php' );
require( ONEPAGER_PATH . '/app/OptionsPanel/settings.php' );
require( ONEPAGER_PATH . '/app/Metabox/metabox.php' );


add_action( 'wp_head', 'print_onepager_meta' );
function print_onepager_meta() {
echo "<meta type='page-builder' content='tx-onepager'>";
}

do_action( 'onepager_loaded' );
require( __DIR__ . "/tx-onepager.php" );

0 comments on commit 5ac6581

Please sign in to comment.