ode URLs to substitute with user-friendly names $data['shortcode_links'] = Worker::getShortcodeLinksMapping(); $this->renderView('subscribers/stats.html', $data); } public function dynamicSegmentCombinations() { $this->renderView('segments/dynamic_premium_translations.html'); } public function includePremiumStyles() { $this->renderView('styles.html'); } public function includePremiumJavascript() { $this->wp->wpEnqueueScript( 'premium', Env::$assetsUrl . '/dist/js/' . $this->renderer->getJsAsset('premium.js'), [], Env::$version, true ); $this->wp->wpSetScriptTranslations('premium', 'mailpoet-premium'); // Print and dequeue the premium script immediately, so it is correctly placed // between "admin_vendor" and "admin" scripts from the free plugin. // This is a temporary solution until we use WP queuing for all translations. \wp_scripts()->do_item('wp-i18n'); \wp_scripts()->do_item('premium'); $this->wp->wpDequeueScript('wp-i18n'); $this->wp->wpDequeueScript('premium'); } /** * @param string $path * @param array $data * @return void * @throws \Exception */ private function renderView(string $path, array $data = []) { // We control those templates and the data. // phpcs:ignore WordPressDotOrg.sniffs.OutputEscaping.UnescapedOutputParameter,WordPress.Security.EscapeOutput.OutputNotEscaped echo $this->renderer->render($path, $data); } } Archives des En vedette - SOUTRAMARKET