Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

checking to see if no fields in section

  • Loading branch information...
commit 3e13528c121d87134b3c579e57290f2c573d01c2 1 parent e9095d8
@kovshenin authored
View
4 post-options-api-example-plugin/inc/post-options-api.1.0.1.php
@@ -350,6 +350,10 @@ function _meta_box_post_options( $post, $metabox ) {
$section = $this->sections[$section_id];
+ // Return if no fields defined
+ if ( empty( $this->options[$section_id] ) )
+ return;
+
// Sort the array by keys (priority)
ksort( $this->options[$section_id] );
View
4 post-options-api.php
@@ -350,6 +350,10 @@ function _meta_box_post_options( $post, $metabox ) {
$section = $this->sections[$section_id];
+ // Return if no fields defined
+ if ( empty( $this->options[$section_id] ) )
+ return;
+
// Sort the array by keys (priority)
ksort( $this->options[$section_id] );
Please sign in to comment.
Something went wrong with that request. Please try again.