Skip to content

Instantly share code, notes, and snippets.

View willgorham's full-sized avatar

Will G willgorham

View GitHub Profile
@lukecav
lukecav / functions.php
Created September 28, 2017 19:20
Filter by featured products in wp-admin when using WooCommerce
add_action('restrict_manage_posts', 'featured_products_sorting');
function featured_products_sorting() {
global $typenow;
$post_type = 'product'; // change to your post type
$taxonomy = 'product_visibility'; // change to your taxonomy
if ($typenow == $post_type) {
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : '';
$info_taxonomy = get_taxonomy($taxonomy);
wp_dropdown_categories(array(
'show_option_all' => __("Show all {$info_taxonomy->label}"),
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>