@@ 965-976 (lines=12) @@ | ||
962 | * @return mixed|void |
|
963 | * @since 2.0 |
|
964 | */ |
|
965 | public static function regex( $type, $options ) { |
|
966 | self::field_loader( $type ); |
|
967 | ||
968 | $regex = false; |
|
969 | ||
970 | if ( method_exists( self::$loaded[ $type ], 'regex' ) ) |
|
971 | $regex = self::$loaded[ $type ]->regex( $options ); |
|
972 | ||
973 | $regex = apply_filters( 'pods_field_' . $type . '_regex', $regex, $options, $type ); |
|
974 | ||
975 | return $regex; |
|
976 | } |
|
977 | ||
978 | /** |
|
979 | * Setup value preparation for sprintf |
|
@@ 989-1000 (lines=12) @@ | ||
986 | * @return mixed|void |
|
987 | * @since 2.0 |
|
988 | */ |
|
989 | public static function prepare( $type, $options ) { |
|
990 | self::field_loader( $type ); |
|
991 | ||
992 | $prepare = '%s'; |
|
993 | ||
994 | if ( method_exists( self::$loaded[ $type ], 'prepare' ) ) |
|
995 | $prepare = self::$loaded[ $type ]->prepare( $options ); |
|
996 | ||
997 | $prepare = apply_filters( 'pods_field_' . $type . '_prepare', $prepare, $options, $type ); |
|
998 | ||
999 | return $prepare; |
|
1000 | } |
|
1001 | ||
1002 | /** |
|
1003 | * Validate a value before it's saved |