PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/fields/FrmFieldAddress.php +18 -9 6.34 → trunk View file →
@@ -36,18 +36,27 @@
36 36 * @param string $type
37 37 */
38 38 public function __construct( $field = 0, $type = '' ) {
39 39 parent::__construct( $field, $type );
40 + $this->register_sub_fields( self::get_part_labels() );
41 + }
40 42
41 - $this->register_sub_fields(
42 - array(
43 - 'line1' => __( 'Line 1', 'formidable' ),
44 - 'line2' => __( 'Line 2', 'formidable' ),
45 - 'city' => __( 'City', 'formidable' ),
46 - 'state' => __( 'State/Province', 'formidable' ),
47 - 'zip' => __( 'Zip/Postal', 'formidable' ),
48 - 'country' => __( 'Country', 'formidable' ),
49 - )
43 + /**
44 + * Gets the label for each part of an address, keyed by the value the part is
45 + * shown with in a shortcode, like [25 show=city].
46 + *
47 + * @since 6.35
48 + *
49 + * @return array
50 + */
51 + public static function get_part_labels() {
52 + return array(
53 + 'line1' => __( 'Line 1', 'formidable' ),
54 + 'line2' => __( 'Line 2', 'formidable' ),
55 + 'city' => __( 'City', 'formidable' ),
56 + 'state' => __( 'State/Province', 'formidable' ),
57 + 'zip' => __( 'Zip/Postal', 'formidable' ),
58 + 'country' => __( 'Country', 'formidable' ),
50 59 );
51 60 }
52 61
53 62 protected function field_settings_for_type() {