|
@@ 916-927 (lines=12) @@
|
| 913 |
|
* @return mixed|void |
| 914 |
|
* @since 2.0 |
| 915 |
|
*/ |
| 916 |
|
public static function regex( $type, $options ) { |
| 917 |
|
self::field_loader( $type ); |
| 918 |
|
|
| 919 |
|
$regex = false; |
| 920 |
|
|
| 921 |
|
if ( method_exists( self::$loaded[ $type ], 'regex' ) ) |
| 922 |
|
$regex = self::$loaded[ $type ]->regex( $options ); |
| 923 |
|
|
| 924 |
|
$regex = apply_filters( 'pods_field_' . $type . '_regex', $regex, $options, $type ); |
| 925 |
|
|
| 926 |
|
return $regex; |
| 927 |
|
} |
| 928 |
|
|
| 929 |
|
/** |
| 930 |
|
* Setup value preparation for sprintf |
|
@@ 940-951 (lines=12) @@
|
| 937 |
|
* @return mixed|void |
| 938 |
|
* @since 2.0 |
| 939 |
|
*/ |
| 940 |
|
public static function prepare( $type, $options ) { |
| 941 |
|
self::field_loader( $type ); |
| 942 |
|
|
| 943 |
|
$prepare = '%s'; |
| 944 |
|
|
| 945 |
|
if ( method_exists( self::$loaded[ $type ], 'prepare' ) ) |
| 946 |
|
$prepare = self::$loaded[ $type ]->prepare( $options ); |
| 947 |
|
|
| 948 |
|
$prepare = apply_filters( 'pods_field_' . $type . '_prepare', $prepare, $options, $type ); |
| 949 |
|
|
| 950 |
|
return $prepare; |
| 951 |
|
} |
| 952 |
|
|
| 953 |
|
/** |
| 954 |
|
* Validate a value before it's saved |