Skip to content

Instantly share code, notes, and snippets.

View keesiemeijer's full-sized avatar

Kees Meijer keesiemeijer

View GitHub Profile
@keesiemeijer
keesiemeijer / gist:6498235
Last active February 3, 2017 15:27
Adds WordPress top level admin menu items to the toolbar (admin bar) on the front end.Adds post types items and their taxonomies to the toolbar on the front end.Items are added based on the current users capabilities.
<?php
/**
* Add back end wp-admin menu items to the front end toolbar 'site-name' node.
* Menu items are added based on the current users capabilities.
*/
class KM_WP_Admin_Bar_Front_End_Menu {
/**
* Prefix for toolbars ids
@keesiemeijer
keesiemeijer / functions.php
Created January 26, 2013 18:47
Adds filters to a query
<?php
// don't use the php tags when copying this in your own theme's functions.php
function add_new_query_vars($public_query_vars) {
$public_query_vars[] = 'posts_fields';
$public_query_vars[] = 'posts_join';
$public_query_vars[] = 'posts_where';
$public_query_vars[] = 'posts_orderby';
return $public_query_vars;
}