Skip to content

Instantly share code, notes, and snippets.

@jmccall75
jmccall75 / better-term-editing.php
Last active November 11, 2020 17:35
Replace term description text field with tinymce
<?php
/*Replaces the "description field" on the Author edit page with a tinymce editor*/
add_action("jjm_author_tax_edit_form_fields", 'add_form_fields_example', 10, 2);
function add_form_fields_example($term, $taxonomy){
?>
<tr valign="top">
<th scope="row">Description</th>
<td>
<?php wp_editor(html_entity_decode($term->description), 'description', array('media_buttons' => false)); ?>
<script>
@jmccall75
jmccall75 / functions.php
Last active January 9, 2024 03:15
Locking down Gutenberg...
<?php
/**
* Gutenberg Block customization for this theme.
*/
// gutenberg disable for posts
//add_filter('use_block_editor_for_post', '__return_false', 10);
// gutenberg disable for post types
//add_filter('use_block_editor_for_post_type', '__return_false', 10);
@jmccall75
jmccall75 / accessible-menu.php
Created February 14, 2023 13:19 — forked from SteveJonesDev/accessible-menu.php
Accessible WordPress Navigation Menu
<div class="menu-container">
<button class="menu-button" aria-controls="site-header-menu"><span class="screen-reader-text"><?php esc_html_e('Menu','rwc'); ?></span></button>
<div id="site-header-menu" class="site-header-menu">
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e('Primary Menu', 'rwc'); ?>">
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'depth' => 3,
'menu_id' => 'primary-menu',
'container_class' => 'nav-primary'