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 | |
/** | |
* Login endpoint. | |
* | |
* @package @@pkg.name | |
* @version @@pkg.version | |
* @author @@pkg.author | |
* @license @@pkg.license | |
*/ |
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 | |
printf "Plugin name: " | |
read NAME | |
printf "Destination folder: " | |
read FOLDER | |
printf "Include Grunt support (y/n): " | |
read GRUNT |
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 | |
/** | |
* Remove default WordPress and WooComerce image crops | |
* | |
* @since 1.0.0 | |
* @access public | |
* | |
* @return void | |
*/ | |
add_filter( 'intermediate_image_sizes_advanced', function( $sizes ) { |
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 | |
// The config.php file | |
/** | |
* Set the following constants in wp-config.php | |
* These should be added somewhere BEFORE the | |
* constant ABSPATH is defined. | |
*/ | |
define( 'SMTP_USER', '[email protected]' ); // Username to use for SMTP authentication | |
define( 'SMTP_PASS', 'smtp password' ); // Password to use for SMTP authentication |
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
/** | |
* Disables WordPress Rest API for external requests | |
* | |
* @since 1.0.0 | |
* @access public | |
* | |
* @return void | |
*/ | |
add_action( 'rest_api_init', function() { | |
$whitelist = array('127.0.0.1', "::1"); |
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
# Create a new jail via Plesk | |
# generated in /etc/fail2ban/jail.local | |
[wp-auth] | |
enabled = true | |
filter = wp-auth | |
action = iptables-multiport[name=NoAuthFailures, port="http,https"] | |
logpath = /var/www/vhosts/system/*/logs/*access*log | |
/var/log/httpd/*access_log | |
maxretry = 15 |
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_action('woocommerce_payment_complete', 'custom_process_order', 10, 1); | |
function custom_process_order($order_id) { | |
$order = new WC_Order( $order_id ); | |
$myuser_id = (int)$order->user_id; | |
$user_info = get_userdata($myuser_id); | |
$items = $order->get_items(); | |
foreach ($items as $item) { | |
if ($item['product_id']==24) { | |
// Do something clever | |
} |
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
http://www.benblanco.com/how-to-add-custom-product-tab-to-woocommerce-single-product-page/ | |
http://www.remicorson.com/mastering-woocommerce-products-custom-fields/ | |
// Display Fields | |
add_action( 'woocommerce_product_options_general_product_data', __NAMESPACE__.'\woo_add_custom_general_fields' ); | |
function woo_add_custom_general_fields() { | |
global $woocommerce, $post; |
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 | |
/* | |
* Plugin Name: WooCommerce Stripe Gateway | |
* Plugin URI: https://wordpress.org/plugins/woocommerce-gateway-stripe/ | |
* Description: Take credit card payments on your store using Stripe. | |
* Author: WooCommerce | |
* Author URI: https://woocommerce.com/ | |
* Version: 3.2.3 | |
* Requires at least: 4.4 | |
* Tested up to: 4.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
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'woocommerce' ), | |
'target' => 'my_custom_product_data', | |
'class' => array( 'show_if_simple' ), | |
); | |
return $product_data_tabs; | |
} |
NewerOlder