Blocks = CSSController::GetBlocks(); // Determine which type of page to display // phpcs:ignore WordPress.Security.NonceVerification.Recommended $view_type = isset($_GET['css-edit']) ? 'edit' : (isset($_GET['css-create']) ? 'create' : 'default'); if ($view_type !== 'default') { if ($view_type === 'edit') { // No need for nonce verification here, as the user is not submitting any data // phpcs:ignore WordPress.Security.NonceVerification.Recommended $css_block_id = sanitize_text_field(wp_unslash($_GET['css-edit'])); $this->CurrentCssBlock = isset($this->Blocks[$css_block_id]) ? $this->Blocks[$css_block_id] : false; if (!$this->CurrentCssBlock) { $this->RenderMainPage(); return; } $this->CurrentCssBlock->id = $css_block_id; } else { $this->IsCreating = true; } add_action("admin_footer", array($this, 'RenderLivePreview')); $this->RenderEditPage(); } else { $this->RenderMainPage(); } } private function RenderEditPage() { $edit_or_create = $this->IsCreating ? __("Create CSS Block", "superb-blocks") : __("Edit CSS Block", "superb-blocks"); ?>

IsCreating || ($this->CurrentCssBlock && $this->CurrentCssBlock->active) ? "" : __("This CSS block is currently deactivated.", "superb-blocks"))); ?>


" value="CurrentCssBlock ? esc_attr($this->CurrentCssBlock->name) : ""; ?>" maxlength="" />

IsCreating ? 'style="display:none;"' : '' ?>> CurrentCssBlock && !$this->CurrentCssBlock->active) : ?>
CurrentCssBlock) : ?>
__("Front Page", "superb-blocks"), "full" => __("Entire Website", "superb-blocks") ) ); $labels = []; foreach ($block->selectors as $target) { if (!isset($valid_labels[$target->type]) || !$valid_labels[$target->type]) continue; $labels[] = !empty($target->value) ? sprintf( /* translators: %s: Target post type (page, post, template etc.) */ __("Specific %s", "superb-blocks"), $valid_labels[$target->type] ) : $valid_labels[$target->type]; } if (empty($labels)) { return __("Not Applied", "superb-blocks"); } return rtrim(join(", ", $labels), ", "); } }