!! Using regular expressions to find img tags without an alt attribute
https://stackoverflow.com/a/52716045
<img([^a]|a[^l]|al[^t]|alt[^=])*?/>
/* https://www.c2software.com/c2-blog/fonts-appearing-bold-on-mac.aspx */ | |
.selector { | |
-webkit-font-smoothing: antialiased; | |
} |
import { MediaUpload } from '@wordpress/block-editor'; | |
import { Button } from '@wordpress/components'; | |
function CustomMediaUpload(props){ | |
return <MediaUpload | |
onSelect={ media => { props.onMediaSelected(media.url) } } | |
type="image" | |
value={ props.mediaUrl } | |
render={ | |
({open}) => { |
'use strict'; | |
const { series, parallel, src, watch, dest } = require('gulp'); | |
const sass = require('gulp-sass'); | |
const autoprefixer = require('gulp-autoprefixer'); | |
sass.compiler = require('dart-sass'); | |
const browserSync = require('browser-sync').create(); | |
const sass_src = 'wp-content/themes/theme-name/sass/**/{*.scss,_*.scss}'; |
<?php | |
$pages = get_pages( [ | |
'meta_key' => '_wp_page_template', | |
'meta_value' => 'template-example.php', | |
] ); | |
//$pages now contains pages which uses `template-example.php` as template. | |
$pages = get_pages([ | |
'child_of' => get_the_ID(), | |
'meta_key' => '_wp_page_template', |
[...document.querySelector('table').querySelectorAll('tr')].map(tr => [...tr.querySelectorAll('td')].map(td => td.innerText)) |
<IfModule mod_rewrite.c> | |
# not localhost: | |
# RewriteCond %{HTTP_HOST} \. | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
#eliminate root path access denied: (without placeholder index.php) | |
RewriteRule ^(/)?$ wp/index.php [L] | |
# add a trailing slash to /wp-admin |
<?php | |
// https://stackoverflow.com/a/6840407 | |
set_include_path(implode(PATH_SEPARATOR, array( | |
__DIR__ . '/', | |
get_include_path() | |
))); |
@{ | |
double rating = 0; | |
if (this.ViewData.ContainsKey("Rating")) | |
{ | |
rating = Convert.ToDouble(ViewData["Rating"]); | |
} | |
} |
function shortenName(name) { | |
return name.split(' ').map(word => `${word.charAt(0)}.`).join(' '); | |
} |