Skip to content

Instantly share code, notes, and snippets.

@nicholasohrn
Created August 24, 2021 01:06
Show Gist options
  • Save nicholasohrn/8957767031b1a669a8079127654a8371 to your computer and use it in GitHub Desktop.
Save nicholasohrn/8957767031b1a669a8079127654a8371 to your computer and use it in GitHub Desktop.
<?php
if (defined('WP_CLI') && WP_CLI && is_callable('WP_CLI', 'add_command')) {
// BAT: Cache
\WP_CLI::add_command('insert-emoji-into-database', function() {
global $wpdb;
$result = $wpdb->query("INSERT INTO {$wpdb->prefix}gf_entry_meta (entry_id, form_id, meta_key, meta_value, item_index) VALUES (0, 0, 'x', '🎉', 0);");
echo "{$result}\n\n{$wpdb->last_error}";
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment