From 9bbeea742424837fb58207d88e10dbca0b2cae04 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 03 May 2026 22:04:17 +0000
Subject: [PATCH] =SEO Field registration and formatting
---
inc/managers/SEO/render/Traits/_Properties/dissolutionDateTrait.php | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/inc/managers/SEO/render/Traits/_Properties/dissolutionDateTrait.php b/inc/managers/SEO/render/Traits/_Properties/dissolutionDateTrait.php
index 9b51d29..c327327 100644
--- a/inc/managers/SEO/render/Traits/_Properties/dissolutionDateTrait.php
+++ b/inc/managers/SEO/render/Traits/_Properties/dissolutionDateTrait.php
@@ -2,6 +2,8 @@
namespace JVBase\managers\SEO\render\Traits\_Properties;
use JVBase\managers\SEO\render\DataType\Date;
+use JVBase\meta\Meta;
+use JVBase\registrar\Fields;
if (!defined('ABSPATH')) {
exit;
@@ -31,4 +33,37 @@
'hint' => 'IMPORTANT: Do not fill this out, unless your business has actually closed.'
];
}
+ public function setDissolutionDateField(Fields $fields):void
+ {
+ $fields->addField(
+ 'permanently_close',
+ [
+ 'type' => 'true_false',
+ 'label' => __('Permanently Close', 'jvb'),
+ 'hint' => '*IMPORTANT* This signals to search engines that this business is no longer in business. Use only if your shop is closing!',
+ ]
+ );
+ $fields->addField(
+ 'dissolution_date',
+ [
+ 'type' => 'date',
+ 'label' => __('Dissolution Date', 'jvb'),
+ 'condition' => [
+ 'field' => 'permanently_close',
+ 'operator' => '==',
+ 'value' => true,
+ ]
+ ]
+ );
+ }
+
+ public function formatDissolutionDateField(Meta $meta):void
+ {
+ [$closed, $dissolution] = $meta->getAll(['permanently_close', 'dissolution_date']);
+ if (!empty($closed) && $closed === true) {
+ if (!empty($dissolution)) {
+ $this->setDissolutionDate($dissolution);
+ }
+ }
+ }
}
--
Gitblit v1.10.0