From 2127b1bdd73ecd2423e443992da4b442f5a3c1a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 04 Feb 2026 21:19:25 +0000
Subject: [PATCH] =Major overhaul of MetaManager.php -> Meta.php and RestRouteManager.php -> Rest.php. Seems to work for JakeVan
---
inc/managers/SEO/_edmonotonink.php | 48 +++++++++++++++++++++++++-----------------------
1 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/inc/managers/SEO/_edmonotonink.php b/inc/managers/SEO/_edmonotonink.php
index 14120eb..ceb97d9 100644
--- a/inc/managers/SEO/_edmonotonink.php
+++ b/inc/managers/SEO/_edmonotonink.php
@@ -4,14 +4,16 @@
* Edmonton.ink Configuration
*
* Add this to your edmonton.ink child theme/plugin
- * This replaces all the hardcoded logic in SchemaManager and SEOMetaManager
+ * This replaces all the hardcoded logic in SchemaManager and SEO`MetaManager`
*/
// ==================================================
// SITE-WIDE SCHEMA CONFIGURATION
// ==================================================
-add_filter('jvb_schema', function ($schema) {
+ use JVBase\meta\Meta;
+
+ add_filter('jvb_schema', function ($schema) {
return array_merge($schema, [
'site_type' => 'directory',
'organization' => [
@@ -290,7 +292,7 @@
'schema' => [
'custom_builder' => function ($post_id) {
- $meta = new \JVBase\meta\MetaManager($post_id, 'post');
+ $meta = Meta::forPost($post_id);
$schema = [
'@type' => 'Event',
@@ -298,13 +300,13 @@
'url' => get_permalink($post_id),
];
- $date = $meta->getValue('event_date');
+ $date = $meta->get('event_date');
if ($date) {
$schema['startDate'] = date('c', strtotime($date));
}
- $venue = $meta->getValue('venue');
- $venue_address = $meta->getValue('venue_address');
+ $venue = $meta->get('venue');
+ $venue_address = $meta->get('venue_address');
if ($venue) {
$schema['location'] = [
'@type' => 'Place',
@@ -342,8 +344,8 @@
'variables' => [
'name' => 'term_name',
'city' => ['callback' => function ($term_id, $context) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $city_id = $meta->getValue('city');
+ $meta = Meta::forTerm($term_id);
+ $city_id = $meta->get('city');
if ($city_id && term_exists((int)$city_id, BASE . 'city')) {
$city_term = get_term($city_id, BASE . 'city');
if ($city_term && !is_wp_error($city_term)) {
@@ -353,13 +355,13 @@
return 'Edmonton';
}],
'tagline_text' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $tagline = $meta->getValue('tagline');
+ $meta = Meta::forTerm($term_id);
+ $tagline = $meta->get('tagline');
return $tagline ? " - {$tagline}" : '';
}],
'established_text' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $established = $meta->getValue('established');
+ $meta = Meta::forTerm($term_id);
+ $established = $meta->get('established');
return $established ? " Established in {$established}" : '';
}],
'artist_count' => ['callback' => function ($term_id) {
@@ -388,15 +390,15 @@
'priceRange' => 'price_range',
'image' => 'logo',
'url' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $website = $meta->getValue('website');
+ $meta = Meta::forTerm($term_id);
+ $website = $meta->get('website');
return $website ?: get_term_link($term_id);
}],
'sameAs' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
+ $meta = Meta::forTerm($term_id);
$links = [];
- if ($ig = $meta->getValue('instagram')) $links[] = $ig;
- if ($fb = $meta->getValue('facebook')) $links[] = $fb;
+ if ($ig = $meta->get('instagram')) $links[] = $ig;
+ if ($fb = $meta->get('facebook')) $links[] = $fb;
return !empty($links) ? $links : null;
}],
'memberOf' => [
@@ -414,8 +416,8 @@
'variables' => [
'name' => 'term_name',
'alt_names' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $alts = $meta->getValue('alternate_name');
+ $meta = Meta::forTerm($term_id);
+ $alts = $meta->get('alternate_name');
if (!empty($alts) && is_array($alts)) {
$names = array_filter(array_column($alts, 'name'));
if (!empty($names)) {
@@ -437,8 +439,8 @@
'description' => 'characteristics',
'about' => ['meta' => 'description'],
'alternateName' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $alts = $meta->getValue('alternate_name');
+ $meta = Meta::forTerm($term_id);
+ $alts = $meta->get('alternate_name');
if (!empty($alts) && is_array($alts)) {
return array_filter(array_column($alts, 'name'));
}
@@ -456,8 +458,8 @@
'variables' => [
'name' => 'term_name',
'similar' => ['callback' => function ($term_id) {
- $meta = new \JVBase\meta\MetaManager($term_id, 'term');
- $similar = $meta->getValue('similar');
+ $meta = Meta::forTerm($term_id);
+ $similar = $meta->get('similar');
if (!empty($similar)) {
$similar_names = [];
foreach ((array)$similar as $similar_id) {
--
Gitblit v1.10.0