I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)
This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_actionscheduler_actions | |
-- INFO: This uses the prefix wp_ - change accordingly. | |
-- ---------------------------- | |
DROP TABLE IF EXISTS `wp_actionscheduler_actions`; | |
CREATE TABLE `wp_actionscheduler_actions` ( | |
`action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
/* | |
* Please note the wp_ prefix and change accordingly if needed! | |
* Also check the table names so you don't drop data of tables already there! | |
*/ | |
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_wc_reserved_stock |
add_filter( 'woocommerce_email_recipient_new_order', 'custom_new_order_recipient', 10, 2 ); | |
function custom_new_order_recipient( $recipient, $order ) { | |
$shipping_zone = WC_Shipping_Zones::get_zone_matching_package( $order->get_shipping_packages() ); | |
if ( $shipping_zone ) { | |
$zone_id = $shipping_zone->get_id(); | |
// You can add more conditions to match specific shipping zones here | |
if ( $zone_id == 1 ) { | |
$recipient .= ', john@example.com'; | |
} elseif ( $zone_id == 2 ) { |
<?php //only copy if needed | |
//filter documented at: https://docs.woocommerce.com/document/woocommerce-pdf-product-vouchers-developer-documentation/#wc_pdf_product_vouchers_voucher_filename | |
add_filter('wc_pdf_product_vouchers_voucher_filename', 'cs_my_own_filename'); | |
function cs_my_own_filename ($filename) { | |
// This is how the variable is defined: $filename = 'voucher-' . sanitize_file_name( $this->get_voucher_number() ) . '.' . $type; | |
// Note: $type may be defined as string. Default $type = 'pdf'; | |
// Note: Do not use this filter to change the number. There are other filters for that. | |
/* | |
* Please note the wp_ prefix and change accordingly if needed! | |
* Also check the table names so you don't drop data of tables already there! | |
*/ | |
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_wc_customer_lookup |
<?php | |
// use of function has_term( 'slug', 'taxonomy_name', $post->ID ); | |
// taxonomy_name for example: Visibility | |
// slug for example: visible | |
// $post->ID = current post | |
$terms = has_term( 'intern', 'artikel_typ', $post->ID ); | |
if($terms) | |
{ |
777 Brockton Avenue, Abington MA 2351 | |
30 Memorial Drive, Avon MA 2322 | |
250 Hartford Avenue, Bellingham MA 2019 | |
700 Oak Street, Brockton MA 2301 | |
66-4 Parkhurst Rd, Chelmsford MA 1824 | |
591 Memorial Dr, Chicopee MA 1020 | |
55 Brooksby Village Way, Danvers MA 1923 | |
137 Teaticket Hwy, East Falmouth MA 2536 | |
42 Fairhaven Commons Way, Fairhaven MA 2719 | |
374 William S Canning Blvd, Fall River MA 2721 |
<?php | |
// change the from name | |
add_filter( 'automatewoo/mailer/from_name', function( $from_name ) { | |
return 'My Custom From Name'; | |
}); | |
// change the from address | |
add_filter( 'automatewoo/mailer/from_address', function( $from_email ) { | |
return 'email@example.org'; |
<?php | |
/* | |
Plugin Name: Custom Image Sizes for WooCommerce | |
Plugin URI: https://themebynumbers.com/ | |
Description: Let's you customize WooCommerce product image sizes from the Customizer | |
Version: 0.1 | |
Author: Mikey Arce | |
Author URI: https://themebynumbers.com | |
Text Domain: custom_image_sizes_for_wc | |
Domain Path: /languages |