aioseop_ajax_get_menu_links

The All In One SEO Pack aioseop ajax get menu links function.

Description

aioseop_ajax_get_menu_links(); 

Usage

  1. if ( !function_exists( 'aioseop_ajax_get_menu_links' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/aioseop_functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = aioseop_ajax_get_menu_links(); 
  7.  

Defined (1)

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

/inc/aioseop_functions.php  
  1. function aioseop_ajax_get_menu_links() { 
  2. $options = Array(); 
  3. parse_str( $_POST['options'], $options ); 
  4. $_POST = $options; 
  5. $_POST['action'] = 'aiosp_update_module'; 
  6. global $aiosp, $aioseop_modules; 
  7. $aiosp->admin_menu(); 
  8. if ( empty( $_POST['location'] ) ) { 
  9. $_POST['location'] = null; 
  10. $_POST['Submit'] = 'ajax'; 
  11. $modlist = $aioseop_modules->get_loaded_module_list(); 
  12. $links = Array(); 
  13. $link_list = Array(); 
  14. $link = $aiosp->get_admin_links(); 
  15. if ( ! empty( $link ) ) { 
  16. foreach ( $link as $l ) { 
  17. if ( ! empty( $l ) ) { 
  18. if ( empty( $link_list[ $l['order'] ] ) ) { 
  19. $link_list[ $l['order'] ] = Array(); 
  20. $link_list[ $l['order'] ][ $l['title'] ] = $l['href']; 
  21. if ( ! empty( $modlist ) ) { 
  22. foreach ( $modlist as $k => $v ) { 
  23. $mod = $aioseop_modules->return_module( $v ); 
  24. if ( is_object( $mod ) ) { 
  25. $mod->add_page_hooks(); 
  26. $link = $mod->get_admin_links(); 
  27. foreach ( $link as $l ) { 
  28. if ( ! empty( $l ) ) { 
  29. if ( empty( $link_list[ $l['order'] ] ) ) { 
  30. $link_list[ $l['order'] ] = Array(); 
  31. $link_list[ $l['order'] ][ $l['title'] ] = $l['href']; 
  32. if ( ! empty( $link_list ) ) { 
  33. ksort( $link_list ); 
  34. foreach ( $link_list as $ll ) { 
  35. foreach ( $ll as $k => $v ) { 
  36. $links[ $k ] = $v; 
  37. $output = '<ul>'; 
  38. if ( ! empty( $links ) ) { 
  39. foreach ( $links as $k => $v ) { 
  40. if ( $k === 'Feature Manager' ) { 
  41. $current = ' class="current"'; 
  42. } else { 
  43. $current = ''; 
  44. $output .= "<li{$current}><a href='" . esc_url( $v ) . "'>" . esc_attr( $k ) . '</a></li>'; 
  45. $output .= '</ul>'; 
  46. die( sprintf( "jQuery('{$_POST['target']}').fadeOut('fast', function() {jQuery('{$_POST['target']}').html('%s').fadeIn('fast');});", addslashes( $output ) ) );