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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use JangoBrick\SVG\SVGImage; | |
$image = SVGImage::fromFile('test.svg'); | |
$image->getDocument()->setAttribute( 'viewBox', '20 20 200 200' ); |
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
module Freemius | |
API_HOST = 'api.freemius.com' | |
SANDBOX_HOST = 'sandbox-api.freemius.com' | |
class Base | |
# Options taken from http://docs.freemius.apiary.io/#introduction/the-authentication-header | |
# * host Default is api.freemius.com | |
# * api_version Default is v1 | |
# * scope_entity Default is 'plugin'. Could also be 'developer', 'install', 'site', 'user' | |
# * scope_entity_id Required. |
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 | |
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) : | |
// Disable caching on checkout pages as per https://pantheon.io/docs/cache-control/ | |
$regex_path_match = '#/foundation/donation-options/(checkout|shopping-cart)#'; | |
if (preg_match($regex_path_match, $_SERVER['REQUEST_URI'])) { | |
// Use a later priority to make sure it runs after native Pantheon caching | |
add_action( 'send_headers', 'cth_add_header_nocache', 50 ); |
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
<div id="comments" class="comment-digest padded" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 25px 0 10px; padding: 5px 25px"> | |
<div class="comment even thread-even depth-1 contextual" style="clear: left; font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: normal; margin: 0; min-height: 55px; padding: 0"> | |
<div class="comment-header" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0 0 20px; padding: 0"> | |
<img alt="" src="http://1.gravatar.com/avatar/a1f4264de732063c7f18ba9c9b8133c6?s=96&d=mm&r=g" srcset="http://1.gravatar.com/avatar/a1f4264de732063c7f18ba9c9b8133c6?s=192&d=mm&r=g 2x" class="avatar avatar-96 photo" height="96" width="96" style="-ms-interpolation-mode: bicubic; border-radius: 5px; display: block; float: left; font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-s |
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 | |
function get_widget_instance( $widget_id ) { | |
global $wp_registered_widgets; | |
if ( empty( $wp_registered_widgets[$widget_id]['callback'] ) ) | |
return array(); | |
/** @var WP_Widget $widget */ | |
$widget = $wp_registered_widgets[$widget_id]['callback'][0]; |
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 // Cusomtize translated text | |
function qa_customize_text( $custom, $original, $domain ) { | |
if ( 'Postmatic' != $domain ) | |
return $custom; | |
if ( 'Participate in this conversation via e-mail' != $original ) | |
return $custom; | |
return 'Subscribe to comments on this'; |
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 | |
// First, read the reads | |
$materials = wp_get_post_terms( get_the_ID(), 'acme_materials' ); | |
$child_count = array_reduce( $materials, function( $count, $material ) { | |
return $count + count( get_term_children( $material->term_id, 'acme_materials' ) ); | |
}); | |
if ( $child_count > 0 ) { | |
// Some term has children | |
} else { |
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
[ | |
{ | |
"comment_post_ID": "11", | |
"comment_parent": "0", | |
"akismet_comment_nonce": "9552459621", | |
"ak_js": "154", | |
"submit": "Post Comment", | |
"author": "nike air max shox pas cher", | |
"email": "[email protected]", | |
"url": "http:\/\/www.elegantladies.org\/?shop=nike-air-max-shox-pas-cher&id=3100", |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder