Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
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)}.
@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 no-args.php
<?php
register_taxonomy( 'genre', 'book', array(
'label' => __( 'Genre' ),
'public' => false,
'rewrite' => false,
'hierarchical' => true,
) );
View gist:3fddb336e073798a58ee
<?php
/**
* test the RSS 2.0 feed by generating a feed, parsing it, and checking that the
* parsed contents match the contents of the posts stored in the database. Since
* we're using a real XML parser, this confirms that the feed is valid, well formed,
* and contains the right stuff.
*
* @group feed
*/
View svg-example.php
// Place this in functions.php of your theme
function example_mime_types($mimes) {
if( ! current_user_can( 'administrator' ) ) {
return $mimes;
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
View gist:c3e490e31af058b35b41
<div class="two-factor-backup-codes-wrapper" style="display:none;">
<ol class="two-factor-backup-codes-unused-codes"></ol>
<p class="description"><?php esc_html_e( 'Write these down! Once you navigate away from this page, you will not be able to view these codes again.' ); ?></p>
<p>
<a class="a" href="javascript:void(0);" id="two-factor-backup-codes-download-link" download="two-factor-backup-codes.txt">Download</a>
<button type="button" class="button button-two-factor-backup-codes-download button-secondary hide-if-no-js" download="two-factor-backup-codes2.txt">
<?php esc_html_e( 'Download' ); ?>
</button>
<p>
</div>
@stevenkword
stevenkword / composer.json
Last active Aug 29, 2015
WordPress Development Site Scaffold
View composer.json
{
"type":"project",
"repositories":[
{
"type":"composer",
"url":"http://wpackagist.org"
},
{
"type": "vcs",
View fix-wordpress-permissions.sh
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=./ # <-- wordpress root directory
View sr.php
<?php
// Safe Search and Replace on Database with Serialized Data v2.0.0
// This script is to solve the problem of doing database search and replace
// when developers have only gone and used the non-relational concept of
// serializing PHP arrays into single database columns. It will search for all
// matching data on the database and change it, even if it's within a serialized
// PHP array.