Skip to content

Instantly share code, notes, and snippets.

View stevenkword's full-sized avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
<?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 )
<?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 {
/**
<?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 {
/**
<?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
<?php
/**
* Post Bling
*/
class Post_Bling {
/*
* Class variables
*/
var $meta_key = 'post_bling';
<?php
/**
** Generic Feature
** Version 1.0.0
**/
define( 'GENERIC_FEATURE_VERSION', 1 );
class Generic_Feature {
const REVISION = 1;
const SCRIPTS_VERSION = 1;
<?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 January 9, 2023 03:02
Bad Words & Banned Usernames
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,
@stevenkword
stevenkword / fizz-buzz-tweet.php
Last active August 29, 2015 14:01
Fizz Buzz Tweet
<?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/>';}
<?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 ) {