// 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
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
/* Plugin Name: MA Custom Fonts Description: Load custom fonts and inject to Gutenberg, Bricks, Oxygen Author: Matthias Altmann Project: Code Snippet MA Custom Fonts Version: 3.4.4 Plugin URI: https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ Description: en: https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ de: https://www.altmann.de/blog/code-snippet-eigene-schriftarten/ Copyright: © 2020-2025, Matthias Altmann…Continue reading
// 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
function custom_hide_shipping_when_free_shipping_is_available( $rates, $package ) { $free_shipping_exists = false; $local_pickup_exists = false; // Check if Free Shipping and/or Local Pickup exist foreach ( $rates as $rate_key => $rate ) { if ( ‘free_shipping’ === $rate->get_method_id() ) { $free_shipping_exists = true;…Continue reading
/* 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
/* 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
add_action( ‘admin_notices’, function() { if ( ! current_user_can( ‘manage_options’ ) ) return; $cleanup_time = get_option( ‘last_run_cleanup’, ‘Never’ ); $purge_time = get_option( ‘last_run_purge’, ‘Never’ ); echo ‘ ‘; echo ‘ 🧹 Cleanup Last Ran: ‘ . esc_html( $cleanup_time ) . ‘‘;…Continue reading
add_action( ‘init’, function() { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { $compat = \Automattic\WooCommerce\Utilities\FeaturesUtil::is_plugin_compatible( ‘custom_order_tables’, ‘ajax-search-for-woocommerce-premium/ajax-search-for-woocommerce.php’ ); add_action( ‘admin_notices’, function() use ( $compat ) { echo ‘ ‘; echo ‘📋 WooCommerce reconhece o FiboSearch como ‘ . ($compat ? ‘compatível…Continue reading