Skip to content

Instantly share code, notes, and snippets.

View dknauss's full-sized avatar

Dan Knauss dknauss

View GitHub Profile
@dknauss
dknauss / wp-disable-login-form.php
Last active February 9, 2025 21:48 — forked from daggerhart/wp-disable-login-form.php
The WordPress login form never loads unless a "secret" key-value pair exists as a URL parameter.
add_filter( 'wp_login_errors', 'login_form_lockdown', 90, 2 );
/**
* This code locks down the WordPress login form by hijacking the page via the 'wp_login_errors' hook and only executing the
* login header, footer, and necessary closing tags unless a URL parameter (defined in the function) is included in the request.
* If the parameter exists, the full login form is returned in the error object.
*
* Without the "secret" key-value pair passed as a URL parameter, all login pages will be blank except for any HTML/CSS loaded
* prior to wp_login_errors, such as the default wordpress.org-linked WordPress logo above the (absent) login form.
*
@dknauss
dknauss / functions.php
Created February 23, 2017 05:43 — forked from woogist/functions.php
Autocomplete all WooCommerce orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}