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