PluginProbe
WPSSO Core – Complete Schema Markup and Meta Tags / 22.7.0
WPSSO Core – Complete Schema Markup and Meta Tags v22.7.0
22.7.0 22.6.1 22.6.0 22.5.3 22.5.2 22.5.1 22.4.0 22.3.0 22.2.1 22.2.0 22.1.3 22.1.2 22.1.1 22.1.0 22.0.0 21.13.3 21.13.2 trunk 21.13.1
wpsso / js / jquery-block-editor.js

jquery-block-editor.js in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at js/jquery-block-editor.js

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 const wpssoBlockEditor = ( function(){
3
4 const pluginId = 'wpsso';
5 const adminPageL10n = 'wpssoAdminPageL10n';
6 const postId = wp.data.select( 'core/editor' ).getCurrentPostId;
7 const isSavingMetaBoxes = wp.data.select( 'core/edit-post' ).isSavingMetaBoxes;
8
9 var wasSavingMb = false;
10
11 sucomBlockEditorNotices( pluginId, adminPageL10n ); // Update the notices on startup.
12
13 return {
14
15 refreshPostbox: function(){ // Called by wp.data.subscribe().
16
17 var isSavingMb = isSavingMetaBoxes(); // Check if saving metaboxes.
18
19 if ( isSavingMb && ! wasSavingMb ) { // Check if starting to save metaboxes.
20
21 sucomEditorUnchanged( pluginId, adminPageL10n ); // Disable unchanged fields in 'table.sucom-settings'.
22 }
23
24 if ( wasSavingMb && ! isSavingMb ) { // Check if done saving metaboxes.
25
26 sucomEditorPostbox( pluginId, adminPageL10n, postId ); // Refresh our metabox(es).
27
28 sucomBlockEditorNotices( pluginId, adminPageL10n ); // Refresh the block editor and toolbar notices.
29
30 sucomToolbarValidators( pluginId, adminPageL10n, postId ); // Refresh the toolbar validators.
31 }
32
33 wasSavingMb = isSavingMb;
34 },
35 }
36 })();
37
38 wp.data.subscribe( wpssoBlockEditor.refreshPostbox );
39
40