Years in Business

/** * Years in Business Shortcode * * Usage: [years_in_business year=”1985″] → 41 in 2026 * [years_in_business year=”1985″ since=”03-15″] → only counts completed years */ add_shortcode( ‘years_in_business’, function( $atts ) { $atts = shortcode_atts( array( ‘year’ => ”, // four-digit…Continue reading

Sort User ID

// 1. Add the User ID column to the users table add_filter(‘manage_users_columns’, ‘add_user_id_column’); function add_user_id_column($columns) { // Insert ‘user_id’ column after the checkbox column $new_columns = array(); foreach ($columns as $key => $value) { $new_columns[$key] = $value; if ($key ===…Continue reading

Better PHP Mailer

/** * Replace wp_mail with native PHP mail() */ add_filter(‘pre_wp_mail’, ‘use_native_mail’, 10, 2); function use_native_mail($null, $atts) { $to = $atts[‘to’]; $subject = $atts[‘subject’]; $message = $atts[‘message’]; $headers = isset($atts[‘headers’]) ? $atts[‘headers’] : ”; $attachments = isset($atts[‘attachments’]) ? $atts[‘attachments’] : array();…Continue reading

TEMP Sideload Guard — remove when pg-display ships (BACKLOG #45)

/** * PG Sideload Guard — TEMPORARY. Installed 2026-09-15. * * ══════════════════════════════════════════════════════════════════════ * THIS IS A TOURNIQUET. IT IS MEANT TO BE DEACTIVATED. * ══════════════════════════════════════════════════════════════════════ * * WHAT IT DOES: blocks front-end HTTP requests for image files. Nothing else. *…Continue reading

Country Profile page – ACF field shortcode generation

function get_country_field_values($atts) { // Extract attributes $atts = shortcode_atts(array( ‘field_name’ => ”, ‘slug_output’ => ‘false’, ), $atts, ‘country_fields’); // Get the current post ID $post_id = get_the_ID(); $output = ”; if (get_post_type($post_id) === ‘country’) { // Debugging: Check if the…Continue reading

Religion Profile Page – generate shortcode for each Religion field

function get_religion_field_values($atts) { // Extract attributes $atts = shortcode_atts(array( ‘field_name’ => ”, ‘slug_output’ => ‘false’, ), $atts, ‘religion_fields’); // Get the current post ID $post_id = get_the_ID(); $output = ”; if (get_post_type($post_id) === ‘religion’) { // Debugging: Check if the…Continue reading

Language Profile Page – Generate shortcodes for ACFs

function get_language_field_values($atts) { // Extract attributes $atts = shortcode_atts(array( ‘field_name’ => ”, ‘slug_output’ => ‘false’, ), $atts, ‘language_fields’); // Get the current post ID $post_id = get_the_ID(); $output = ”; $output = ”; $show_optional_note = false; if (get_post_type($post_id) === ‘language’)…Continue reading