Skip to content

Instantly share code, notes, and snippets.

Steve Taylor gyrus

Block or report user

Report or block gyrus

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
@gyrus
gyrus / gist:3034668
Created Jul 2, 2012
gitconfig for GitHub -> plugins.svn.wordpress.org
View gist:3034668
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
@gyrus
gyrus / local-config.php
Last active Oct 7, 2015
WordPress local config file
View local-config.php
<?php
/**
* Local configuration of WordPress, for Pilau Starter
*
* @link http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/
* @link https://github.com/pilau/starter/wiki/How-to-use
*/
define( 'DB_NAME', '[[local-db-name]]' );
@gyrus
gyrus / sample-html5.html
Created Jul 19, 2012
Sample of HTML5 markup for testing CSS
View sample-html5.html
<!--
Created for testing the Pilau Starter theme
Adapted from: http://www.cs.tut.fi/~jkorpela/www/testel.html
@todo Make it better! Add new HTML5 elements
-->
<div id="content">
<h1>Testing display of HTML elements</h1>
<h2>This is 2nd level heading</h2>
@gyrus
gyrus / gist:3155816
Created Jul 21, 2012
WordPress login link
View gist:3155816
<?php
/**
* Nice WordPress admin login link
*/
function pilau_wp_login_link() {
if ( is_user_logged_in() ) {
echo '<a href="/wp-admin/">' . __( 'Admin' ) . '</a>';
} else {
echo '<a href="' . wp_login_url() . '">' . __( 'Login' ) . '</a>';
@gyrus
gyrus / gist:3155823
Created Jul 21, 2012
Force WordPress login
View gist:3155823
<?php
/**
* Force WordPress login
*/
add_action( 'init', 'pilau_force_login' );
function pilau_force_login() {
if ( ! is_user_logged_in() && $_SERVER["SCRIPT_NAME"] != '/wp-login.php' ) {
wp_redirect( wp_login_url() );
exit();
@gyrus
gyrus / gist:3155850
Created Jul 21, 2012
Remove WordPress content editor
View gist:3155850
<?php
/**
* Remove WordPress content editor from certain pages
* Add page IDs to the array
*/
add_action( 'do_meta_boxes', 'pilau_remove_editor' );
function pilau_remove_editor() {
global $post;
if ( in_array( $post->ID, array( ) ) )
@gyrus
gyrus / gist:3155971
Created Jul 21, 2012
WordPress custom post type taxonomy list filters
View gist:3155971
<?php
/**
* Taxonomy list filters and columns
*
* @todo Test!
* @todo Need replacement function for slt_terms_list()
* @link http://wordpress.stackexchange.com/questions/578/adding-a-taxonomy-filter-to-admin-list-for-a-custom-post-type/3215#3215
*/
add_action( 'restrict_manage_posts', 'pilau_restrict_manage_posts' );
@gyrus
gyrus / gist:3155982
Created Jul 21, 2012
Rename WordPress "Posts" to "News"
View gist:3155982
<?php
/**
* Rename "Posts" to "News"
*
* @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/
*/
add_action( 'admin_menu', 'pilau_change_post_menu_label' );
add_action( 'init', 'pilau_change_post_object_label' );
function pilau_change_post_menu_label() {
@gyrus
gyrus / shortcodes.php
Last active Jun 11, 2018
TinyMCE button for WordPress shortcode
View shortcodes.php
<?php
/**
* Skeletal sample shortcode
*/
add_shortcode( 'pilau-sample', 'pilau_sample_shortcode' );
function pilau_sample_shortcode( $atts ) {
extract( shortcode_atts( array(
'text' => ''
), $atts ) );
@gyrus
gyrus / gist:3156901
Created Jul 21, 2012
Put WordPress custom post types in a global variable
View gist:3156901
<?php
/**
* Store public custom post types in global variable
*/
add_action( 'init', 'pilau_custom_post_types_var', 1 );
function pilau_custom_post_types_var() {
global $pilau_custom_post_types;
$pilau_custom_post_types = get_post_types( array(
'public' => true,
You can’t perform that action at this time.