This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Mute Textdomain Errors | |
* Plugin URI: https://rymera.com.au | |
* Description: Mutes textdomain loading errors and logs them for debugging | |
* Version: 1.0.0 | |
* Author: Rymera Web Co | |
* Author URI: https://rymera.com.au | |
* Text Domain: mute-textdomain-errors | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are a senior software engineer/architect specializing in WordPress and WooCommerce. | |
In this project, implement that basic structure of a new plugin ready for further development | |
using the following details: | |
The plugin will be called [your plugin name here] | |
It is a plugin that [brief description of your new plugin here] | |
WordPress Plugin Project Structure | |
================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* If we don't have translation, disable pre_load_textdomain to speed up the site. | |
*/ | |
add_filter( 'pre_load_textdomain', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('woocommerce_before_cart', 'firstTimeShopper'); | |
add_action('woocommerce_before_checkout_form', 'firstTimeShopper'); | |
function firstTimeShopper() { | |
global $woocommerce; | |
$coupon_code = 'firstimeshopper'; // Change this to whatever your coupon code is | |
if (is_user_logged_in()) { | |
$current_user = wp_get_current_user(); | |