base !== 'post') { return; } $version = constant('EXTENDIFY_DEVMODE') ? uniqid() : Config::$version; $scriptAssetPath = EXTENDIFY_PATH . 'public/build/' . Config::$assetManifest['extendify-draft.php']; $fallback = [ 'dependencies' => [], 'version' => $version, ]; $scriptAsset = file_exists($scriptAssetPath) ? require $scriptAssetPath : $fallback; foreach ($scriptAsset['dependencies'] as $style) { wp_enqueue_style($style); } \wp_enqueue_script( Config::$slug . '-draft-scripts', EXTENDIFY_BASE_URL . 'public/build/' . Config::$assetManifest['extendify-draft.js'], array_merge([Config::$slug . '-shared-scripts'], $scriptAsset['dependencies']), $scriptAsset['version'], true ); \wp_add_inline_script( Config::$slug . '-draft-scripts', 'window.extDraftData = ' . \wp_json_encode([ 'globalState' => \wp_json_encode(UserSettingsController::get()->get_data()), ]), 'before' ); \wp_set_script_translations(Config::$slug . '-draft-scripts', 'extendify-local', EXTENDIFY_PATH . 'languages/js'); } }