This file contains hidden or 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
/** | |
* appendDownloadButton - Appends a download button to images within a specified element. | |
* The download URL is modified to fetch the original (full-sized) image. | |
* | |
* @param {string} selector - The CSS selector of the parent element. | |
*/ | |
function appendDownloadButton(selector) { | |
// Get all the images within the specified element | |
const images = document.querySelectorAll(`${selector} > a > img`); |
This file contains hidden or 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
const generateDuck = () => { | |
const quacks = [ | |
"quack", "quack-quack", "quackity", "quack!", "quack?", "quackity-quack", | |
"quaack", "quuuack", "qua-quack", "quack-quack-quack", "quaaack!", | |
]; | |
const duckLength = [25, 30, 35, 40, 45, 50]; | |
const quackCount = duckLength[Math.floor(Math.random() * duckLength.length)]; | |
let duckSound = ""; |
This file contains hidden or 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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.1; | |
contract AddressExample { | |
address public myAddress; | |
function setAddress(address _address) public { | |
myAddress = _address; | |
} |
This file contains hidden or 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
/** | |
* replace_gday | |
* Customizing WordPress backend G'day text. | |
* | |
* @since 1.0.0 | |
*/ | |
function replace_gday( $wp_admin_bar ) { | |
$my_account = $wp_admin_bar->get_node( 'my-account' ); | |
$newtitle = str_replace( "G'day,", "Hello,", $my_account->title ); | |
$wp_admin_bar->add_node( array( |
This file contains hidden or 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
// vars | |
$content = NULL; | |
settype( $content, 'string' ); |
This file contains hidden or 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
jQuery(function($){ | |
jQuery('#cpt_loadmore').click(function(){ | |
var button = jQuery(this), | |
currentPaged = parseInt(button.attr('data-current-paged')), | |
maxNumPage = parseInt(button.attr('data-max-num-page')), | |
dataPosts = { | |
'action' : 'xyxyxyxyxy', | |
'paged' : currentPaged, | |
'posts_per_page' : button.attr('data-posts-per-page') | |
}; |
This file contains hidden or 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 | |
/** | |
* Register Ajax script | |
* | |
* @return void | |
*/ | |
function theme_name_reg_script() { | |
wp_register_script( 'loadmore_custom_ajax', trailingslashit( get_stylesheet_directory_uri() ) . 'assets/js/loadmore.js', ['jquery'] ); |
This file contains hidden or 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
http://rpc.twingly.com | |
http://api.feedster.com/ping | |
http://api.moreover.com/RPC2 | |
http://api.moreover.com/ping | |
http://www.blogdigger.com/RPC2 | |
http://www.blogshares.com/rpc.php | |
http://www.blogsnow.com/ping | |
http://www.blogstreet.com/xrbin/xmlrpc.cgi | |
http://bulkfeeds.net/rpc | |
http://www.newsisfree.com/xmlrpctest.php |
This file contains hidden or 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 add_wp_http_referer( $output ) { | |
if ( empty( $_SERVER['HTTP_REFERER'] ) ) { | |
$output = str_replace( '</form>', '<input type="hidden" name="_wp_http_referer" value="' . esc_url( get_the_permalink() ) . '"></form>', $output ); | |
} | |
return $output; | |
} | |
add_filter( 'the_password_form', 'add_wp_http_referer' ); |
This file contains hidden or 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
/* template caching fix WP 4.9 */ | |
function template_caching_fix( WP_Screen $current_screen ) { | |
if ( ! in_array( $current_screen->base, array( 'post', 'edit', 'theme-editor' ), true ) ) | |
return; | |
$theme = wp_get_theme(); | |
if ( ! $theme ) | |
return; | |
$cache_hash = md5( $theme->get_theme_root() . '/' . $theme->get_stylesheet() ); |
NewerOlder