-
-
Notifications
You must be signed in to change notification settings - Fork 72
Fix: Template Switching Image Preservation Bug #286
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
87db38b
78d21a2
34e6363
b35fadd
9a14c3f
ddf8d83
3dd006e
4725954
6c7b2f9
77002dc
ba0bc24
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -54,22 +54,11 @@ final class Domains_Table extends Table { | |||||||||||||||
| '2.0.1-revision.20230601' => 20_230_601, | ||||||||||||||||
| ]; | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Domains constructor. | ||||||||||||||||
| * | ||||||||||||||||
| * @access public | ||||||||||||||||
| * @since 2.0.0 | ||||||||||||||||
| * @return void | ||||||||||||||||
| */ | ||||||||||||||||
| public function __construct() { | ||||||||||||||||
|
|
||||||||||||||||
| parent::__construct(); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Setup the database schema | ||||||||||||||||
| * Set up the database schema | ||||||||||||||||
| * | ||||||||||||||||
| * @access protected | ||||||||||||||||
| * @acces s protected | ||||||||||||||||
|
Comment on lines
+59
to
+61
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 typo in docblock tag. Line 61 has a typo: Apply this diff to fix the typo: - * @acces s protected
+ * @access protectedπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||
| * @since 2.0.0 | ||||||||||||||||
| * @return void | ||||||||||||||||
| */ | ||||||||||||||||
|
|
||||||||||||||||
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: 5057
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 140
π Script executed:
cat -n ./inc/admin-pages/class-base-customer-facing-admin-page.php | head -300Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 9583
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 124
π Script executed:
rg -n "register_widgets" ./inc/admin-pages/class-base-admin-page.php -A 5Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 494
π Script executed:
rg "get_current_screen()" --max-count=20 -B 2Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 19028
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 1060
π Script executed:
Repository: Multisite-Ultimate/ultimate-multisite
Length of output: 4904
Add null-check before dereferencing
get_current_screen().Directly calling
get_current_screen()->idcan cause a fatal error if the screen object is unavailable. Whileget_current_screen()is typically available at the "load-{hook}" action, adding a defensive null-check is safer:public function register_widgets(): void { - \WP_Ultimo\UI\Simple_Text_Element::get_instance()->as_inline_content(get_current_screen()->id, 'wu_dash_before_metaboxes'); - \WP_Ultimo\UI\Template_Switching_Element::get_instance()->as_inline_content(get_current_screen()->id, 'wu_dash_before_metaboxes'); + $screen = get_current_screen(); + if ( ! $screen) { + return; + } + + \WP_Ultimo\UI\Simple_Text_Element::get_instance()->as_inline_content($screen->id, 'wu_dash_before_metaboxes'); + \WP_Ultimo\UI\Template_Switching_Element::get_instance()->as_inline_content($screen->id, 'wu_dash_before_metaboxes'); }π Committable suggestion
π€ Prompt for AI Agents