Current user roles – body tag class

function add_user_role_to_body_classes( $classes ) { global $current_user; foreach ( $current_user->roles as $user_role ) { if ( is_admin() ) { $classes .= ‘ role-‘ . $user_role; } else { $classes[] = ‘role-‘ . $user_role; } } return $classes; } add_filter( ‘body_class’,…Continue reading

Disable Self Pingbacks

add_action( ‘pre_ping’, function( &$links ) { $home = get_option( ‘home’ ); foreach ( $links as $l => $link ) { if ( 0 === strpos( $link, $home ) ) { unset( $links[ $l ] ); } } } );Continue reading

Food Type Taxonomy

// Register Custom Taxonomy function register_custom_foodtype() { $labels = array( ‘name’ => _x( ‘Food Types’, ‘Taxonomy General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Food Type’, ‘Taxonomy Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Food Type’, ‘text_domain’ ), ‘all_items’ => __(…Continue reading

Change Editor Default Image Size

add_filter( ‘block_editor_settings_all’, function ( $settings, $context ) { // The default image size when added in the block editor. $settings[‘imageDefaultSize’] = ‘full’; return $settings; }, 10, 2 );Continue reading

Entry Forms

/** * Entry Automation Helper – With Column Loading Fix * Set to “Run Everywhere” in WPCode */ defined(‘ABSPATH’) || exit; add_action(‘admin_enqueue_scripts’, function($hook_suffix) { wp_enqueue_script(‘jquery’); $inline_js = 0) { var $actualSelect = $select2Container.prev(‘select’); if ($actualSelect.length === 0) { $actualSelect =…Continue reading