This file contains 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
# Specify the shell | |
SHELL := bash | |
# Site URL | |
OLD_URL = https://domain.test | |
NEW_URL = https://www.domain.com | |
# Commands to execute | |
execute: |
This file contains 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
#!/bin/bash | |
LOCATION=${HCLOUD_LOCATION:-nbg1-dc3} | |
if [ -z "$HCLOUD_TOKEN" ]; then | |
echo "You need to set HCLOUD_TOKEN to an Hetzner API token!"; | |
exit 1 | |
fi | |
if [ -z "$SSH_KEY" ]; then |
This file contains 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 term page | |
function codeagency_taxonomy_add_new_meta_field() { | |
// this will add the custom meta field to the add new term page | |
?> | |
<div class="form-field"> | |
<label for="term_meta[en_translation]"><?php _e( 'en_translation', 'codagency' ); ?></label> | |
<input type="text" name="term_meta[en_translation]" id="term_meta[en_translation]" value=""> | |
</div> | |
<div class="form-field"> | |
<label for="term_meta[fr_translation]"><?php _e( 'fr_translation', 'codagency' ); ?></label> |
This file contains 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
/* | |
Description: unset WooCommerce billing & shipping address_1 field in checkout in favor for 2 new custom fields street and houseno | |
Author: Code Agency | |
Author URI: https://codeagency.be | |
*/ | |
function codeagency_remove_checkout_fields( $fields ) { | |
// Billing fields | |
// unset( $fields['billing']['billing_company'] ); | |
// unset( $fields['billing']['billing_email'] ); |
This file contains 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
/** | |
* Disable out of stock variations | |
* https://github.com/woocommerce/woocommerce/blob/826af31e1e3b6e8e5fc3c1004cc517c5c5ec25b1/includes/class-wc-product-variation.php | |
* @return Boolean | |
* Description: unset WooCommerce billing & shipping address_1 field in checkout in favor for 2 new custom fields street and houseno | |
* Author: Code Agency | |
* Author URI: https://codeagency.be | |
*/ | |
function codeagency_variation_is_active( $active, $variation ) { |
This file contains 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 | |
/* | |
* Code snippet to make login form with Fluent Forms WordPress Plugins | |
* Steps: | |
* 1. make a form with email and password (Make sure the name attribute is 'email' and 'password' for corresponding field) | |
* 2. Paste the shorcode in a page | |
* 3. Change the form id in the bellow code (23) with your created fluentform's form id and paste in your theme's functions.php file | |
* 4. That's it | |
* |
This file contains 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 | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
if ('object' !== typeof FWP) { | |
return; | |
} | |
$(function() { |
This file contains 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 our Custom Fields to simple products | |
*/ | |
function mytheme_woo_add_custom_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Text Field |
This file contains 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
#cloud-config | |
package_update: true | |
package_upgrade: true | |
package_reboot_if_required: true | |
manage-resolv-conf: true | |
resolv_conf: | |
nameservers: | |
- '8.8.8.8' |
This file contains 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
// Generating dynamically the product "regular price" | |
add_filter( 'woocommerce_product_get_regular_price', 'custom_dynamic_regular_price', 10, 2 ); | |
add_filter( 'woocommerce_product_variation_get_regular_price', 'custom_dynamic_regular_price', 10, 2 ); | |
function custom_dynamic_regular_price( $regular_price, $product ) { | |
if( empty($regular_price) || $regular_price == 0 ) | |
return $product->get_price(); | |
else | |
return $regular_price; | |
} |