Cleanup_Posts_Categories_Tags_06_30

/* Plugin Name: Daily Cleanup with Report Description: Deletes all posts, categories, and tags daily and emails a summary. Version: 1.4 */ function delete_all_posts_categories_tags_with_report() { global $wpdb; // 🕒 Track last cleanup execution time update_option( ‘last_run_cleanup’, current_time( ‘mysql’ ) );…Continue reading

[T-MO] Coverage Map

function tmobile_coverage_map_shortcode() { // Get current post ID and required custom fields $post_id = get_the_ID(); $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 fields are missing if (empty($zip_code) || empty($city)…Continue reading

Network Metrics Cards [AT&T]

function render_att_darkstar_metrics_cards($atts) { // Fetch custom fields $custom_fields = get_post_meta(get_the_ID()); $city = isset($custom_fields[‘city’][0]) ? $custom_fields[‘city’][0] : ‘Unknown City’; $zip_code = isset($custom_fields[‘zip_code’][0]) ? $custom_fields[‘zip_code’][0] : ‘00000’; // Helper function to safely get field values if (!function_exists(‘get_field_value’)) { function get_field_value($fields, $key, $default…Continue reading

Hide Comments and Calculate Reading Time – PHP

/** * Author: Sumaiya * Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-11295 * Calculate Reading time for the content * * @param string $content * @return int */ function calculate_reading_time( $content ) { $word_count = str_word_count( strip_tags( $content ) ); $reading_speed = 200; //…Continue reading

Ultimate Member Fallback Value

/** * Displays fallback value if the field value is empty. For the “view” mode only. * @param string $value * @param string $default * @param string $key * @param string $type * @param array $data * @return string */…Continue reading

ACF: Author

// ACF custom variables $knowsabout = get_field( ‘author_knowsabout’, ‘user_’.get_the_author_meta( ‘ID’ ) ); $knowsabout2 = get_field( ‘author_knowsabout_2’, ‘user_’.get_the_author_meta( ‘ID’ ) ); $knowsabout3 = get_field( ‘author_knowsabout_3’, ‘user_’.get_the_author_meta( ‘ID’ ) ); $knowsabout4 = get_field( ‘author_knowsabout_4’, ‘user_’.get_the_author_meta( ‘ID’ ) ); $knowsabout5 = get_field( ‘author_knowsabout_5’,…Continue reading