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
<select onchange="this.form.submit()"> | |
<option>...</option> | |
</select> |
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
#!/bin/bash | |
# converting JPEG images | |
find $1 -type f -and \( -iname "*.jpg" -o -iname "*.jpeg" \) \ | |
-exec bash -c ' | |
webp_path=$(sed 's/\.[^.]*$/.webp/' <<< "$0"); | |
if [ ! -f "$webp_path" ]; then | |
cwebp -quiet -q 90 "$0" -o "$webp_path"; | |
fi;' {} \; |
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('generateblocks_do_content', function ($content) { | |
$part = 'page-header'; | |
$template_part = get_block_template(get_stylesheet() . '//' . $part, 'wp_template_part'); | |
if ($extra = $template_part->content) { | |
$content = $extra . $content; | |
} |
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
#!/bin/bash | |
if [[ "$(curl -L -s $1/license.txt | grep -coF WordPress)" -gt 0 ]]; then | |
echo "Is WordPress" | |
else | |
echo "Is NOT WordPress" | |
fi |
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
var w = window.open("Article", "blank"); var content = Array.prototype.map.call(document.querySelectorAll('.StoryBodyCompanionColumn'), ( el ) => `<p>${el.textContent}</p>` ).join(''); w.document.write(`<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/base.min.css"><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/components.min.css"><link rel="stylesheet" href="https://unpkg.com/@tailwindcss/[email protected]/dist/typography.min.css"><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/utilities.min.css"><body class="prose mx-auto my-20">${content}</body>`); w.document.close(); |
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
function chooseTab( tabEl ) { | |
const activeClasses = tabEl.getAttribute('data-tab-active-class').split(" "); | |
const name = tabEl.getAttribute('data-tab'); | |
const tabGroup = tabEl.closest('[data-tabs]'); | |
tabGroup.querySelectorAll('[data-tab]').forEach(el => | |
el == tabEl ? el.classList.add(...activeClasses) : el.classList.remove(...activeClasses) | |
) | |
tabGroup.querySelectorAll('[data-tab-name]').forEach(el => |
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 featuredImageSrc( $post = null, $size = 'featured' ) { | |
if( is_null($post) ) { | |
global $post; | |
} | |
return get_the_post_thumbnail_url( $post, $size ); | |
} |
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 App; | |
class Shortcodes { | |
protected $shortcodes = []; | |
public function __construct() | |
{ |
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 | |
/** | |
* Filter a few parameters into YouTube oEmbed requests | |
* | |
* @link http://goo.gl/yl5D3 | |
*/ | |
function iweb_modest_youtube_player( $html, $url, $args ) { | |
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html ); | |
} | |
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 ); |
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
$("[data-autosubmit]").on('change', function(){ | |
$(this).parents("form").submit(); | |
}); |
NewerOlder