{"id":2615333,"date":"2012-03-08T00:10:24","date_gmt":"2012-03-08T00:10:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-multiple-sidebars-adding-return-value-to-method-dynamic_sidebar\/"},"modified":"2016-08-20T05:27:03","modified_gmt":"2016-08-20T05:27:03","slug":"plugin-multiple-sidebars-adding-return-value-to-method-dynamic_sidebar","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-multiple-sidebars-adding-return-value-to-method-dynamic_sidebar\/","title":{"rendered":"[Plugin: Multiple Sidebars] Adding return value to method dynamic_sidebar()"},"content":{"rendered":"<p>I&#8217;ve played a bit with plugin and I am excited. <\/p>\n<p>I want suggest one small improvement. In the case a sidebar is defined in a post\/page but itself is set to status draft the method <code>$MultipleSidebars-&gt;is_active_sidebar()<\/code> returns true although no sidebar is shown. In this case it would be desirable to have a possibility to display a fallback sidebar.<br \/>\nThis could be reached if method <code>$MultipleSidebars-&gt;dynamic_sidebar()<\/code> returns a boolean value from the calls to the original WP function dynamic_sidebar(). As this call may executed multiple times in your method I use following modification:<\/p>\n<pre><code>$success = false;\n \/\/ ...\n $success = dynamic_sidebar($sidebar) ? true : $success;\n \/\/ ...\n return $success;<\/code><\/pre>\n<p>https:\/\/wordpress.org\/extend\/plugins\/multiple-sidebars\/<\/p>\n","protected":false},"template":"","class_list":["post-2615333","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2615333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2615333\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2615333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}