Fix for custom themes

This commit is contained in:
ruben- 2016-03-03 19:49:09 +01:00
parent 63aadab343
commit 1fee2ba8a1
3 changed files with 10 additions and 2 deletions

View file

@ -519,7 +519,6 @@ class MainWP_Child_Branding {
function custom_the_generator( $generator, $type = '' ) {
$extra_setting = $this->settings['extra_settings'];
error_log($type . "======" . print_r($extra_setting, true));
if ( isset( $extra_setting['site_generator'] ) ) {
if ( ! empty( $extra_setting['site_generator'] ) ) {
switch ( $type ) :

View file

@ -952,6 +952,7 @@ class MainWP_Child {
//Register does not require auth, so we register here..
if ( isset( $_POST['function'] ) && 'register' === $_POST['function'] ) {
define( 'DOING_CRON', true );
MainWP_Child::fix_for_custom_themes();
$this->registerSite();
}
@ -1010,9 +1011,11 @@ class MainWP_Child {
//Call the function required
if ( $auth && isset( $_POST['function'] ) && isset( $this->callableFunctions[ $_POST['function'] ] ) ) {
define( 'DOING_CRON', true );
MainWP_Child::fix_for_custom_themes();
call_user_func( array( $this, $this->callableFunctions[ $_POST['function'] ] ) );
} else if ( isset( $_POST['function'] ) && isset( $this->callableFunctionsNoAuth[ $_POST['function'] ] ) ) {
define( 'DOING_CRON', true );
MainWP_Child::fix_for_custom_themes();
call_user_func( array( $this, $this->callableFunctionsNoAuth[ $_POST['function'] ] ) );
}
@ -4421,4 +4424,10 @@ class MainWP_Child {
function skeleton_key() {
MainWP_Child_Skeleton_Key::Instance()->action();
}
static function fix_for_custom_themes() {
if ( file_exists( ABSPATH . '/wp-admin/includes/screen.php' ) ) {
include_once( ABSPATH . '/wp-admin/includes/screen.php' );
}
}
}