Repository navigation
Expand file tree
/
Copy pathpost-edit.js
More file actions
52 lines (41 loc) · 1.71 KB
/
Copy pathpost-edit.js
File metadata and controls
52 lines (41 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import domReady from "@wordpress/dom-ready";
import jQuery from "jquery";
import { noop } from "lodash";
import initAdmin from "./initializers/admin";
import initEditorStore from "./initializers/editor-store";
import initFeaturedImageIntegration from "./initializers/featured-image";
import initTabs from "./initializers/metabox-tabs";
import initPostScraper from "./initializers/post-scraper";
import initPrimaryCategory from "./initializers/primary-category";
import initializeInsights from "./insights/initializer";
// Backwards compatibility globals.
window.wpseoPostScraperL10n = window.wpseoScriptData.metabox;
window.wpseoShortcodePluginL10n = window.wpseoScriptData.analysis.plugins.shortcodes;
window.YoastSEO = window.YoastSEO || {};
domReady( () => {
// Initialize the tab behavior of the metabox.
initTabs( jQuery );
// Initialize the primary category integration.
if ( typeof wpseoPrimaryCategoryL10n !== "undefined" ) {
initPrimaryCategory( jQuery );
}
// Initialize the editor store.
const store = initEditorStore();
// Initialize the editor integration
window.yoast.initEditorIntegration( store );
const editorData = new window.yoast.EditorData( noop, store );
editorData.initialize(
window.wpseoScriptData.analysis.plugins.replaceVars.replace_vars,
window.wpseoScriptData.analysis.plugins.replaceVars.hidden_replace_vars
);
// Initialize the post scraper.
initPostScraper( jQuery, store, editorData );
// Initialize the featured image integration for classic editor and block editor only.
if ( ! window.wpseoScriptData?.isElementorEditor ) {
initFeaturedImageIntegration( jQuery );
}
// Initialize global admin scripts.
initAdmin( jQuery );
// Initialize the insights.
initializeInsights();
} );