<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change the canonical link for the shop page | |
* Credit: Scott Weiss of somethumb.com | |
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/ | |
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1 | |
*/ | |
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 ); |
/** | |
* @author ebidel@ (Eric Bidelman) | |
* License Apache-2.0 | |
*/ | |
/** | |
* Finds all elements on the page, inclusive of those within shadow roots. | |
* @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main' | |
* @return {!Array<string>} List of anchor hrefs. | |
*/ |
const Image = require('@11ty/eleventy-img') | |
const { parseHTML } = require('linkedom') | |
module.exports = eleventyConfig => { | |
if (process.env.ELEVENTY_ENV) | |
eleventyConfig.addTransform('transform', (content, outputPath) => { | |
if (outputPath && outputPath.endsWith('.html')) { | |
let { document } = parseHTML(content) |
javascript: (function (doc){var changed=0; function checkTitles(){console.log('jQuery version ', $.fn.jquery, ' loaded'); var position=1; var items=[]; var results=$('#rso .kp-blk .g, #rso .g[class="g"], #rso .srg .g').not('.kno-kp .g').find('div:first').find('a:first'); $('.title-changed, #CountTitlesChanged').remove(); results.each(function (){if (!$(this).parents('.related-question-pair').length){var parent=$(this).closest('.tF2Cxc').length > 0 ? $(this).closest('.tF2Cxc') : $(this).closest('li'); items.push([ position, $(this).find('h3').text(), encodeURI($(this).attr('href')), parent]); position++;}}); var numItems=1; cors_proxies=[ 'https://api.codetabs.com/v1/proxy?quest=', 'https://jsonp.afeld.me/?url=',]; items.forEach(item=>{$.ajax({url: cors_proxies[Math.floor(Math.random() * cors_proxies.length)] + item[2], success: function (data, status, xhr){title=$(data).filter('title').text(); var html='<div class="title-changed">'; if (title !=item[1]){html +='<span style="font-weight: bold;color: #ff6961;"> |
<?php // do not copy this line | |
add_action('wp_head', 'wt_cli_consent_mode_integration',9); | |
function wt_cli_consent_mode_integration() { | |
if (!class_exists('Cookie_Law_Info')) | |
return; | |
$cli_bypass = isset($_GET['cli_bypass']) ? 1 : 0; | |
?> | |
<script> | |
var wt_cli_ad_storage = 'denied'; | |
//set default value "denied" or "granted" |
We have on occasion heard the comment "APCA produces less contrast" — this is not true, though I see how some might come to that conclusion, it does not consider the totality of the new guidelines.
APCA does not produce contrast. APCA does nothing to the colors, it only predicts how a human will perceive them, and their effect on readability. And yes, if you try to compare APCA to the WCAG2 math it might appear that APCA allows lower contrast in some specific cases where one color is white or very bright, but across the entire range, APCA clearly, consistently, and correctly predicts contrast, while WCAG2 more often than not allows lower contrasts to pass that have even been shown to be unreadable, even with normal vision.
Here's an example a user brought to my attention recently:
/* Automatically set an image Alt-Text on upload */ | |
add_action( 'add_attachment', 'kreks__add_alt_text_from_image_IPTC_on_upload' ); | |
function kreks__add_alt_text_from_image_IPTC_on_upload( $post_ID ) { | |
// Check if uploaded file is an image, else do nothing | |
if ( wp_attachment_is_image( $post_ID ) ) { | |
$postMeta = get_post_meta($post_ID); | |
$uploads = wp_get_upload_dir(); | |
$imgURL = $uploads['basedir'] . "/" . $postMeta['_wp_attached_file']['0']; |
/* | |
* Cryptographically reversible spongebob-case text transformation | |
* | |
* Sometimes you want to encode some text in a way that is not completely | |
* secret, but is quite hard to read. But what if you need to decode it again? | |
* | |
* Now you can! | |
* | |
* to De-sponge some text, simply pass the sponged text back through the sponge | |
* function |
/** | |
* @param {import("@11ty/eleventy/src/UserConfig")} eleventyConfig | |
*/ | |
module.exports = (eleventyConfig) => { | |
return {}; | |
}; |