Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP count() warning #534

Merged
merged 1 commit into from
Oct 31, 2019
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
5 changes: 3 additions & 2 deletions edit_flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ private function __construct() {
}

private function setup_globals() {

$this->modules = new stdClass();

$this->modules_count = 0;
}

/**
Expand Down Expand Up @@ -296,6 +295,8 @@ public function register_module( $name, $args = array() ) {

$this->modules->$name = (object) $args;

$this->modules_count++;

/**
* Fires after edit_flow has registered a module.
*
Expand Down
10 changes: 5 additions & 5 deletions modules/settings/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,18 @@ function print_default_footer( $current_module ) {
<?php endif; ?>
<?php
}

function print_modules() {
global $edit_flow;
if ( !count( $edit_flow->modules ) ) {

if ( ! $edit_flow->modules_count ) {
echo '<div class="message error">' . __( 'There are no Edit Flow modules registered', 'edit-flow' ) . '</div>';
} else {

foreach ( $edit_flow->modules as $mod_name => $mod_data ) {
if ( $mod_data->autoload )
continue;

$classes = array(
'edit-flow-module',
);
Expand Down