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
/** | |
* Filter smilies to allow SVG format with PNG fallback (IE7-IE8) | |
* @license http://www.gnu.org/licenses/gpl-3.0.html | |
* @since 1.0.0 | |
*/ | |
add_filter('smilies_src','my_svg_smilies_src', 1, 10); | |
function my_svg_smilies_src($img_src, $img, $siteurl) { | |
$img = rtrim($img, "gif"); // Remove GIF |
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 | |
/** | |
* Adds a simple WordPress pointer to Settings menu | |
*/ | |
function thsp_enqueue_pointer_script_style( $hook_suffix ) { | |
// Assume pointer shouldn't be shown | |
$enqueue_pointer_script_style = false; |
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 | |
# License: Public Domain | |
# I recommend replacing 'my_' with your own prefix. | |
function my_template_path() { | |
return My_Wrapping::$main_template; | |
} |
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 namespace PaintedCloud\WP\Classes; | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
class CustomTaxonomy { | |
protected $textdomain; | |
protected $taxonomies; | |
public function __construct ( $textdomain ) |
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 namespace PaintedCloud\WP\Classes; | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
class CustomPost { | |
protected $textdomain; | |
protected $posts; | |
public function __construct( $textdomain ) |
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 | |
/** | |
* Show Mad Mimi subscriber count w/cache. | |
*/ | |
function jm_madmimi_subscribers() { | |
$email = ''; | |
$api = ''; | |
// check and get cached subscriber count |
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
<html> | |
<head> | |
<title>Critical Path: Measure</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<link href="style.css" rel="stylesheet"> | |
<script> | |
function measureCRP() { | |
var t = window.performance.timing, | |
interactive = t.domInteractive - t.domLoading, |
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
@-webkit-keyframes float-up { | |
0% { opacity: 0; top: 4rem; } | |
100% { opacity: 1; top: 0; } | |
} | |
.float-up { | |
opacity: 0; | |
position: relative; | |
-webkit-animation-name: float-up; | |
-webkit-animation-duration: .3s; |
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 | |
add_action( 'tgmpa_register', 'register_required_plugins' ); | |
// This function is called from the above hook | |
function register_required_plugins() | |
{ | |
// The plugins array allows us to define multiple plugins we want to include. | |
// The commented out example shows how we can include and activation a bundled | |
// plugin zip file in our theme. |
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 | |
add_filter( 'gettext', 'wps_translate_words_array' ); | |
add_filter( 'ngettext', 'wps_translate_words_array' ); | |
function wps_translate_words_array( $translated ) { | |
$words = array( | |
// 'word to translate' = > 'translation' | |
'Posts' => 'Article', | |
'Post' => 'Articles', | |
'Pages' => 'Stuffing', |