Skip to content

Instantly share code, notes, and snippets.

View barrd's full-sized avatar

Dave Barr barrd

View GitHub Profile
@barrd
barrd / wp-enable-avif-as-a-file-type.php
Last active March 3, 2023 14:29
WordPress enable AVIF file type
<?php
/**
* Enable AVIF types
*
* @see https://developer.wordpress.org/reference/functions/wp_check_filetype_and_ext/
*/
function barrd_enable_avif_types( $types, $file, $filename, $mimes ) {
if ( false !== strpos( $filename, '.avif' ) ) {
$types['ext'] = 'avif';
$types['type'] = 'image/avif';
@barrd
barrd / keybase.md
Created October 15, 2019 19:29
Keybase

Keybase proof

I hereby claim:

  • I am barrd on github.
  • I am barrd (https://keybase.io/barrd) on keybase.
  • I have a public key ASC1QtWlWxuAejZQSil1Jv3oiWemVVrnEHgntyrjJt0CvQo

To claim this, I am signing this object:

@barrd
barrd / .gitconfig
Created September 2, 2019 17:23
barrd .gitconfig
[user]
name = Dave Barr
email = [email protected]
[color]
ui = true
[core]
editor = code --wait
excludesfile = /Users/barrd/.gitignore_global
[filter "lfs"]
clean = git-lfs clean -- %f
@barrd
barrd / no-fouc.html
Last active February 26, 2021 19:57 — forked from johnpolacek/gist:3827270
Prevent FOUC (flash of unstyled content)
<!-- @see http://johnpolacek.com/2012/10/03/help-prevent-fouc -->
<!-- WordPress implementation -->
<!-- Add to header -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script>
document.documentElement.className = 'no-fouc';
</script>
UPDATE wp_postmeta SET meta_value=concat(meta_value, ' %%sep%% %%sitename%%') WHERE meta_key ='_yoast_wpseo_title';