Use new code style
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
|
||||
namespace WP_Ultimo\Checkout\Signup_Fields;
|
||||
|
||||
use \WP_Ultimo\Checkout\Signup_Fields\Base_Signup_Field;
|
||||
use WP_Ultimo\Checkout\Signup_Fields\Base_Signup_Field;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
@ -32,8 +32,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function get_type() {
|
||||
|
||||
return 'site_title';
|
||||
|
||||
} // end get_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this field should be present on the checkout flow or not.
|
||||
@ -44,8 +43,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function is_required() {
|
||||
|
||||
return false;
|
||||
|
||||
} // end is_required;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines if this field/element is related to site creation or not.
|
||||
@ -56,8 +54,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function is_site_field() {
|
||||
|
||||
return true;
|
||||
|
||||
} // end is_site_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the title of the field/element type.
|
||||
@ -70,8 +67,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function get_title() {
|
||||
|
||||
return __('Site Title', 'wp-ultimo');
|
||||
|
||||
} // end get_title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the field/element.
|
||||
@ -84,8 +80,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a Site Title field. This value is used to set the site title for the site being created.', 'wp-ultimo');
|
||||
|
||||
} // end get_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tooltip of the field/element.
|
||||
@ -98,8 +93,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function get_tooltip() {
|
||||
|
||||
return __('Adds a Site Title field. This value is used to set the site title for the site being created.', 'wp-ultimo');
|
||||
|
||||
} // end get_tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the icon to be used on the selector.
|
||||
@ -112,8 +106,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
public function get_icon() {
|
||||
|
||||
return 'dashicons-wu-type';
|
||||
|
||||
} // end get_icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default values for the field-elements.
|
||||
@ -129,8 +122,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
return array(
|
||||
'auto_generate_site_title' => false,
|
||||
);
|
||||
|
||||
} // end defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of keys of the default fields we want to display on the builder.
|
||||
@ -145,8 +137,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
'placeholder',
|
||||
'tooltip',
|
||||
);
|
||||
|
||||
} // end default_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* If you want to force a particular attribute to a value, declare it here.
|
||||
@ -160,8 +151,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
'id' => 'site_title',
|
||||
'required' => true,
|
||||
);
|
||||
|
||||
} // end force_attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of additional fields specific to this type.
|
||||
@ -183,8 +173,7 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
} // end get_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the field/element actual field array to be used on the checkout form.
|
||||
@ -199,7 +188,6 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
* If we should auto-generate, add as hidden.
|
||||
*/
|
||||
if (isset($attributes['auto_generate_site_title']) && $attributes['auto_generate_site_title']) {
|
||||
|
||||
return array(
|
||||
'auto_generate_site_title' => array(
|
||||
'type' => 'hidden',
|
||||
@ -211,11 +199,10 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
'id' => 'site_title',
|
||||
'html_attr' => array(
|
||||
'v-bind:value' => 'username',
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
} // end if;
|
||||
}
|
||||
|
||||
return array(
|
||||
'site_title' => array(
|
||||
@ -233,7 +220,5 @@ class Signup_Field_Site_Title extends Base_Signup_Field {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
} // end to_fields_array;
|
||||
|
||||
} // end class Signup_Field_Site_Title;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user