I always found it strange that when you set the font size to 50% in css, letters don't take 50% of the width of the page.
This script makes text behave in that way.
<?php | |
/** | |
* Plugin Name: Multisite Domain Mapping Attachment URL Fixes | |
* Description: Update attachment URLs to use mapped domain and remove mention of "sites" path. | |
* Author: Chris Hardie | |
* | |
* Rewrite attachment URLs (and related srcset URLs) to the non-multisite, mapped domain version if a domain is mapped | |
* Requires that the related nginx config that maps the non-multisite URL to the multisite URL be in place | |
**/ | |
add_filter( 'wp_get_attachment_url', 'jch_attachment_url_with_domain_mapping' ); |
5,000,000+ : wpforms-lite | |
5,000,000+ : wordpress-seo | |
5,000,000+ : woocommerce | |
5,000,000+ : really-simple-ssl | |
5,000,000+ : jetpack | |
5,000,000+ : elementor | |
5,000,000+ : contact-form-7 | |
5,000,000+ : classic-editor | |
5,000,000+ : akismet | |
4,000,000+ : wordpress-importer |
<?php | |
/** | |
* Plugin Name: Add shortcode list all blog sites | |
* Description: Add shortcode list all blog sites ([wpmudev_list_all_blogs]) - 1155576029146873 | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
return; |
<?php | |
$url = getenv('QUERY_STRING'); | |
if ($url == '') { | |
die ('THIS SCRIPT CANNOT BE CALLED DIRECTLY!'); | |
} | |
?><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="refresh" content="0; URL=<?php echo $url ?>"> |
<?php | |
/** | |
* Rot35 for URLs. To avoid increasing size during urlencode(), commonly encoded | |
* chars are mapped to more rarely used chars (end of the uppercase alpha). | |
* | |
* @param string $url | |
* @return string | |
*/ | |
function rotUrl($url) { |
function perc2color(perc) { | |
var r, g, b = 0; | |
if(perc < 50) { | |
r = 255; | |
g = Math.round(5.1 * perc); | |
} | |
else { | |
g = 255; | |
r = Math.round(510 - 5.10 * perc); | |
} |
<?php | |
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html | |
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
foreach($rows as $row) { | |
echo '<p>'; |
I always found it strange that when you set the font size to 50% in css, letters don't take 50% of the width of the page.
This script makes text behave in that way.
# Parses YouTube URLs directly or from iframe code. Handles: | |
# * Address bar on YouTube url (ex: http://www.youtube.com/watch?v=ZFqlHhCNBOI) | |
# * Direct http://youtu.be/ url (ex: http://youtu.be/ZFqlHhCNBOI) | |
# * Full iframe embed code (ex: <iframe src="http://www.youtube.com/embed/ZFqlHhCNBOI">) | |
# * Old <object> tag embed code (ex: <object><param name="movie" value="http://www.youtube.com/v/ZFqlHhCNBOI">...) | |
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/ | |
$5 #=> the video ID | |
# test it on Rubular: http://rubular.com/r/eaJeSMkJvo |