{"id":5735337,"date":"2015-01-31T12:01:26","date_gmt":"2015-01-31T12:01:26","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/programatically-adding-be-subpages-widget\/"},"modified":"2016-08-22T16:01:39","modified_gmt":"2016-08-22T16:01:39","slug":"programatically-adding-be-subpages-widget","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/programatically-adding-be-subpages-widget\/","title":{"rendered":"Programatically adding be-subpages-widget"},"content":{"rendered":"<p>Hey Bill,<\/p>\n<p>I was wondering if you help me out with what I imagine is a simple task although im miserably failing at it.<br \/>\nI need to add your widget programatically to my page. I&#8217;ve already have displaying on the page but I can&#8217;t figure out how to setup a few defaults, as defined usually on the widget configuration when added via Dashboard. More specifically, I was looking into displaying the parent page name as the widget title, one of the options available in the widget configuration.<\/p>\n<p>I looked into the <code>be_subpages_widget_title<\/code> filter but couldn&#8217;t make it do any difference in the rendered page.<\/p>\n<pre><code>function mw_widget_title( $title )\n{\n    $title = &quot;test&quot;;\n    return $title;\n}\nadd_filter( &#039;be_subpages_widget_title&#039;, &#039;mw_widget_title&#039; );<\/code><\/pre>\n<p>Thanks.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/be-subpages-widget\/<\/p>\n","protected":false},"template":"","class_list":["post-5735337","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5735337","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\/5735337\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5735337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}