Skip to content

Instantly share code, notes, and snippets.

Nick Kuijpers nickkuijpers

Block or report user

Report or block nickkuijpers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nickkuijpers
nickkuijpers / gist:348697fd344d11c8af67
Created Oct 19, 2015
Unyson save as custom field
View gist:348697fd344d11c8af67
'save-in-separate-meta' => true,
@nickkuijpers
nickkuijpers / gist:9ef8b5e74b513748712f
Created Sep 28, 2015
Contactform 7 On Sent Redirect
View gist:9ef8b5e74b513748712f
on_sent_ok: "location.replace('http://paintballgelderland.nl/boeking-dank-je-wel');"
View WordPress Search For Custom Fields
function custom_search_query( $query ) {
$custom_fields = array(
// put all the meta fields you want to search for here
"fw_options",
);
$searchterm = $query->query_vars['s'];
// we have to remove the "s" parameter from the query, because it will prevent the posts from being found
$query->query_vars['s'] = "";
@nickkuijpers
nickkuijpers / gist:1b74118796af7c81ae96
Created Jul 14, 2015
Bulk Add Domains To DirectAdmin
View gist:1b74118796af7c81ae96
<?php
/**
* Adding domains to DirectAdmin
*/
include 'httpsocket.php';
// domains comma seperated
$domains = 'domein1.nl,domein2.nl,domein3.nl';
View gist:58ac5910c97a8c5debf1
# XML-RPC DDoS PROTECTION
<FilesMatch "^(xmlrpc\.php)">
Order Deny,Allow
Deny from all
</FilesMatch>
# XML-RPC DDoS & TRACKBACK/PINGBACK PROTECTION
# Also block Pingbacks and Trackbacks
<FilesMatch "^(xmlrpc\.php|wp-trackback\.php)">
Order Deny,Allow
Deny from all
@nickkuijpers
nickkuijpers / gist:83808c55b64ed29192ca
Created May 21, 2015
WordPress Unyson Build With Builder
View gist:83808c55b64ed29192ca
$buildwith = fw_ext_page_builder_is_builder_post( get_the_ID() );
if($buildwith == 1){
the_content();
}
@nickkuijpers
nickkuijpers / gist:f05653ef049f0bd1a5ea
Last active Aug 29, 2015
WooCommerce Add Amount Per Page
View gist:f05653ef049f0bd1a5ea
$value = $_POST['woocommerce-sort-by-columns'];
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return ' . $value . ';' ), 20 );
function woocommerce_catalog_page_ordering($value) {
$amounts = array(
20,
30,
80,
160,
View gist:7085ecf5670685a9cb9c
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@nickkuijpers
nickkuijpers / gist:84d4a93c363ac5c5f2d0
Last active Aug 29, 2015
WooCommerce Auto Complete Orders After Payment Received
View gist:84d4a93c363ac5c5f2d0
/**
* Auto Complete all WooCommerce orders.
* Add to theme functions.php file
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order', 1, 1 );
function custom_woocommerce_auto_complete_order( $order_id ) {
global $woocommerce;
if ( !$order_id )
@nickkuijpers
nickkuijpers / gist:9a7cfca7cc7f606af143
Created Apr 17, 2015
WooCommerce Extra E-mail Notification
View gist:9a7cfca7cc7f606af143
add_filter( 'woocommerce_email_headers', 'add_bcc_to_wc_admin_new_order', 10, 3 );
function add_bcc_to_wc_admin_new_order( $headers = '', $id = '', $wc_email = array() ) {
if ( $id == 'customer_completed_order' ) {
$headers .= "Bcc: info@niku-solutions.nl\r\n"; // replace my_personal@email.com with your email
}
return $headers;
}
You can’t perform that action at this time.