Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
View get_current_post_type.php
<?php
/**
* Gets the current global post type if one is set
*/
function x_get_current_post_type() {
global $post, $typenow, $current_screen;
if( $post && $post->post_type )
$post_type = $post->post_type;
elseif( $typenow )
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 {
/**
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 {
/**
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-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 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;
@stevenkword
stevenkword / bad-words.txt
Last active Aug 29, 2015
Bad Words & Banned Usernames
View bad-words.txt
www, web, root, admin, main, invite, administrator, files, blog, blogs, members, member, user, users, profile, profiles, presentation, presentations, slide, slides, wordpress, buddypress, sysop, system, mail, ahole, anus, ash0le, ash0les, asholes, ass, Ass Monkey, Assface, assh0le, assh0lez, asshole, assholes, assholz, asswipe, azzhole, bassterds, bastard, bastards, bastardz, basterds, basterdz, Biatch, bitch, bitches, Blow, Job, boffing, butthole, buttwipe, c0ck, c0cks, c0k, Carpet Muncher, cawk, cawks, Clit, cnts, cntz, cock, cockhead, cock-head, cocks, CockSucker, cock-sucker, crap, cum, cunt, cunts, cuntz, dick, dild0, dild0s, dildo, dildos, dilld0, dilld0s, dominatricks, dominatrics, dominatrix, dyke, enema, fag, fag1t, faget, fagg1t, faggit, faggot, fagit, fags, fagz, faig, faigs, fart, flipping the bird, fuck, fucker, fuckin, fucking, fucks, Fudge, Packer, fuk, Fukah, Fuken, fuker, Fukin, Fukk, Fukkah, Fukken, Fukker, Fukkin, g00k, gay, gayboy, gaygirl, gays, gayz, God-damned, h00r, h0ar, h0re, hells,
View fizz-buzz-tweet.php
<?php
// FizzBuzz? Here, let me tweet that to you:
foreach(range(1,100)as$n){echo$n.':'.((0==$n%5)?'Fizz':'').((0==$n%3)?'Buzz':'').'<br/>';}
View wp-wildcard-user-search.php
<?php
/**
* Search for users by name and return a JSON object of matches
*
* An example method that demonstrates how to use wildcards (*'s) when
* looking up users. This particular example would be used to create
* a new endpoint that would output a JSON array of returned users.
* Something like this would be useful for JS autocomplete queries.
*/
function skw_user_autocomplete( $search_term ) {