sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y apache2
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
// Get WordPress site name via shortcode: [nf_site_name] | |
function nf_site_name_shortcode() { | |
return get_bloginfo('name'); | |
} | |
add_shortcode('nf_site_name','nf_site_name_shortcode'); |
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
function cp_change_post_object() { | |
$get_post_type = get_post_type_object('post'); | |
$labels = $get_post_type->labels; | |
$labels->name = 'Newsroom'; | |
$labels->singular_name = 'Newsroom'; | |
$labels->add_new = 'Add News'; | |
$labels->add_new_item = 'Add News'; | |
$labels->edit_item = 'Edit News'; | |
$labels->new_item = 'News'; | |
$labels->view_item = 'View News'; |
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
{ | |
"locations": [ | |
{ | |
"name": "New York", | |
"slug": "", | |
"description": "", | |
"meta": [ | |
{"image_id" : 45}, | |
{"_icon" : ""} | |
], |
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
/** | |
* WordPress URL Exclude List for Screaming Frog Spider | |
* @author TJ Kelly - https://tjkelly.com | |
* @desc Full article — https://tjkelly.com/blog/screaming-frog-exclude-wordpress/ | |
* @date 2021-07-08 | |
*/ | |
https://example.com/wp-content/.* | |
https://example.com/wp-content/mu-plugins/.* | |
https://example.com/wp-content/plugins/.* |
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
/** | |
* @snippet WooCommerce Display Separate Cart Items for Product Quantity > 1 | |
* @author Carla Chalmers | |
* @testedwith WooCommerce 3.5.1 | |
*/ | |
// ------------------- | |
// Split product quantities into multiple cart items | |
// Note: this is not retroactive - empty cart before testing |
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
/** Change obligatory-optional status on billing fields | |
* true = required | |
* false = optional | |
*/ | |
add_filter('woocommerce_billing_fields', 'force_billing_fields', 1000, 1); | |
function force_billing_fields($fields) { | |
$fields['billing_first_name']['required'] = false; //First Name | |
$fields['billing_last_name']['required'] = false; //Last Name | |
$fields['billing_email']['required'] = false; //Email | |
$fields['billing_phone']['required'] = false; //Phone number |
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_filter( 'woocommerce_checkout_fields' , 'ahmadyani_checkout_field_defaults', 20 ); | |
function ahmadyani_checkout_field_defaults( $fields ) { | |
$user = get_user_meta(get_current_user_id()); | |
$first_name = $user ? $user['shipping_first_name'][0] : ''; | |
$last_name = $user ? $user['shipping_last_name'][0] : ''; | |
$company = $user ? $user['shipping_company'][0] : ''; | |
$shipping_address_1 = $user ? $user['shipping_address_1'][0] : ''; | |
$shipping_address_2 = $user ? $user['shipping_address_2'][0] : ''; | |
$shipping_city = $user ? $user['shipping_city'][0] : ''; | |
$shipping_state = $user ? $user['shipping_state'][0] : ''; |
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
/** | |
* @snippet WooCommerce Display Separate Cart Items for Product Quantity > 1 | |
* @author Carla Chalmers | |
* @testedwith WooCommerce 3.5.1 | |
*/ | |
// ------------------- | |
// Split product quantities into multiple cart items | |
// Note: this is not retroactive - empty cart before testing |
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
# Location: /mnt/c/windows/system32/drivers/etc/hosts | |
127.0.0.1 virtualhost.local www.virtualhost.local |
NewerOlder