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
.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 | |
/** | |
* 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'); |
<?php | |
function tidaweb_image_url_to_base64( $attach_id ) | |
{ | |
// get image src -> $image_info[0] | |
$image_info = wp_get_attachment_image_src( $attach_id, 'full' ); | |
$image_file = file_get_contents( $image_info[0] ); | |
// get filename from url | |
$filename = basename( get_attached_file( $attach_id ) ); | |
$image_file_type = wp_check_filetype( $filename ); |
;(function($) { | |
var JA_Custom_Validation = { | |
/** | |
* Start the engine. | |
* | |
* @since 1.0.0 | |
*/ | |
init: function() { |
<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] |
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:
<?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']); |
Recently WooCommerce has added a lot of improvements to the plugin which we really appriciate but at the same time a lot of bloated features has alos been added to the plugin like Marketing Hub, a completely useless menu taking extra space among the other important menu items. Now if you find Marketing Hub to be useful, you can keep it.
But just in case you are looking for a way to remove these features that you no longer need from your WordPress Admin menus, take a look at the following code snippets. Please note: though I will show you how you can remove the Marketing Hub from your WP Admin menu list completely and make sure WooCommerce doesn't execute codes for that feature you don't need, you can do the same for other WooCommerce features as well like Analytics.
If you are using WooCommerce <= v4.2, you can simple add this one line of code in your theme's functions.php
f