Skip to content

Instantly share code, notes, and snippets.

View BoweFrankema's full-sized avatar

Bowe Frankema BoweFrankema

View GitHub Profile
@markoheijnen
markoheijnen / gist:3110599
Last active October 7, 2015 05:08
Register widgets to a sidebar by code
<?php
class Rockstars_Widget {
private $custom_settings = array();
public function register_default_widget( $sidebar, $class_name, $settings ) {
global $_wp_sidebars_widgets, $wp_widget_factory;
if( empty( $_wp_sidebars_widgets[ $sidebar ] ) ) {
if( isset( $wp_widget_factory->widgets[ $class_name ] ) ) {
@luetkemj
luetkemj / wp-query-ref.php
Last active April 6, 2025 09:15
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/