Skip to content

Commit

Permalink
Merge pull request #1188 from publishpress/fix/#1187-Fatal-error-Unca…
Browse files Browse the repository at this point in the history
…ught-Error-Undefined-constant-MULTISITE

fix/#1187-Fatal-error-Uncaught-Error-Undefined-constant-MULTISITE
  • Loading branch information
olatechpro authored Oct 25, 2024
2 parents cc09907 + 7e87657 commit e9ad43e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
$pp_ui->show_capability_hints( $default );
}

if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
global $wp_roles;
global $wpdb;

Expand Down
4 changes: 2 additions & 2 deletions includes/handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function processAdminGeneral() {

// Save role changes. Already saved at start with self::saveRoleCapabilities()
} elseif ( ! empty($_POST['SaveRole']) && !empty($_POST['current'])) {
if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}

Expand Down Expand Up @@ -81,7 +81,7 @@ function processAdminGeneral() {
}
// Create New Capability and adds it to current role.
} elseif (!empty($_POST['AddCap']) && !empty($_POST['current']) && !empty($_POST['capability-name'])) {
if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}

Expand Down

0 comments on commit e9ad43e

Please sign in to comment.