WPCOM_JSON_API_Menus_Widgets

The Jetpack by WordPress.com WPCOM JSON API Menus Widgets class.

Defined (1)

The class is defined in the following location(s).

/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php  
  1. class WPCOM_JSON_API_Menus_Widgets { 
  2. static function get() { 
  3. $locations = array(); 
  4. $nav_menu_widgets = get_option( 'widget_nav_menu' ); 
  5.  
  6. if ( ! is_array( $nav_menu_widgets ) ) { 
  7. return $locations; 
  8.  
  9. foreach ( $nav_menu_widgets as $k => $v ) { 
  10. if ( is_array( $v ) && isset( $v['title'] ) ) { 
  11. $locations[$k] = array( 'name' => 'nav_menu_widget-' . $k, 'description' => $v['title'] ); 
  12.  
  13. return $locations;