View gist:e60d01f0774d731f870b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'onUploadProgress' : function(file, fileBytesLoaded, fileTotalBytes, queueBytesLoaded, queueDataUploadSize) { | |
// Triggered periodically during a file upload | |
var perc = Math.round(fileBytesLoaded / fileTotalBytes * 100); | |
var progress = ( perc < 99 ) ? 'Uploading ' + perc + '%' : '<i class="fa fa-cog fa-spin"></i> Processing: ' + file.name; | |
if( perc >= 99 ){ | |
$('.uploadify-queue').fadeOut(); | |
}; | |
$('#progress').html(progress).show(); | |
}, |
View httpd-vhosts.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## OLD WAY | |
<VirtualHost *:80> | |
##ServerAdmin postmaster@dummy-host2.localhost | |
DocumentRoot "C:/Development/personal-projects/grammys/site/application" | |
ServerName grammys.localhost | |
##ServerAlias www.dummy-host2.localhost | |
ServerAlias *.grammys.localhost | |
ErrorLog "logs/grammys.localhost-error.log" | |
CustomLog "logs/grammys.localhost-access.log" combined | |
View Remove Category Dropdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove the category taxonomy drop down from the posts lists table | |
* | |
* @param string $output The resulting HTML to build the select dropdown | |
* @param array $r The array of arguments to build the select dropdown | |
* | |
* @return string $output The filtered HTML of the dropdown | |
*/ |
View Remove Category column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customize columns on list table | |
* | |
* @access public | |
* @since 1.0 | |
* | |
* @param array $columns An array of indexes that appear on the posts lists table | |
* @return array $columns The filtered array of table columns |
View gist:62e4fac0600895d5b879
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'parse_request', 'check_for_redirect' ); | |
function check_for_redirect( $query ) { | |
if( is_admin() ){ | |
return; | |
} | |
if( isset($query->query_vars[ 'pagename' ]) ){ | |
$pagename = $query->query_vars[ 'pagename' ]; |
View body_id.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create a dynamic id on body elements | |
function get_body_id( $id = '' ) { | |
global $wp_query; | |
// Fallbacks | |
if ( is_front_page() ) $id = 'front-page'; | |
if ( is_home() ) $id = 'blog'; | |
if ( is_search() ) $id = 'search'; | |
if ( is_404() ) $id = 'error404'; |
View google-img-map-link.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Build a Static Map link to Google Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. |
View hideemail.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide email from Spam Bots using a shortcode. | |
* | |
* @param array $atts Shortcode attributes. Not used. | |
* @param string $content The shortcode content. Should be an email address. | |
* | |
* @return string The obfuscated email address. | |
*/ | |
function _ss_hide_email_shortcode( $atts , $content = null ) { |
View bing-map-link.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Build a link to Bing Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. | |
*/ |
View google-map-link.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Build a link to Google Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. |
OlderNewer