From 681f6323c9b6863bc79ea45b09fdd04b3edae605 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sun, 27 Oct 2024 08:36:31 -0500 Subject: [PATCH] 0.7 Update wpframework.php --- public/content/mu-plugins/wpframework.php | 40 +++++++++-------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/public/content/mu-plugins/wpframework.php b/public/content/mu-plugins/wpframework.php index 483bc82..3507e55 100644 --- a/public/content/mu-plugins/wpframework.php +++ b/public/content/mu-plugins/wpframework.php @@ -4,7 +4,7 @@ * Plugin Name: WP-Framework Core * Plugin URI: https://github.com/devuri/wpframework * Description: Framework Core with `wpframework_init` hook. - * Version: 0.6 + * Version: 0.7 * Requires at least: 5.3.0 * Requires PHP: 7.3.5 * Author: uriel @@ -13,16 +13,16 @@ * Network: true */ -if ( ! \defined( 'ABSPATH' ) ) { +if (! \defined('ABSPATH')) { exit; } -if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) { +if (defined('WP_INSTALLING') && WP_INSTALLING) { return; } -if ( ! defined( 'APP_TENANT_ID' ) ) { - define( 'APP_TENANT_ID', null ); +if (! defined('APP_TENANT_ID')) { + define('APP_TENANT_ID', null); } /** @@ -31,32 +31,22 @@ * Must-use plugins are typically used for critical functionality or site-wide customizations * that should always be active which makes this hook a good place to add critical functionality */ -do_action( 'wpframework_init' ); +do_action('wpframework_init'); // custom theme directory. -if ( \defined( 'APP_THEME_DIR' ) ) { - register_theme_directory( APP_THEME_DIR ); +if (\defined('APP_THEME_DIR')) { + register_theme_directory(APP_THEME_DIR); } // Missing theme fix. -$theme_info = _framework_current_theme_info(); -if ( false === $theme_info['available'] ) { - $active_theme = wp_get_theme(); - WPframework\Terminate::exit( - [ $theme_info['error_message'] . ' -> ' . $active_theme->template ] - ); +$theme_info = frameworkCurrentThemeInfo(); +if (false === $theme_info['available']) { + exitWithThemeError($theme_info); } -if ( is_multitenant_app() ) { - // separate uploads for multi tenant. - add_filter( 'upload_dir', 'set_multitenant_upload_directory' ); +if (isMultitenantApp()) { + // separate uploads for multi tenant. + add_filter('upload_dir', 'setMultitenantUploadDirectory'); } -if ( env( 'WP_ENVIRONMENT_TYPE' ) && env( 'WPENV_AUTO_LOGIN_SECRET_KEY' ) ) { - WPframework\AutoLogin::init( - env( 'WPENV_AUTO_LOGIN_SECRET_KEY' ), - env( 'WP_ENVIRONMENT_TYPE' ) - ); -} - -add_filter( 'admin_footer_text', '_framework_footer_label' ); +add_filter('admin_footer_text', 'frameworkFooterLabel');