From 1027291d3af570aab2de3aeb779759b15fe3d3ec Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 30 Sep 2025 04:59:58 +0000
Subject: [PATCH] Initial Setup
---
files/fileManagement.php | 52 ++++++++++++++++++++++++++--------------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/files/fileManagement.php b/files/fileManagement.php
index 312d3aa..9b20763 100644
--- a/files/fileManagement.php
+++ b/files/fileManagement.php
@@ -4,8 +4,8 @@
* Custom upload directory structure for edmonton.ink
* Recreates the original directory logic with shops, artists, partners, etc.
*/
-add_filter('jvb_upload_directory', 'ajv_upload_directory', 10, 4);
-function ajv_upload_directory($path, $post_type, $user_id, $term_id)
+add_filter('jvb_upload_directory', 'altr_upload_directory', 10, 4);
+function altr_upload_directory($path, $post_type, $user_id, $term_id)
{
switch ($post_type) {
case 'shop':
@@ -37,8 +37,8 @@
* Custom filename generation for edmonton.ink
* Recreates the original SEO-friendly filename logic
*/
-add_filter('jvb_upload_filename', 'ajv_filename', 10, 6);
-function ajv_filename($filename, $original_name, $user_data, $post_type, $user_id, $term_id)
+add_filter('jvb_upload_filename', 'altr_filename', 10, 6);
+function altr_filename($filename, $original_name, $user_data, $post_type, $user_id, $term_id)
{
// Get artist/shop/partner details
$post = (int)get_user_meta($user_id, BASE . 'link', true);
@@ -61,13 +61,13 @@
'%s-best-tattoo-shop-%s-%s',
sanitize_title($city),
sanitize_title($shop_term->name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
case 'artist':
// Profile images: {city}-best-{type}-{specialties}-{name}
$type = jvbArtistType($post);
- $specialties = ajv_get_artist_top_styles($post);
+ $specialties = altr_get_artist_top_styles($post);
return sprintf(
'%s-best-%s-%s-%s-%s',
@@ -75,7 +75,7 @@
sanitize_title($type),
sanitize_title($specialties),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
case 'partner':
@@ -87,13 +87,13 @@
sanitize_title($city),
sanitize_title($service_type),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
case 'tattoo':
// Get style and subject if available
- $style = ajv_get_primary_taxonomy($post, BASE . 'style');
- $subject = ajv_get_primary_taxonomy($post, BASE . 'theme');
+ $style = altr_get_primary_taxonomy($post, BASE . 'style');
+ $subject = altr_get_primary_taxonomy($post, BASE . 'theme');
return sprintf(
'%s-%s-%s-tattoo-by-%s-%s',
@@ -101,13 +101,13 @@
sanitize_title($style),
sanitize_title($subject),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
case 'artwork':
// Get style and subject if available
- $style = ajv_get_primary_taxonomy($post, BASE . 'artstyle');
- $subject = ajv_get_primary_taxonomy($post, BASE . 'arttheme');
+ $style = altr_get_primary_taxonomy($post, BASE . 'artstyle');
+ $subject = altr_get_primary_taxonomy($post, BASE . 'arttheme');
return sprintf(
'%s-%s-%s-artwork-by-%s-%s',
@@ -115,19 +115,19 @@
sanitize_title($style),
sanitize_title($subject),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
case 'piercing':
// Get style if available
- $style = ajv_get_primary_taxonomy($post, BASE . 'pstyle');
+ $style = altr_get_primary_taxonomy($post, BASE . 'pstyle');
return sprintf(
'%s-%s-piercing-by-%s-%s',
sanitize_title($city),
sanitize_title($style),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
default:
@@ -139,7 +139,7 @@
sanitize_title($city),
sanitize_title($content_type),
sanitize_title($user_data->display_name),
- ajv_get_counter($user_id, $post_type)
+ altr_get_counter($user_id, $post_type)
);
}
}
@@ -148,8 +148,8 @@
* Custom alt text generation for edmonton.ink
* Recreates the original detailed alt text logic
*/
-add_filter('jvb_upload_alt_text', 'ajv_alt_text', 10, 7);
-function ajv_alt_text($alt_text, $file, $user_data, $post_id, $post_type, $user_id, $term_id)
+add_filter('jvb_upload_alt_text', 'altr_alt_text', 10, 7);
+function altr_alt_text($alt_text, $file, $user_data, $post_id, $post_type, $user_id, $term_id)
{
$post = get_user_meta($user_id, BASE . 'link', true);
@@ -174,7 +174,7 @@
);
case 'artist':
- $specialties = ajv_get_artist_top_styles($post);
+ $specialties = altr_get_artist_top_styles($post);
return sprintf(
'A photo of %s %s %s, specializing in %s tattoos',
@@ -237,8 +237,8 @@
* Custom image title generation for edmonton.ink
* Recreates the original SEO-friendly title logic
*/
-add_filter('jvb_upload_image_title', 'ajv_image_title', 10, 7);
-function ajv_image_title($title, $file, $user_data, $post_id, $post_type, $user_id, $term_id)
+add_filter('jvb_upload_image_title', 'altr_image_title', 10, 7);
+function altr_image_title($title, $file, $user_data, $post_id, $post_type, $user_id, $term_id)
{
$post = get_user_meta($user_id, BASE . 'link', true);
@@ -342,7 +342,7 @@
/**
* Get the next file counter for edmonton.ink style counters
*/
-function ajv_get_counter($user_id, $post_type)
+function altr_get_counter($user_id, $post_type)
{
// Get counter key for this post type
$counter_key = BASE . str_replace(BASE, '', $post_type) . '_counter';
@@ -363,7 +363,7 @@
/**
* Get artist's top styles for filename generation
*/
-function ajv_get_artist_top_styles($post_id)
+function altr_get_artist_top_styles($post_id)
{
if (!function_exists('JVBase\\meta\\MetaManager')) {
// Fallback if MetaManager not available
@@ -403,7 +403,7 @@
/**
* Get primary taxonomy term for content
*/
-function ajv_get_primary_taxonomy($post_id, $taxonomy)
+function altr_get_primary_taxonomy($post_id, $taxonomy)
{
$terms = wp_get_post_terms($post_id, $taxonomy, array('fields' => 'names'));
if (is_wp_error($terms) || empty($terms)) {
@@ -416,7 +416,7 @@
* Get partner type (placeholder - implement based on your edmonton.ink logic)
* This function was referenced in the original but not provided
*/
-function ajv_partner_type($post_id)
+function altr_partner_type($post_id)
{
// Implement based on your edmonton.ink logic
// This might look at a taxonomy or meta field
--
Gitblit v1.10.0