aiwoo_nav_menu_metabox

The metabox code.

Description

aiwoo_nav_menu_metabox( $object ); 

Parameters (1)

0. $object
The object.

Usage

  1. if ( !function_exists( 'aiwoo_nav_menu_metabox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-menu-extension/include/backend.inc.php'; 
  3.  
  4. // The object. 
  5. $object = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = aiwoo_nav_menu_metabox($object); 
  9.  

Defined (1)

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

/include/backend.inc.php  
  1. function aiwoo_nav_menu_metabox( $object ) 
  2. global $nav_menu_selected_id; 
  3.  
  4. $elems = array( '#aiwooshop#' => __( 'Shop' ), '#aiwoocart#' => __( 'Cart' ), '#aiwoobasket#' => __( 'Basket' ), '#aiwoologin#' => __( 'Log In' ), '#aiwoologout#' => __( 'Log Out' ), '#aiwoologinout#' => __( 'Log In' ).'|'.__( 'Log Out' ), '#aiwoocheckout#' => __( 'Checkout' ), '#aiwooterms#' => __( 'Terms' ), '#aiwoomyaccount#' => __( 'My Account' ), '#aiwoosearch#' => __( 'Search Product' ).'|'.__( 'Search' ) ); 
  5. class aiwoologItems { 
  6. public $ID = 0; 
  7. public $db_id = 0; 
  8. public $object = 'aiwoolog'; 
  9. public $object_id; 
  10. public $menu_item_parent = 0; 
  11. public $type = 'custom'; 
  12. public $title; 
  13. public $url; 
  14. public $target = ''; 
  15. public $attr_title = ''; 
  16. public $classes = array(); 
  17. public $xfn = ''; 
  18.  
  19. $elems_obj = array(); 
  20. foreach ( $elems as $value => $title ) { 
  21. $elems_obj[$title] = new aiwoologItems(); 
  22. $elems_obj[$title]->object_id = esc_attr( $value ); 
  23. $elems_obj[$title]->title = esc_attr( $title ); 
  24. $elems_obj[$title]->url = esc_attr( $value ); 
  25. $walker = new Walker_Nav_Menu_Checklist( array() ); 
  26. ?> 
  27. <div id="login-links" class="loginlinksdiv"> 
  28.  
  29. <div id="tabs-panel-login-links-all" class="tabs-panel tabs-panel-view-all tabs-panel-active"> 
  30. <ul id="login-linkschecklist" class="list:login-links categorychecklist form-no-clear"> 
  31. <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $elems_obj ), 0, (object)array( walker => $walker ) ); ?> 
  32. </ul> 
  33. </div> 
  34.  
  35. <p class="button-controls"> 
  36. <span class="list-controls hide-if-no-js"> 
  37. <a href="javascript:void(0);" class="help" onclick="jQuery( '#help-login-links' ).toggle();"><?php _e( 'Help' ); ?></a> 
  38. <span class="hide-if-js" id="help-login-links"><br /><a name="help-login-links"></a> 
  39. <?php 
  40. echo 'You can add a redirection page after the user\'s logout simply adding a relative link after the link\'s keyword, example <code>#aiwoologinout#index.php</code> or <code>#aiwoologout#index.php</code>.';  
  41. ?> 
  42. </span> 
  43. </span> 
  44. <span class="add-to-menu"> 
  45. <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-login-links-menu-item" id="submit-login-links" /> 
  46. <span class="spinner"></span> 
  47. </span> 
  48. </p> 
  49.  
  50. </div> 
  51. <?php