@@ 1012-1023 (lines=12) @@ | ||
1009 | * @return mixed|void |
|
1010 | * @since 2.0 |
|
1011 | */ |
|
1012 | public static function regex( $type, $options ) { |
|
1013 | self::field_loader( $type ); |
|
1014 | ||
1015 | $regex = false; |
|
1016 | ||
1017 | if ( method_exists( self::$loaded[ $type ], 'regex' ) ) |
|
1018 | $regex = self::$loaded[ $type ]->regex( $options ); |
|
1019 | ||
1020 | $regex = apply_filters( 'pods_field_' . $type . '_regex', $regex, $options, $type ); |
|
1021 | ||
1022 | return $regex; |
|
1023 | } |
|
1024 | ||
1025 | /** |
|
1026 | * Setup value preparation for sprintf |
|
@@ 1036-1047 (lines=12) @@ | ||
1033 | * @return mixed|void |
|
1034 | * @since 2.0 |
|
1035 | */ |
|
1036 | public static function prepare( $type, $options ) { |
|
1037 | self::field_loader( $type ); |
|
1038 | ||
1039 | $prepare = '%s'; |
|
1040 | ||
1041 | if ( method_exists( self::$loaded[ $type ], 'prepare' ) ) |
|
1042 | $prepare = self::$loaded[ $type ]->prepare( $options ); |
|
1043 | ||
1044 | $prepare = apply_filters( 'pods_field_' . $type . '_prepare', $prepare, $options, $type ); |
|
1045 | ||
1046 | return $prepare; |
|
1047 | } |
|
1048 | ||
1049 | /** |
|
1050 | * Validate a value before it's saved |