ninja_forms_sidebar_sorter

The Ninja Forms ninja forms sidebar sorter function.

Description

ninja_forms_sidebar_sorter( $array, $sequence ); 

Parameters (2)

0. $array
The array.
1. $sequence
The sequence.

Usage

  1. if ( !function_exists( 'ninja_forms_sidebar_sorter' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/sidebar.php'; 
  3.  
  4. // The array. 
  5. $array = null; 
  6.  
  7. // The sequence. 
  8. $sequence = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_sidebar_sorter($array, $sequence); 
  12.  

Defined (1)

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

/deprecated/includes/admin/sidebar.php  
  1. function ninja_forms_sidebar_sorter($array, $sequence) { 
  2. $tmp = array(); 
  3. foreach($sequence as $s) { 
  4. foreach($array as $key => $a) { 
  5. $s = str_replace( 'ninja_forms_metabox_', '', $s ); 
  6. if($key == $s) { 
  7. $tmp[$key] = $a; 
  8. unset( $array[$key] ); 
  9. break; 
  10. if( is_array( $array ) AND !empty( $array ) ) { 
  11. foreach( $array as $key => $a ) { 
  12. $tmp[$key] = $a; 
  13.  
  14. return $tmp;