pods_ui_access

Limit Access based on Field Value.

Description

pods_ui_access( $object, $access, $what ); 

Parameters (3)

0. $object
The object.
1. $access
The access.
2. $what
The what.

Usage

  1. if ( !function_exists( 'pods_ui_access' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/deprecated/deprecated.php'; 
  3.  
  4. // The object. 
  5. $object = null; 
  6.  
  7. // The access. 
  8. $access = null; 
  9.  
  10. // The what. 
  11. $what = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pods_ui_access($object, $access, $what); 
  15.  

Defined (1)

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

/deprecated/deprecated.php  
  1. function pods_ui_access ($object, $access, $what) { 
  2. pods_deprecated'pods_ui_access', '2.0'); 
  3. if (is_array($access)) { 
  4. foreach ($access as $field => $match) { 
  5. if (is_array($match)) { 
  6. $okay = false; 
  7. foreach ($match as $the_field => $the_match) { 
  8. if ($object->get_field($the_field) == $the_match) 
  9. $okay = true; 
  10. if (false === $okay) 
  11. return false; 
  12. elseif ($object->get_field($field) != $match) 
  13. return false; 
  14. return true;