RWMB_Field::call PHP Method

call() public static method

This should be replaced by static::$method( $args ) in PHP 5.3.
public static call ( ) : mixed
return mixed
	public static function call() {
		$args = func_get_args();

		$check = reset( $args );

		// Params: method name, field, other params.
		if ( is_string( $check ) ) {
			$method = array_shift( $args );
			$field  = reset( $args ); // Keep field as 1st param
		} // End if().
		else {
			$field  = array_shift( $args );
			$method = array_shift( $args );
			$args[] = $field; // Add field as last param
		}

		return call_user_func_array( array( self::get_class_name( $field ), $method ), $args );
	}

Usage Example

Exemplo n.º 1
0
 /**
  * @see Walker::start_el()
  *
  * @param string $output            Passed by reference. Used to append additional content.
  * @param object $object            Item data object.
  * @param int    $depth             Depth of item.
  * @param int    $current_object_id Item ID.
  * @param array  $args
  */
 public function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $label = $this->db_fields['label'];
     $id = $this->db_fields['id'];
     $attributes = RWMB_Field::call('get_attributes', $this->field, $object->{$id});
     $output .= sprintf('<li><label><input %s %s>%s</label>', RWMB_Field::render_attributes($attributes), checked(in_array($object->{$id}, $this->meta), 1, false), $object->{$label});
 }
All Usage Examples Of RWMB_Field::call