Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
@stevenkword
stevenkword / pre-commit
Last active Jan 14, 2019
Precommit Hook for running PHPCS w/ PSR2 (php only)
View pre-commit
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/local/bin/phpcs
PHPCS_CODING_STANDARD=PSR2
View wp-cli-batch-import.sh
# Activate the wordpress importer
wp plugin activate wordpress-importer --url=http://localhost/example.com/
# Iterate over all of the import files in a given folder.
for f in myfolder/*.xml; do wp import $f --authors=skip --skip=attachment --url=localhost/example.com/; done
View keybase.md

Keybase proof

I hereby claim:

  • I am stevenkword on github.
  • I am stevenkword (https://keybase.io/stevenkword) on keybase.
  • I have a public key ASBBUQ8nHZ5tdGEPk7UbGToofsF4gLxBofpoTNN-erRXGAo

To claim this, I am signing this object:

View multisite-recap-boilerplate.txt
Post Title:
Multisite Recap for the week of {F jS (month + day)}
-----------------------------
Post Content:
<h2>Office Hours Recap</h2>
The <a href="https://make.wordpress.org/core/{Y}/{m}/{d}/multisite-agenda-for-the-week-of-{F}-{jS}/">agenda for this office hours meeting</a> included/was {(brief one-sentence description of original meeting agenda)}.
View no-args.php
<?php
register_taxonomy( 'genre', 'book', array(
'label' => __( 'Genre' ),
'public' => false,
'rewrite' => false,
'hierarchical' => true,
) );
View wp-widget-generic.php
<?php
/**
** Generic Widget
** Version 1.0.0
**/
define( 'GENERIC_WIDGET_VERSION', 1 );
class Generic_Widget extends WP_Widget {
const OPTION_VERSION = 'generic_widget_version';
const SCRIPTS_VERSION = 1;
View wp-class-post-bling.php
<?php
/**
* Post Bling
*/
class Post_Bling {
/*
* Class variables
*/
var $meta_key = 'post_bling';
View wp-class-generic-feature.php
<?php
/**
** Generic Feature
** Version 1.0.0
**/
define( 'GENERIC_FEATURE_VERSION', 1 );
class Generic_Feature {
const REVISION = 1;
const SCRIPTS_VERSION = 1;
View lift-comment-facet.php
<?php
define( 'lift_comment_facet_version', 1 );
add_action( 'init', function() {
if ( class_exists( 'Lift_Search' ) ) {
//field name, field type
$comment_field = liftField( 'comment_count', 'uint' )
//add field to parse_request handling so it gets passed to the global WP_Query
->addRequestVars( 'comment_count' )
//set the delegate for adding the field value to the document sent to CS
View wp-customize-image-reloaded.php
<?php
/**
* Customize Image Reloaded Class
*
* Extend WP_Customize_Image_Control allowing access to uploads made within
* the same context
*
*/
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control {
/**