[T-Mobile]Network Metric Cards

function render_tmobile_lightspeed_metrics_cards($atts) { // Fetch custom fields $custom_fields = get_post_meta(get_the_ID()); // City/state $city = !empty($custom_fields[‘city’][0]) ? $custom_fields[‘city’][0] : ‘Unknown City’; $state = !empty($custom_fields[‘state’][0]) ? $custom_fields[‘state’][0] : ‘Unknown State’; // Helper functions if (!function_exists(‘get_field_value’)) { function get_field_value($fields, $key, $default = 0)…Continue reading

[AT&T] Coverage Map

// Shortcode to display Zip Code Coverage Map with Optimized GeoJSON Loading (Lazy-Loaded) function att_coverage_map_shortcode() { // Retrieve current post ID and its custom ‘zip_code’ $post_id = get_the_ID(); $zip_code = get_post_meta($post_id, ‘zip_code’, true); $avg_dl = get_post_meta($post_id, ‘att_mean_download_kbps’, true); $avg_dl_formatted =…Continue reading

[Verizon] Coverage Map

// Shortcode to display Zip Code Coverage Map with Optimized GeoJSON Loading (Lazy-Loaded) function verizon_coverage_map_shortcode() { // Retrieve current post ID and its custom ‘zip_code’ $post_id = get_the_ID(); $zip_code = get_post_meta($post_id, ‘zip_code’, true); $avg_dl = get_post_meta($post_id, ‘verizon_mean_download_kbps’, true); $avg_dl_formatted =…Continue reading

Nearby Stores Maps

function generate_map_of_nearby_stores() { // Get current post ID $post_id = get_the_ID(); // Retrieve the zip code, city, and state from custom fields $zip_code = get_post_meta($post_id, ‘zip_code’, true); $city = get_post_meta($post_id, ‘city’, true); $state = get_post_meta($post_id, ‘state’, true); // If required…Continue reading

set cookies for the blog and pass it during account creation later on

function set_usm_utm_cookie() { if (!isset($_COOKIE[‘utm_params’])) { $current_path = $_SERVER[‘REQUEST_URI’]; $path_parts = explode(‘?’, $current_path, 2); $current_path = $path_parts[0]; $utm_params_value = “utm_source=us_mobile&utm_medium=organic&utm_campaign=” . urlencode($current_path); // Set a cookie with URL-encoded path for 1 year setcookie(‘utm_params’, $utm_params_value, time() + (365 * 24 *…Continue reading

PHP custom Carousel

function enqueue_jquery() { if (!wp_script_is(‘jquery’, ‘enqueued’)) { wp_enqueue_script(‘jquery’); } } add_action(‘wp_enqueue_scripts’, ‘enqueue_jquery’);Continue reading

Change Author Slug

/**Change Author Slug */ function new_author_base() { global $wp_rewrite; $author_slug = ‘about’; $wp_rewrite->author_base = $author_slug; } add_action(‘init’, ‘new_author_base’);Continue reading

FC – Mejoras en el procesamiento de imágenes

//* Evitar que WP cree tamaños de imagen adicionales add_action(‘intermediate_image_sizes_advanced’, function ($sizes) { unset($sizes[‘1536×1536’]); // desactivar tamaño medio-grande x2 unset($sizes[‘2048×2048’]); // desactivar tamaño grande x2 return $sizes; }); //* Evitar que se creen los tamaños escalados add_filter(‘big_image_size_threshold’, ‘__return_false’, PHP_INT_MAX-20); //*…Continue reading

class DeleteUploadedFiles {}

/** * Class deleteuploadedfiles to delete uploaded files from the server * * @link https://wpforms.com/developers/class-deleteuploadedfiles/ */ namespace WPF; class DeleteUploadedFiles { /** * Should we delete files from the WordPress Media Library? * Change the constant to true to delete…Continue reading