예제 #1
0
 /**
  * Types_Dialog_Box constructor.
  *
  * Should be called during the 'current_screen' action, not sooner or later.
  *
  * @param string $dialog_id Unique ID (at least within the page) used to reference the dialog in JS.
  * @param Twig_Environment $twig Prepared Twig environment.
  * @param array $context Twig context for the dialog template.
  * @param string $template_name Twig template name that will be recognized by the provided environment.
  * @param bool $late_register_assets Whether to run late_register_assets() or not.
  *
  * @since 2.0
  */
 public function __construct($dialog_id, $twig, $context, $template_name, $late_register_assets = true)
 {
     $current_screen = get_current_screen();
     parent::__construct(array($current_screen->id));
     $this->dialog_id = $dialog_id;
     $this->twig = $twig;
     $this->context = $context;
     $this->template_name = $template_name;
     if ($late_register_assets) {
         $this->late_register_assets();
     }
     // We're going to render on the page we're creating this instance.
     $this->init_screen_render();
 }
 function __construct($screens)
 {
     parent::__construct($screens);
 }