From 3f6933ffa2308a5c128016b9cadb4d5314d73efc Mon Sep 17 00:00:00 2001 From: Landon Otis Date: Wed, 4 Mar 2020 22:35:24 -0800 Subject: [PATCH] Added ability to skip iteration for empty section to prevent add_settings_section. --- includes/class-ot-settings.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-ot-settings.php b/includes/class-ot-settings.php index 69d7664..5984c6c 100755 --- a/includes/class-ot-settings.php +++ b/includes/class-ot-settings.php @@ -390,6 +390,10 @@ public function add_sections() { // Loop through page sections. foreach ( (array) $this->get_sections( $page ) as $section ) { + if ( empty( $section ) ) { + continue; + } + // Add each section. add_settings_section( $section['id'],