|
@@ 988-999 (lines=12) @@
|
| 985 |
|
* @return mixed|void |
| 986 |
|
* @since 2.0 |
| 987 |
|
*/ |
| 988 |
|
public static function regex( $type, $options ) { |
| 989 |
|
self::field_loader( $type ); |
| 990 |
|
|
| 991 |
|
$regex = false; |
| 992 |
|
|
| 993 |
|
if ( method_exists( self::$loaded[ $type ], 'regex' ) ) |
| 994 |
|
$regex = self::$loaded[ $type ]->regex( $options ); |
| 995 |
|
|
| 996 |
|
$regex = apply_filters( 'pods_field_' . $type . '_regex', $regex, $options, $type ); |
| 997 |
|
|
| 998 |
|
return $regex; |
| 999 |
|
} |
| 1000 |
|
|
| 1001 |
|
/** |
| 1002 |
|
* Setup value preparation for sprintf |
|
@@ 1012-1023 (lines=12) @@
|
| 1009 |
|
* @return mixed|void |
| 1010 |
|
* @since 2.0 |
| 1011 |
|
*/ |
| 1012 |
|
public static function prepare( $type, $options ) { |
| 1013 |
|
self::field_loader( $type ); |
| 1014 |
|
|
| 1015 |
|
$prepare = '%s'; |
| 1016 |
|
|
| 1017 |
|
if ( method_exists( self::$loaded[ $type ], 'prepare' ) ) |
| 1018 |
|
$prepare = self::$loaded[ $type ]->prepare( $options ); |
| 1019 |
|
|
| 1020 |
|
$prepare = apply_filters( 'pods_field_' . $type . '_prepare', $prepare, $options, $type ); |
| 1021 |
|
|
| 1022 |
|
return $prepare; |
| 1023 |
|
} |
| 1024 |
|
|
| 1025 |
|
/** |
| 1026 |
|
* Validate a value before it's saved |