Register Custom Post Type: Changelog

// Register Custom Post Type function create_changelog_cpt() { $labels = array( ‘name’ => _x( ‘Changelogs’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Changelog’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Changelogs’, ‘text_domain’ ), ‘name_admin_bar’ => __(…Continue reading

Gravity Forms PHP Helpers

const IC_REGEXP_KATAKANA = “/\A[ア-ンガ-ボァ-ョヮッーヴ]+\z/u”; const IC_REGEXP_WHITESPACE = “/[\s\x{3000}]+/u”; const IC_REGEXP_POST_CODE_JP = “/\A\d{3}-?\d{4}\z/u”; const IC_REGEXP_PHONE = “/\A\+?\d[\d-]{1,14}\z/u”; // デバッグログは javascript-helpers.js と同じく、クエリパラメータ `debugp` // が付いている場合のみ出力する(例: ?debugp / ?debugp=1) function icDebugp($message) { static $enabled = null; if($enabled === null) $enabled = isset($_REQUEST[‘debugp’]); if(!$enabled)…Continue reading

_MK – Last connection

// Enregistre la date de connexion de l’utilisateur function enregistrer_derniere_connexion($user_login, $user) { // Met à jour la date de la dernière connexion $last_login = current_time(‘mysql’); update_user_meta($user->ID, ‘last_login’, $last_login); // Debug: Vérifie si la date est bien enregistrée if (false ===…Continue reading

Cleanup_Posts_Categories_Tags_06_30

/* Plugin Name: Daily Cleanup with Report Description: Deletes selected post types, categories, and tags daily, stores summary data for digest reporting, and optionally sends an email confirmation. Version: 1.8 */ function delete_all_posts_categories_tags_with_report() { global $wpdb; // 🕒 Track last…Continue reading

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

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

Delete Post, Category, Tag Entries v2

/* 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