Skip to content

Instantly share code, notes, and snippets.

View Critter's full-sized avatar

Critter Critter

View GitHub Profile
<?php
/*
* replace icons in Social Media Feather with custom icons
* @ref: http://wordpress.org/plugins/social-media-feather/
*/
add_filter('synved_social_skin_image_list', 'custom_social_feather_icons');
function custom_social_feather_icons($image_list) {
Sources
46&2 Beta Repository
http://repo.fortysixandtwo.com/
Alex Zielenski
http://repo.alexzielenski.com/
apt.dba-technologies.combeta
http://apt.dba-technologies.com/beta/
@Critter
Critter / How_to_use.php
Last active August 29, 2015 14:08 — forked from hakre/gist:826061
WP_Query Columns
<?php foreach(new WP_Query_Columns($the_query, 10) as $column_count) : ?>
<ul>
<?php while ($column_count--) : $the_query->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endforeach; ?>
@Critter
Critter / gist:032a7a35693a63bfe374
Created November 6, 2014 05:36
iphone6 resolution for iphone5
Download Cycript onto your Device.
If you have your computer handy, SSH into it by running "ssh root@192.168.2.3" or whatever your IP is and enter your password.
By default it is "alpine" without the quotations but you may have changed it. Once you've SSH'd in, run this
(Make sure to open the preferences app first)
cycript -p Preferences
Then
<?php
/*
Plugin Name: Convert Custom Taxonomy to Custom Post Type
Plugin URI: N/A
Description: A plugin to convert a Custom Taxonomy to a Custom Post Type and transfer associated metadata.
Version: 0.1
Author: Strap1
Author URI: http:/www.hiphopinenglish.com
/** Convert Taxonomy '%name%' to CPT '%name%' **/
@Critter
Critter / functions.php
Last active August 29, 2015 14:20
prevent posting to Wordpress
add_filter( 'wp_insert_post_data', 'post_publish_filter_wpse_82356' );
function post_publish_filter_wpse_82356( $data ) {
// view/manipulate $data
// we still need to be able to post pages and products so just kill off attempted posts
if ('publish' == $data['post_status'] && 'post' == $data['post_type']) {
$msg = '<pre>' . var_export($data, true) . '</pre>';
wp_die($msg);
}
return $data;
}
@Critter
Critter / functions.php
Created June 8, 2015 02:54
Create 2-column forms using gravity forms
function gform_column_splits($content, $field, $value, $lead_id, $form_id) {
if(!is_admin()) { // only perform on the front end
if($field['type'] == 'section') {
$form = RGFormsModel::get_form_meta($form_id, true);
// check for the presence of multi-column form classes
$form_class = explode(' ', $form['cssClass']);
$form_class_matches = array_intersect($form_class, array('two-column', 'three-column'));
// check for the presence of section break column classes

Keybase proof

I hereby claim:

  • I am critter on github.
  • I am critter (https://keybase.io/critter) on keybase.
  • I have a public key whose fingerprint is D192 0005 1829 205C FFB4 734C 5B7F 272A A63B 6BD7

To claim this, I am signing this object:

@Critter
Critter / .htaccess
Created June 6, 2013 17:23
Redirect all except my IP to subdirectory using .htaccess
# my ip
RewriteCond %{REMOTE_HOST} !^255\.255\.255\.255
# this prevents looping
RewriteCond %{REQUEST_URI} !^/maintenance/?
RewriteCond %{REQUEST_URI} /(.*)$
# the redirect
RewriteRule (.*) /maintenance [R=301,L]
@Critter
Critter / gist:5731290
Created June 7, 2013 18:21
Find base 64 decode in php files
find . -name "*.php" -print0 | xargs -0 grep -i -n "eval(base64_decode(" > output.txt