PluginProbe
PhastPress / 3.9
PhastPress v3.9
3.12 3.11 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 All 119 releases
phastpress / classes / InstallNoticeRendererImplementation.php

InstallNoticeRendererImplementation.php in PhastPress 3.9, at classes/InstallNoticeRendererImplementation.php

29 lines 959 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Kibo\PhastPlugins\PhastPress;
4
5 use Kibo\PhastPlugins\SDK\AdminPanel\InstallNoticeRenderer;
6
7 class InstallNoticeRendererImplementation implements InstallNoticeRenderer {
8 public function render($notice, $onCloseJSFunction) {
9 return phastpress_script(sprintf(
10 '
11 (function () {
12 var notice = document.createElement("div");
13 notice.className = "notice notice-success is-dismissible";
14 notice.addEventListener("click", %s);
15 notice.innerHTML = %s;
16
17 var hr =
18 document.querySelector(".wp-header-end") ||
19 document.querySelector("#wpbody-content > .wrap > h1");
20
21 hr.parentNode.insertBefore(notice, hr.nextSibling);
22 })();
23 ',
24 $onCloseJSFunction,
25 json_encode("<p>{$notice}</p>")
26 ));
27 }
28 }
29