#Setup
- Make sure your ssh public key is registered on the remote server.
- vim /etc/ssh/sshd_config
- Make sure the config values reflect the following -
ChallengeResponseAuthentication no; PasswordAuthentication no; UsePAM no;
- service sshd restart.
#Setup
ChallengeResponseAuthentication no; PasswordAuthentication no; UsePAM no;
# Plugin list stored in an array. | |
pluginsList=( | |
wordpress-seo | |
) | |
# Install plugins | |
for plugin in "${pluginsList[@]}" | |
do | |
echo ""; | |
echo "Install $plugin"; |
wp eval '$args = array( | |
"post_type" => array( "product" ), | |
"numberposts" => 250, | |
); | |
while($products = get_posts( $args )){ | |
foreach($products as $product){ | |
wp_delete_post( $product->ID, $force_delete = true ); | |
} | |
}' |
<?php | |
// Add save percent next to sale item prices. | |
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 ); | |
function woocommerce_custom_sales_price( $price, $product ) { | |
$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 ); | |
if($percentage <= 0){ | |
return $price; | |
} | |
return $price . sprintf( __(' Save %s', 'woocommerce' ), $percentage . '%' ); | |
} |
// Call for registering woocommerce order post status | |
add_action( 'init', 'woocommerce_post_status' ); | |
/** | |
* WooCommerce order post status callback | |
* | |
*/ | |
function woocommerce_post_status(){ | |
register_post_status( 'wc-waiting-fulfillment', array( | |
'label' => _x( 'Waiting Fulfillment', 'Order status', 'woocommerce' ), |
/** | |
* WooCommerce woocommerce_order_item_line_item_html action hook registeration. | |
*/ | |
add_action('woocommerce_order_item_line_item_html', 'woocommerce_order_item_line_item_html', 1, 3); | |
/** | |
* Callback Listener for customised line item functionality in the admin. | |
*/ | |
function woocommerce_order_item_line_item_html($item_id, $item, $order){ |