Skip to content

Instantly share code, notes, and snippets.

View slushman's full-sized avatar

Chris Wilcoxson slushman

View GitHub Profile
@slushman
slushman / gist:454cc8b26c330727df13
Last active December 28, 2015 08:49
Customize the Featured Image labels
/**
* Changes strings referencing Featured Images for a post type
*
* In this example, the post type in the filter name is "employee"
* and the new reference in the labels is "headshot".
*
* @see https://developer.wordpress.org/reference/hooks/post_type_labels_post_type/
*
* @param object $labels Current post type labels
* @return object Modified post type labels
@slushman
slushman / Sublime Text 3 User Preferences
Created January 13, 2016 04:48
My Sublime Text 3 User Preferences
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
@slushman
slushman / Sublime Text Packages
Created January 13, 2016 05:03
List of Package for Sublime Text 3
Package Control - https://packagecontrol.io/installation
Tomorrow Color Schemes
$homeposts = yourtheme_get_posts( 'post', array( 'category_name' => 'name_of_the_category', 'posts_per_page' => 1 ), 'homepage' );
foreach ( $homeposts->posts as $homepost ) {
// process each post here
}
/**
* Returns a post object of the requested post type
@slushman
slushman / formidable-forms-select.php
Created July 18, 2016 18:14
WordPress Customizer select control with published Formidable forms.
$forms = FrmForm::get_published_forms();
$choices = array();
foreach ( $forms as $form ) {
$choices[$form->id] = $form->name;
}
// Formidable Forms Select Field
@slushman
slushman / Parker Results Cheatsheet.md
Last active October 20, 2016 14:54
Cheatsheet for the results from Parker.
  • Total Stylesheets
    • The quantity of stylesheets it examined.
  • Total Stylesheet Size
    • Size in bytes of the stylesheet(s)
    • Ideal: no real ideal, but smaller is better.
  • Total Rules
    • The quantity of CSS rules in the stylesheet(s).
    • Ideal: no real ideal, but a smaller number here means a simpler stylesheet.
  • Total Selectors
    • The quantity of selectors in the stylesheet(s).
@slushman
slushman / remove-buddybar
Created April 15, 2015 03:57
Remove BuddyPress Admin Bar
/*
Add this line to your wp-config.php file. I put it right above the "Authentication Unique Keys and Salts." comment block.
*/
/** Disable the WP Admin Bar */
define('BP_DISABLE_ADMIN_BAR', true);
@slushman
slushman / themes-security-config.md
Created May 2, 2016 15:31
iThemes Security Configuration

Table of Contents

  • Settings
    • [Global] (#global)
    • [404 Detection] (#404)
    • [Away Mode] (#away)
    • [Banned Users] (#banned)
    • [Brute Force Protection] (#brute)
    • [Backup DB] (#backupdb)
    • [File Change Detection] (#files)
  • [Hide Login] (#hidelogin)
@slushman
slushman / sane-inline-svg
Last active July 26, 2018 20:20
Sane Inline SVG
/**
* Returns the requested SVG icon.
*
* Returns FALSE if $svg is not set.
*
* @param string $svg The name of the SVG icon
* @return mixed The SVG icon
*/
function prefix_get_svg( $svg ) {
export default [
{ value: 'admin-appearance', label: 'Admin Appearance' },
{ value: 'admin-collapse', label: 'Admin Collapse' },
{ value: 'admin-comments', label: 'Admin Comments' },
{ value: 'admin-generic', label: 'Admin Generic' },
{ value: 'admin-home', label: 'Admin Home' },
{ value: 'admin-links', label: 'Admin Links' },
{ value: 'admin-media', label: 'Admin Media' },
{ value: 'admin-network', label: 'Admin Network' },
{ value: 'admin-page', label: 'Admin Page' },