Skip to content

Instantly share code, notes, and snippets.

View nathan-roberts's full-sized avatar
💭
Building

Nathan Roberts nathan-roberts

💭
Building
View GitHub Profile
@nathan-roberts
nathan-roberts / disable-core-blocks.php
Last active May 19, 2022 03:47
Disable Core Gutenberg Blocks
add_filter('allowed_block_types', 'ca_allowed_block_types');
function ca_allowed_block_types($allowed_blocks)
{
$allowed_blocks = [];
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
$blocks = array_keys($block_types);
foreach ($blocks as $block => $block_name) {
@nathan-roberts
nathan-roberts / disable_core_blocks.php
Last active May 19, 2022 03:40
Remove Core Gutenberg Blocks
<?php
// Disable core WordPress Gutenberg Blocks
add_filter('allowed_block_types', 'misha_allowed_block_types');
function misha_allowed_block_types($allowed_blocks)
{
$allowed_blocks = [];
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
@nathan-roberts
nathan-roberts / codeable-dark-style.css
Last active May 24, 2022 06:36
Dark Mode Stylesheet For Codeable.io
body,
code {
background-color: #10282E;
color: #c9d1d9;
}
nav.navigation .navigation-link,
nav.navigation {
<?php
// Template Logic
function twt_trailer_archive_template($original_template)
{
// Set our post type
$post_type = 'trailer';
// Set the expected path for a override template within the site theme
$file = trailingslashit(get_template_directory()) . "archive-$post_type.php";