Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 3
level: 4
paths:
- wp-multi-network/includes
- wpmn-loader.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ public function create( $args, $assoc_args ) {

if ( ! empty( $clone_network ) && ! get_network( $clone_network ) ) {
WP_CLI::error( sprintf( "Clone network %s doesn't exist.", $clone_network ) );

if ( ! empty( $assoc_args['options_to_clone'] ) ) {
$options_to_clone = explode( ',', $assoc_args['options_to_clone'] );
}
}

$network_id = add_network(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
class WP_MS_Networks_Admin_Bar {

/**
* Constructor.
* Registers WordPress hooks for the plugin.
*
* Hooks in the necessary methods.
* Adds actions to:
* - Modify the admin bar menu
* - Add custom styles to the admin area
* - Add custom styles to the front-end
*
* @since 2.2.0
* @return void
*/
public function __construct() {
public function add_hooks(): void {
add_action( 'admin_bar_menu', array( $this, 'admin_bar' ), 20 );

add_action( 'admin_print_styles', array( $this, 'admin_print_styles' ) );
add_action( 'wp_print_styles', array( $this, 'admin_print_styles' ) );
}
Expand Down
4 changes: 3 additions & 1 deletion wp-multi-network/includes/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function wp_sanitize_site_path( $path = '' ) {
* @param string $domain Site domain.
* @param string $path Site path.
* @param string $site_id Optional. Site ID, if an existing site. Default 0.
*
* @return bool True if the site URL is valid, false otherwise.
*/
function wp_validate_site_url( $domain, $path, $site_id = '0' ) {
Expand All @@ -66,7 +67,8 @@ function wp_validate_site_url( $domain, $path, $site_id = '0' ) {
if ( (int) $exists === (int) $site_id ) {
return true;
}
if ( true === $exists ) {

if ( true === (bool) $exists ) {
return false;
}

Expand Down
1 change: 1 addition & 0 deletions wpmn-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ private function includes() {
$this->capabilities->add_hooks();

$this->admin_bar = new WP_MS_Networks_Admin_Bar();
$this->admin_bar->add_hooks();

if ( defined( 'WPMN_DEPRECATED' ) && ( true === WPMN_DEPRECATED ) ) {
require $this->plugin_dir . 'includes/deprecated.php';
Expand Down
Loading