Skip to content

Commit

Permalink
0.7 Update wpframework.php
Browse files Browse the repository at this point in the history
  • Loading branch information
devuri authored Oct 27, 2024
1 parent 76da9f0 commit 681f632
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions public/content/mu-plugins/wpframework.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

/**
Expand All @@ -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');

0 comments on commit 681f632

Please sign in to comment.