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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Web Components</title> | |
<style type="text/css"> | |
jb-toggle-buttons { | |
display: flex; | |
} |
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 | |
add_action( | |
'wp', | |
function () { | |
global $wp_query; | |
if ( ! $wp_query->is_main_query() || ! $wp_query->is_404() ) { | |
return; | |
} |
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 | |
wp_editor( | |
$speakers, | |
'my_field', | |
array( | |
'media_buttons' => false, | |
'textarea_rows' => 5, | |
'tinymce' => array( | |
'toolbar1' => 'bold, italic, link', |
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 | |
/** | |
* Remove support for comments globally. | |
*/ | |
function jb_remove_comment_support() { | |
add_filter( 'comments_open', '__return_false' ); | |
add_filter( 'pings_open', '__return_false' ); | |
$post_types = get_post_types(); | |
if ( ! empty( $post_types ) ) { |
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 | |
/** | |
* Serialize an array into a Gutenberg block. | |
* | |
* @param array $block Block. | |
* @return bool|string | |
*/ | |
function serialize_block( $block = [] ) { | |
if ( ! isset( $block['blockName'] ) ) { |
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
/** | |
* Anchors. | |
*/ | |
// Variables. | |
import wp from 'wp'; | |
const { addFilter } = wp.hooks; | |
import includes from 'lodash/includes'; | |
// Add anchor support to these blocks. |
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
location ~ ^/wp-content/uploads/[^\/]*/.*$ { | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
rewrite ^/wp-content/uploads/(.*)$ https://<bucket-name>.s3.amazonaws.com/uploads/$1; | |
} |
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
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^wp-content/uploads/(.*)$ https://<bucket-name>.s3.amazonaws.com/uploads/$1 [QSA,L] |
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
@mixin css-triangle( $width: 11px, $height: 7px, $color: '#000', $direction: 'down' ) { | |
width: 0; | |
height: 0; | |
border-style: solid; | |
@if ( $direction == 'down' ) { | |
$half-width: $width / 2; | |
border-width: $height $half-width 0 $half-width; | |
border-color: $color transparent transparent transparent; | |
} |