| @@ -42,8 +42,15 @@ | ||
| 42 | 42 | */ |
| 43 | 43 | public static $cf_types; |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | + * Default Custom field type | |
| 47 | + * | |
| 48 | + * @var array | |
| 49 | + */ | |
| 50 | + public static $default_cf_types; | |
| 51 | + | |
| 52 | + /** | |
| 46 | 53 | * Custom fields with slug indexing. |
| 47 | 54 | * |
| 48 | 55 | * @var array |
| 49 | 56 | */ |
| @@ -69,9 +76,9 @@ | ||
| 69 | 76 | // Get object of this class. |
| 70 | 77 | add_filter( 'wpsc_load_ref_classes', array( __CLASS__, 'load_ref_class' ) ); |
| 71 | 78 | |
| 72 | 79 | // Set custom field types. |
| 73 | - add_action( 'init', array( __CLASS__, 'set_cf_types' ) ); | |
| 80 | + add_action( 'init', array( __CLASS__, 'set_all_cf_types' ) ); | |
| 74 | 81 | } |
| 75 | 82 | |
| 76 | 83 | /** |
| 77 | 84 | * Apply schema for this model |
| @@ -653,8 +660,25 @@ | ||
| 653 | 660 | public function create_customer_tbl_col() { |
| 654 | 661 | |
| 655 | 662 | global $wpdb; |
| 656 | 663 | return $wpdb->query( "ALTER TABLE {$wpdb->prefix}psmsc_customers ADD {$this->slug} {$this->type::$data_type}" ); |
| 664 | + } | |
| 665 | + | |
| 666 | + /** | |
| 667 | + * Set all custom field types | |
| 668 | + */ | |
| 669 | + public static function set_all_cf_types() { | |
| 670 | + | |
| 671 | + self::set_default_cf_types(); | |
| 672 | + self::set_cf_types(); | |
| 673 | + } | |
| 674 | + | |
| 675 | + /** | |
| 676 | + * Set default custom field types | |
| 677 | + */ | |
| 678 | + public static function set_default_cf_types() { | |
| 679 | + | |
| 680 | + self::$default_cf_types = apply_filters( 'wpsc_default_cf_types', array() ); | |
| 657 | 681 | } |
| 658 | 682 | |
| 659 | 683 | /** |
| 660 | 684 | * Set custom field types |