WordPress.org

Ready to get started?Download WordPress

Forums

access array inside widget api class (1 post)

  1. mikegoodstadt
    Member
    Posted 1 year ago #

    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,
    Mike

    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")
    			);

Topic Closed

This topic has been closed to new replies.

About this Topic