We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af6757c commit 9b3d96aCopy full SHA for 9b3d96a
includes/views/js/import-metabox-edit.js
@@ -1524,13 +1524,18 @@ function initRemoveFallbackImageBtn() {
1524
});
1525
}
1526
1527
+/**
1528
+ * Run actions when creating a new post.
1529
+ */
1530
function initNewPostActions() {
1531
+ if (-1 === window.location.href.indexOf('post-new.php')) {
1532
+ return;
1533
+ }
1534
+
1535
// Focus on the post title field when creating a new post.
- if (window.location.href.indexOf('post-new.php') > -1) {
- const postTitle = document.querySelector('#post_title');
- if (postTitle) {
- postTitle.focus();
- postTitle.select();
- }
1536
+ const postTitle = document.querySelector('#post_title');
1537
+ if (postTitle) {
1538
+ postTitle.focus();
1539
+ postTitle.select();
1540
1541
0 commit comments