| | |
| | | * Custom upload directory structure for edmonton.ink |
| | | * Recreates the original directory logic with shops, artists, partners, etc. |
| | | */ |
| | | add_filter('jvb_upload_directory', 'altr_upload_directory', 10, 4); |
| | | function altr_upload_directory($path, $post_type, $user_id, $term_id) |
| | | add_filter('jvb_upload_directory', 'atat_upload_directory', 10, 4); |
| | | function atat_upload_directory($path, $post_type, $user_id, $term_id) |
| | | { |
| | | switch ($post_type) { |
| | | case 'shop': |
| | |
| | | * Custom filename generation for edmonton.ink |
| | | * Recreates the original SEO-friendly filename logic |
| | | */ |
| | | add_filter('jvb_upload_filename', 'altr_filename', 10, 6); |
| | | function altr_filename($filename, $original_name, $user_data, $post_type, $user_id, $term_id) |
| | | add_filter('jvb_upload_filename', 'atat_filename', 10, 6); |
| | | function atat_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); |
| | |
| | | '%s-best-tattoo-shop-%s-%s', |
| | | sanitize_title($city), |
| | | sanitize_title($shop_term->name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | case 'artist': |
| | | // Profile images: {city}-best-{type}-{specialties}-{name} |
| | | $type = jvbArtistType($post); |
| | | $specialties = altr_get_artist_top_styles($post); |
| | | $specialties = atat_get_artist_top_styles($post); |
| | | |
| | | return sprintf( |
| | | '%s-best-%s-%s-%s-%s', |
| | |
| | | sanitize_title($type), |
| | | sanitize_title($specialties), |
| | | sanitize_title($user_data->display_name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | case 'partner': |
| | |
| | | sanitize_title($city), |
| | | sanitize_title($service_type), |
| | | sanitize_title($user_data->display_name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | case 'tattoo': |
| | | // Get style and subject if available |
| | | $style = altr_get_primary_taxonomy($post, BASE . 'style'); |
| | | $subject = altr_get_primary_taxonomy($post, BASE . 'theme'); |
| | | $style = atat_get_primary_taxonomy($post, BASE . 'style'); |
| | | $subject = atat_get_primary_taxonomy($post, BASE . 'theme'); |
| | | |
| | | return sprintf( |
| | | '%s-%s-%s-tattoo-by-%s-%s', |
| | |
| | | sanitize_title($style), |
| | | sanitize_title($subject), |
| | | sanitize_title($user_data->display_name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | case 'artwork': |
| | | // Get style and subject if available |
| | | $style = altr_get_primary_taxonomy($post, BASE . 'artstyle'); |
| | | $subject = altr_get_primary_taxonomy($post, BASE . 'arttheme'); |
| | | $style = atat_get_primary_taxonomy($post, BASE . 'artstyle'); |
| | | $subject = atat_get_primary_taxonomy($post, BASE . 'arttheme'); |
| | | |
| | | return sprintf( |
| | | '%s-%s-%s-artwork-by-%s-%s', |
| | |
| | | sanitize_title($style), |
| | | sanitize_title($subject), |
| | | sanitize_title($user_data->display_name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | case 'piercing': |
| | | // Get style if available |
| | | $style = altr_get_primary_taxonomy($post, BASE . 'pstyle'); |
| | | $style = atat_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), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | |
| | | default: |
| | |
| | | sanitize_title($city), |
| | | sanitize_title($content_type), |
| | | sanitize_title($user_data->display_name), |
| | | altr_get_counter($user_id, $post_type) |
| | | atat_get_counter($user_id, $post_type) |
| | | ); |
| | | } |
| | | } |
| | |
| | | * Custom alt text generation for edmonton.ink |
| | | * Recreates the original detailed alt text logic |
| | | */ |
| | | 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) |
| | | add_filter('jvb_upload_alt_text', 'atat_alt_text', 10, 7); |
| | | function atat_alt_text($alt_text, $file, $user_data, $post_id, $post_type, $user_id, $term_id) |
| | | { |
| | | $post = get_user_meta($user_id, BASE . 'link', true); |
| | | |
| | |
| | | ); |
| | | |
| | | case 'artist': |
| | | $specialties = altr_get_artist_top_styles($post); |
| | | $specialties = atat_get_artist_top_styles($post); |
| | | |
| | | return sprintf( |
| | | 'A photo of %s %s %s, specializing in %s tattoos', |
| | |
| | | * Custom image title generation for edmonton.ink |
| | | * Recreates the original SEO-friendly title logic |
| | | */ |
| | | 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) |
| | | add_filter('jvb_upload_image_title', 'atat_image_title', 10, 7); |
| | | function atat_image_title($title, $file, $user_data, $post_id, $post_type, $user_id, $term_id) |
| | | { |
| | | $post = get_user_meta($user_id, BASE . 'link', true); |
| | | |
| | |
| | | /** |
| | | * Get the next file counter for edmonton.ink style counters |
| | | */ |
| | | function altr_get_counter($user_id, $post_type) |
| | | function atat_get_counter($user_id, $post_type) |
| | | { |
| | | // Get counter key for this post type |
| | | $counter_key = BASE . str_replace(BASE, '', $post_type) . '_counter'; |
| | |
| | | /** |
| | | * Get artist's top styles for filename generation |
| | | */ |
| | | function altr_get_artist_top_styles($post_id) |
| | | function atat_get_artist_top_styles($post_id) |
| | | { |
| | | if (!function_exists('JVBase\\meta\\MetaManager')) { |
| | | // Fallback if MetaManager not available |
| | |
| | | /** |
| | | * Get primary taxonomy term for content |
| | | */ |
| | | function altr_get_primary_taxonomy($post_id, $taxonomy) |
| | | function atat_get_primary_taxonomy($post_id, $taxonomy) |
| | | { |
| | | $terms = wp_get_post_terms($post_id, $taxonomy, array('fields' => 'names')); |
| | | if (is_wp_error($terms) || empty($terms)) { |
| | |
| | | * Get partner type (placeholder - implement based on your edmonton.ink logic) |
| | | * This function was referenced in the original but not provided |
| | | */ |
| | | function altr_partner_type($post_id) |
| | | function atat_partner_type($post_id) |
| | | { |
| | | // Implement based on your edmonton.ink logic |
| | | // This might look at a taxonomy or meta field |