File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 219219 const $closeButton = $ ( '<button>' , {
220220 type : 'button' ,
221221 class : 'button button-primary' ,
222- text : '✕'
222+ text : '✕' ,
223223 } ) ;
224224
225225 $message . append ( $closeButton ) ;
856856 } ) ;
857857
858858 // Tagify for normal mix content field.
859- const mixContent = $ ( '.fz-input-tagify[name="feedzy_meta_data[import_post_content]"]:not(.fz-tagify-image)' ) . tagify ( {
859+ const mixContent = $ (
860+ '.fz-input-tagify[name="feedzy_meta_data[import_post_content]"]:not(.fz-tagify-image)'
861+ ) . tagify ( {
860862 mode : 'mix' ,
861863 editTags : false ,
862864 templates : {
11211123 class : 'button button-secondary' ,
11221124 click : ( ) => {
11231125 window . location . href = window . feedzy . pages . logs ;
1124- }
1126+ } ,
11251127 } ,
11261128 {
11271129 text : feedzy . i10n . okButton ,
14961498 $ (
14971499 'input[name="feedzy_meta_data[fallback_image_option]"]:checked'
14981500 ) . trigger ( 'change' ) ;
1501+
1502+ initNewPostActions ( ) ;
14991503 }
15001504} ) ( jQuery , feedzy ) ;
15011505
@@ -1519,3 +1523,14 @@ function initRemoveFallbackImageBtn() {
15191523 feedzy . i10n . action_btn_text_1 ;
15201524 } ) ;
15211525}
1526+
1527+ function initNewPostActions ( ) {
1528+ // Focus on the post title field when creating a new post.
1529+ if ( window . location . href . indexOf ( 'post-new.php' ) > - 1 ) {
1530+ const postTitle = document . querySelector ( '#post_title' ) ;
1531+ if ( postTitle ) {
1532+ postTitle . focus ( ) ;
1533+ postTitle . select ( ) ;
1534+ }
1535+ }
1536+ }
You can’t perform that action at this time.
0 commit comments