-
-
Notifications
You must be signed in to change notification settings - Fork 72
Improve template selection and fix email manager initialization #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cb3f82b
c6b058d
6025427
9c5f550
e07448a
6d75b8c
1b88bf2
b8c65fb
6216f35
26b1650
e8ab63f
7ef3271
023e0fb
3d19200
d34c848
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -212,7 +212,9 @@ public function get_fields() { | |||||||||||||
| 'fields' => [ | ||||||||||||||
| 'period_options_remove' => [ | ||||||||||||||
| 'type' => 'note', | ||||||||||||||
| 'desc' => sprintf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => period_options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', __('Remove', 'ultimate-multisite')), | ||||||||||||||
| 'desc' => function () { | ||||||||||||||
| printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => period_options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite')); | ||||||||||||||
| }, | ||||||||||||||
|
Comment on lines
+215
to
+217
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use full According to the PR objectives, the shorthand Apply this diff: 'desc' => function () {
- printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => period_options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
+ printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" v-on:click.prevent="() => period_options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
},π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||
| 'wrapper_classes' => 'wu-absolute wu-top-0 wu-right-0', | ||||||||||||||
| ], | ||||||||||||||
| 'period_options_duration' => [ | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,7 +175,9 @@ public function get_fields() { | |
| 'fields' => [ | ||
| 'options_remove' => [ | ||
| 'type' => 'note', | ||
| 'desc' => sprintf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', __('Remove', 'ultimate-multisite')), | ||
| 'desc' => function () { | ||
| printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite')); | ||
| }, | ||
|
Comment on lines
+178
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Inconsistent Vue directive form. This code uses Other files in this PR (inc/ui/class-domain-mapping-element.php, inc/ui/class-template-switching-element.php, inc/admin-pages/class-checkout-form-edit-admin-page.php) correctly use Apply this diff to use the full form: 'desc' => function () {
- printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
+ printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" v-on:click.prevent="() => options.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
},π€ Prompt for AI Agents |
||
| 'wrapper_classes' => 'wu-absolute wu-top-0 wu-right-0', | ||
| ], | ||
| 'options_key' => [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1107,7 +1107,9 @@ public function default_sections(): void { | |||||||||||||
| 'fields' => [ | ||||||||||||||
| 'emulated_post_types_remove' => [ | ||||||||||||||
| 'type' => 'note', | ||||||||||||||
| 'desc' => sprintf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => emulated_post_types.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', __('Remove', 'ultimate-multisite')), | ||||||||||||||
| 'desc' => function () { | ||||||||||||||
| printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => emulated_post_types.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite')); | ||||||||||||||
| }, | ||||||||||||||
|
Comment on lines
+1110
to
+1112
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Inconsistent Vue directive form. Similar to inc/checkout/signup-fields/class-signup-field-select.php, this code uses Apply this diff to use the full form: 'desc' => function () {
- printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" @click.prevent="() => emulated_post_types.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
+ printf('<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" v-on:click.prevent="() => emulated_post_types.splice(index, 1)"><span class="dashicons-wu-squared-cross"></span></a>', esc_html__('Remove', 'ultimate-multisite'));
},π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||
| 'wrapper_classes' => 'wu-absolute wu-top-0 wu-right-0', | ||||||||||||||
| ], | ||||||||||||||
| 'emulated_post_types_slug' => [ | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,4 +96,24 @@ public function get_plural_name() { | |
|
|
||
| return $this->item_name_plural; | ||
| } | ||
|
|
||
| /** | ||
| * Get columns from an array of arguments. | ||
| * Copy of the parent method of public access. | ||
| * | ||
| * @param array $args Arguments to filter columns by. | ||
| * @param string $operator Optional. The logical operation to perform. | ||
| * @param string $field Optional. A field from the object to place | ||
| * instead of the entire object. Default false. | ||
| * @return array Array of column. | ||
| */ | ||
| public function get_columns($args = array(), $operator = 'and', $field = false) { | ||
| // Filter columns. | ||
| $filter = wp_filter_object_list($this->columns, $args, $operator, $field); | ||
|
|
||
| // Return column or false. | ||
| return ! empty($filter) | ||
| ? array_values($filter) | ||
| : array(); | ||
| } | ||
|
Comment on lines
+100
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the inline comment to match actual return behavior. Line 115's comment states "Return column or false" but the code returns an empty array Apply this diff to fix the comment: /**
* Get columns from an array of arguments.
* Copy of the parent method of public access.
*
* @param array $args Arguments to filter columns by.
* @param string $operator Optional. The logical operation to perform.
* @param string $field Optional. A field from the object to place
* instead of the entire object. Default false.
* @return array Array of column.
*/
public function get_columns($args = array(), $operator = 'and', $field = false) {
// Filter columns.
$filter = wp_filter_object_list($this->columns, $args, $operator, $field);
- // Return column or false.
+ // Return columns or empty array.
return ! empty($filter)
? array_values($filter)
: array();
}π€ Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -100,7 +100,7 @@ function wu_get_default_system_emails($slug = '') { | |||||
| * @since 2.0.0 | ||||||
| * | ||||||
| * @param string $slug Default system email slug to be create. | ||||||
| * @return array | ||||||
| * @return bool|Email | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHPDoc return type is incomplete. The docblock states -* @return bool|Email
+* @return Email|false|\WP_Errorπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||
| */ | ||||||
| function wu_create_default_system_email($slug) { | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
|
|
||
| namespace WP_Ultimo\List_Tables; | ||
|
|
||
| use Closure; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Script executed: #!/bin/bash
# Check if Closure is used anywhere in the Base_List_Table file
rg -n "Closure" inc/list-tables/class-base-list-table.phpRepository: Multisite-Ultimate/ultimate-multisite Length of output: 96 π Script executed: #!/bin/bash
# Also check the file structure and get more context around line 12
head -50 inc/list-tables/class-base-list-table.php | cat -nRepository: Multisite-Ultimate/ultimate-multisite Length of output: 1424 π Script executed: #!/bin/bash
# Get total line count and search for any Closure usage in the complete file
wc -l inc/list-tables/class-base-list-table.phpRepository: Multisite-Ultimate/ultimate-multisite Length of output: 127 π Script executed: #!/bin/bash
# Search for Closure with context to see if it's used in type hints, instantiation, or callbacks
rg -C 3 "Closure" inc/list-tables/class-base-list-table.phpRepository: Multisite-Ultimate/ultimate-multisite Length of output: 186 Remove the unused The π€ Prompt for AI Agents |
||
| use WP_Ultimo\Helpers\Hash; | ||
|
|
||
| // Exit if accessed directly | ||
|
|
@@ -1262,10 +1263,6 @@ public function get_default_date_filter_options() { | |
| /** | ||
| * Returns the columns from the BerlinDB Schema. | ||
| * | ||
| * Schema columns are protected on BerlinDB, which makes it hard to reference them out context. | ||
| * This is the reason for the reflection funkiness going on in here. | ||
| * Maybe there's a better way to do it, but it works for now. | ||
| * | ||
| * @since 2.0.0 | ||
| * | ||
| * @param array $args Key => Value pair to search the return columns. e.g. array('searchable' => true). | ||
|
|
@@ -1274,16 +1271,7 @@ public function get_default_date_filter_options() { | |
| * @return array. | ||
| */ | ||
| protected function get_schema_columns($args = [], $operator = 'and', $field = false) { | ||
|
|
||
| $query_class = new $this->query_class(); | ||
|
|
||
| $reflector = new \ReflectionObject($query_class); | ||
|
|
||
| $method = $reflector->getMethod('get_columns'); | ||
|
|
||
| $method->setAccessible(true); | ||
|
|
||
| return $method->invoke($query_class, $args, $operator, $field); | ||
| return (new $this->query_class())->get_columns($args, $operator, $field); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 9340
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 65
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 249
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 2784
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 562
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 10282
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 63
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1912
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 3206
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 63
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1533
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1469
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1933
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 2174
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1108
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 8993
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1064
Use
esc_attr__()instead ofesc_html__()for the title attribute.The
titleattribute requires attribute-context escaping. Whileesc_html__()works here because the text "Remove" contains no special characters, the correct function for attribute context isesc_attr__():'desc' => function () { printf( '<a title="%s" class="wu-no-underline wu-inline-block wu-text-gray-600 wu-mt-2 wu-mr-2" href="#" v-on:click.prevent="() => price_variations.splice(index, 1)"> <span class="dashicons-wu-squared-cross"></span> </a>', - esc_html__('Remove', 'ultimate-multisite') + esc_attr__('Remove', 'ultimate-multisite') ); },The field system does support callable
descvalues, and this pattern correctly outputs Vue directives (which are whitelisted inwu_kses_allowed_html()).π€ Prompt for AI Agents