skipv1_0_0values

The WordPress Core skip v1 0 values function.

Description

skip\v1_0_0\values( (string) $form_name ); 

Parameters (1)

0. $form_name (string)
The form name.

Usage

  1. if ( !function_exists( 'skip\v1_0_0\values' ) ) { 
  2. require_once '/includes/skip/elements/forms/values.php'; 
  3.  
  4. // The form name. 
  5. $form_name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = skip\v1_0_0\values($form_name); 
  9.  

Defined (1)

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

/includes/skip/elements/forms/values.php  
  1. function values( $form_name ) { 
  2. global $wpdb; 
  3.  
  4. $rows = $wpdb->get_results( $wpdb->prepare( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE %s ", 'skip_framework_value_' . $form_name . '%' ) ); 
  5.  
  6. $start_field = strlen( 'skip_framework_value_' . $form_name . '_' ); 
  7.  
  8. $values = array(); 
  9.  
  10. foreach( $rows AS $row ): 
  11. $values_new = array(); 
  12. $length_field = strlen( $row->option_name ); 
  13. $field_name = substr( $row->option_name, $start_field, $length_field ); 
  14. $fieldname_array = split( SKIP_DELIMITER, $field_name ); 
  15.  
  16. $values_new[ $fieldname_array[ 0 ] ] = _reconstruct_value( $fieldname_array, $row->option_value ); 
  17. $values = array_merge_recursive_distinct( $values, $values_new ); 
  18. endforeach; 
  19.  
  20. return $values;