Skip to content

Instantly share code, notes, and snippets.

View stevenkword's full-sized avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
#!/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
@stevenkword
stevenkword / composer.json
Last active August 29, 2015 14:23
WordPress Development Site Scaffold
{
"type":"project",
"repositories":[
{
"type":"composer",
"url":"http://wpackagist.org"
},
{
"type": "vcs",
<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>
// 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;
}
<?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
*/
<?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
/**
** Generic Feature
** Version 1.0.0
**/
define( 'GENERIC_FEATURE_VERSION', 1 );
class Generic_Feature {
const REVISION = 1;
const SCRIPTS_VERSION = 1;