Everywhere yoda conditions are
This commit is contained in:
inc
admin-pages
class-base-admin-page.phpclass-base-customer-facing-admin-page.phpclass-broadcast-edit-admin-page.phpclass-broadcast-list-admin-page.phpclass-checkout-form-edit-admin-page.phpclass-discount-code-edit-admin-page.phpclass-domain-edit-admin-page.phpclass-edit-admin-page.phpclass-email-edit-admin-page.phpclass-event-view-admin-page.phpclass-list-admin-page.phpclass-membership-edit-admin-page.phpclass-payment-edit-admin-page.phpclass-product-edit-admin-page.phpclass-settings-admin-page.phpclass-setup-wizard-admin-page.phpclass-site-edit-admin-page.phpclass-site-list-admin-page.phpclass-system-info-admin-page.phpclass-view-logs-admin-page.phpclass-webhook-edit-admin-page.php
customer-panel
api
checkout
class-cart.phpclass-checkout-pages.phpclass-checkout.phpclass-legacy-checkout.phpclass-line-item.php
class-ajax.phpclass-api.phpclass-async-calls.phpclass-dashboard-widgets.phpclass-domain-mapping.phpclass-geolocation.phpclass-logger.phpclass-requirements.phpclass-session-cookie.phpclass-settings.phpclass-sunrise.phpclass-user-switching.phpsignup-fields
class-base-signup-field.phpclass-signup-field-checkbox.phpclass-signup-field-order-summary.phpclass-signup-field-period-selection.phpclass-signup-field-pricing-table.phpclass-signup-field-products.phpclass-signup-field-shortcode.phpclass-signup-field-site-url.phpclass-signup-field-steps.phpclass-signup-field-template-selection.php
field-templates
compat
country
database
checkout-forms
discount-codes
domains
engine
events
memberships
payments
posts
products
sites
webhooks
debug
deprecated
development
domain-mapping
duplication
functions
array-helpers.phpcheckout-form.phpcheckout.phpcustomer.phpdate.phpdiscount-code.phpdomain.phpevent.phpfs.phpgateway.phphelper.phplegacy.phpmarkup-helpers.phpmembership.phpmodel.phppages.phppayment.phpproduct.phprest.phpsettings.phpsite.phptax.php
gateways
class-base-gateway.phpclass-base-stripe-gateway.phpclass-free-gateway.phpclass-manual-gateway.phpclass-paypal-gateway.phpclass-stripe-checkout-gateway.phpclass-stripe-gateway.php
helpers
installers
integrations
host-providers
limitations
limits
list-tables
class-base-list-table.phpclass-broadcast-list-table.phpclass-checkout-form-list-table.phpclass-customer-list-table.phpclass-discount-code-list-table.phpclass-domain-list-table.phpclass-email-list-table.phpclass-event-list-table.phpclass-inside-events-list-table.phpclass-membership-list-table-widget.phpclass-membership-list-table.phpclass-payment-list-table-widget.phpclass-product-list-table.phpclass-site-list-table.phpclass-webhook-list-table.php
managers
class-broadcast-manager.phpclass-customer-manager.phpclass-domain-manager.phpclass-event-manager.phpclass-limitation-manager.phpclass-membership-manager.phpclass-notes-manager.phpclass-notification-manager.phpclass-site-manager.php
models
class-base-model.phpclass-checkout-form.phpclass-customer.phpclass-discount-code.phpclass-domain.phpclass-email.phpclass-event.phpclass-membership.phpclass-payment.phpclass-product.phpclass-site.php
traits
objects
site-templates
sso
tax
traits
trait-wp-ultimo-coupon-deprecated.phptrait-wp-ultimo-plan-deprecated.phptrait-wp-ultimo-settings-deprecated.php
ui
class-account-summary-element.phpclass-base-element.phpclass-billing-info-element.phpclass-checkout-element.phpclass-current-membership-element.phpclass-current-site-element.phpclass-domain-mapping-element.phpclass-field.phpclass-invoices-element.phpclass-jumper.phpclass-limits-element.phpclass-login-form-element.phpclass-my-sites-element.phpclass-payment-methods-element.phpclass-simple-text-element.phpclass-site-actions-element.phpclass-site-maintenance-element.phpclass-template-previewer.phpclass-template-switching-element.phpclass-thank-you-element.php
views
admin-pages
checkout
templates
order-bump
order-summary
period-selection
pricing-table
dashboard-statistics
dashboard-widgets
legacy
signup
settings
fields
@@ -34,6 +34,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
|
||||
|
||||
return 'template_selection';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this field should be present on the checkout flow or not.
|
||||
*
|
||||
@@ -82,6 +83,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
|
||||
|
||||
return __('Adds a template selection section. This allows the customer to choose a pre-built site to be used as a template for the site being currently created.', 'wp-ultimo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the icon to be used on the selector.
|
||||
*
|
||||
@@ -375,15 +377,15 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
|
||||
|
||||
$selection_type = wu_get_isset($attributes, 'template_selection_type', 'name');
|
||||
|
||||
if ($selection_type === 'name') {
|
||||
if ('name' === $selection_type) {
|
||||
return explode(',', $attributes['template_selection_sites']);
|
||||
}
|
||||
|
||||
if ($selection_type === 'all') {
|
||||
if ('all' === $selection_type) {
|
||||
return wu_get_site_templates(['fields' => 'blog_id']);
|
||||
}
|
||||
|
||||
if ($selection_type === 'categories') {
|
||||
if ('categories' === $selection_type) {
|
||||
return array_column(
|
||||
\WP_Ultimo\Models\Site::get_all_by_categories(
|
||||
$attributes['template_selection_categories'],
|
||||
|
Reference in New Issue
Block a user