mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-05 09:19:53 +08:00
Fix for custom themes
This commit is contained in:
parent
63aadab343
commit
1fee2ba8a1
3 changed files with 10 additions and 2 deletions
|
@ -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 ) :
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue