Support » Plugins and Hacks » access array inside widget api class

  • I am writing a plugin which makes new widgets by extending the widget class as shown in the Widget API. I have an array, used to build a menu, which I want to access in “public function update”, “public function form” and my widget functions. But I can’t figure out clearly how to do this. So for now it is recreated in each function… Can anyone help me understand where to place this array to allow access through the widget code?
    Many thanks,

    Here is the array:

    $menu_array = array(
    			'Find' => array("surname", "bookmarks", "places", "anniversaries", "calendar", "cemeteries", "searchform", "famsearchform"),
    			'Media' => array("photos", "documents", "headstones", "histories", "recordings", "videos", "albums", "all"),
    			'Info' => array("whatsnew", "mostwanted", "reports", "statistics", "browsetrees", "browsenotes", "browsesources", "browserepos", "suggest")
  • The topic ‘access array inside widget api class’ is closed to new replies.