WordPress development environment on Mac with Brew, Nginx, PHP 7, PHP-FPM, MariaDB, phpMyAdmin and more
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
<?php | |
/** | |
* Written by Amri Shodiq. | |
* Do not hesitate to copy and paste this code. | |
* It's not embarassing. | |
*/ | |
if (!defined('BASEPATH')) | |
exit ('No direct script access allowed'); |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#Removes access to the system folder by users. | |
#Additionally this will allow you to create a System.php controller, | |
#previously this would not have been possible. | |
#'system' can be replaced if you have renamed your system folder. | |
RewriteCond %{REQUEST_URI} ^system.* | |
RewriteRule ^(.*)$ /index.php?/$1 [L] |
.jetpack_subscription_widget .widget-wrap { | |
background: url("images/enews.png") no-repeat 260px 15px; | |
} | |
#subscribe-email #subscribe-field { | |
width: 175px; | |
padding: 5px; | |
font-size: 13px; | |
margin: 10px -2px 0 0; | |
} |
<?php | |
/* | |
Template Name: Sales Page | |
*/ | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'dm_add_body_class' ); | |
function dm_add_body_class( $classes ) { | |
$classes[] = 'dm-sales'; |
<?php | |
/* | |
Plugin Name: WooCommerce Subscriptions No $0 Emails | |
Plugin URI: | |
Description: Do not send processing or completed renewal order emails to customers when the order or renewal is for $0.00. | |
Author: | |
Author URI: | |
Version: 0.1 | |
*/ | |
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Prevent direct access | |
} | |
/** | |
* This is an example trigger that is triggered via a WordPress action and includes a user data item. | |
* Trigger with: do_action('my_custom_action', $user_id ); | |
*/ |
;(function($) { | |
var JA_Custom_Validation = { | |
/** | |
* Start the engine. | |
* | |
* @since 1.0.0 | |
*/ | |
init: function() { |
<?php | |
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' ); | |
function custom_remove_woo_checkout_fields( $fields ) { | |
// remove billing fields | |
unset($fields['billing']['billing_first_name']); | |
unset($fields['billing']['billing_last_name']); | |
unset($fields['billing']['billing_company']); |
To set up php linting, you’ll want to install this PHP CodeSniffer repo and configure with this WordPress Coding Standards repo: . There are a number of ways to do this, whether direct download, Composer, Homebrew, Pear, etc. The following is what works for me on MacOS using Homebrew:
In a terminal window on your Mac, start by updating your Homebrew.
brew doctor
Then install the Code Sniffer: