Skip to content
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

Inline event handlers refactoring #551

Open
wants to merge 77 commits into
base: master
Choose a base branch
from

Conversation

enricocarraro
Copy link

@enricocarraro enricocarraro commented Sep 23, 2020

Trac ticket: https://core.trac.wordpress.org/ticket/51407


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try Again' ) . '</a>' );
wp_die( $api->get_error_message() . '</p> <p><a href="#" id="theme-try-again">' . __( 'Try Again' ) . '</a>' );

$js = <<<'JS'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this can't be in an external file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find instances of this method being used, so I moved the handler to an inline script for simplicity.

Gruntfile.js Outdated Show resolved Hide resolved
@enricocarraro enricocarraro force-pushed the inline_event_handlers_refactoring branch 2 times, most recently from f6bfa19 to ec4f41d Compare October 8, 2020 11:03
@enricocarraro enricocarraro force-pushed the inline_event_handlers_refactoring branch 2 times, most recently from dbdef78 to 43b4fac Compare October 8, 2020 20:21
@enricocarraro enricocarraro deleted the inline_event_handlers_refactoring branch October 15, 2020 14:19
@enricocarraro enricocarraro reopened this Oct 15, 2020
@enricocarraro enricocarraro force-pushed the inline_event_handlers_refactoring branch 2 times, most recently from cfddf14 to f67e4ba Compare October 15, 2020 14:42
@enricocarraro enricocarraro force-pushed the inline_event_handlers_refactoring branch 5 times, most recently from 75d9ecd to c2550c2 Compare October 20, 2020 08:30
…mage-header.php` with event handler in `js/_enqueues/admin/custom-header.js`.
…h event handler in `js/_enqueues/admin/edit-comments.js`.
…t-table.php` with event handler in `js/_enqueues/admin/link-manager.js`.
…es/meta-boxes.php` with event handler in `src/js/_enqueues/admin/link.js`.
…t-table.php` with event handler in `js/_enqueues/admin/media.js`.
…h event handler in `js/_enqueues/admin/post.js`.
…t handler in `js/_enqueues/admin/setup-config.js`.
…st-table.php` with event handler in `js/_enqueues/admin/themes-list.js`.
…` and `src/wp-admin/includes/post.php` with event handler in `wp-includes/js/metabox-events.js`.
…enus.php` with event handler in `js/_enqueues/wp/customize/nav-menus.js`.
…u-widget.php` with event handler in `js/_enqueues/wp/customize/widgets.js`.
…tall-list-table.php` with event handler in inline script.
…` with event handler in `js/_enqueues/lib/image-edit.js`.
…ent handler in `js/_enqueues/admin/media-events.js`.
…includes/ms.php` with event handler in `js/_enqueues/admin/common.js`.
…dmin/plugin-editor.php` with event handler in `js/_enqueues/wp/theme-plugin-editor.js`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants