This file contains 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 | |
/* | |
Plugin Name: Custom Dashboard Functions | |
Plugin URI: https://nathaningram.com | |
Description: Customize the WP Admin | |
Version: 2023.11 | |
Author: Nathan Ingram | |
Author URI: https://nathaningram.com | |
License: GPL2 | |
*/ |
This file contains 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 | |
/* Debug Options */ | |
define( 'WP_DEBUG', false ); | |
define( 'WP_DEBUG_LOG', false ); | |
/* MySQL Settings */ | |
define( 'DB_NAME', 'database_name_here' ); | |
define( 'DB_USER', 'username_here' ); |
This file contains 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
/* Add Border to Images with PLACEHOLDER in filename */ | |
img[src*="PLACEHOLDER"] { | |
border:10px #FF0000 solid !important; | |
} |
This file contains 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
// Removes Gridbuilder icon from TinyMCE | |
add_filter( | |
'mce_buttons', | |
function( $buttons ) { | |
$key = array_search( 'wpgb', $buttons, true ); | |
unset( $buttons[ $key ] ); | |
return $buttons; | |
}, 99 | |
); |
This file contains 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
// Set "Upcoming" as Default Tax for Events (this applies on publish) | |
// Source: https://gist.github.com/mayeenulislam/f208b4fd408fd4742c06 | |
function ni_set_default_object_terms( $post_id, $post ) { | |
if ( 'publish' === $post->post_status ) { | |
$defaults = array( | |
'post_tag' => array( 'event' ), | |
'event-status' => array( 'upcoming' ), | |
); | |
$taxonomies = get_object_taxonomies( $post->post_type ); |
This file contains 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
// Change Placeholder Text in Title for CPT | |
function ni_change_cpt_title_text( $title ){ | |
$screen = get_current_screen(); | |
if ( 'team' == $screen->post_type ) { | |
$title = 'Enter Team Member Name '; | |
} | |
if ( 'service' == $screen->post_type ) { | |
$title = 'Enter Service Name '; | |
} //continue replicating these if statements for as many CPTs as you like |
This file contains 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
// Enable SVG Uploads in Beaver Builder Modules | |
add_filter( 'fl_module_upload_regex', function( $regex, $type, $ext, $file ) { | |
$regex['photo'] = '#(jpe?g|png|gif|bmp|tiff?|svg)#i'; | |
return $regex; | |
}, 10, 4 ); |
This file contains 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
//Removes Slugs from CPT URLs | |
function na_remove_slug( $post_link, $post, $leavename ) { | |
if ( 'linked_article' != $post->post_type || 'publish' != $post->post_status ) { | |
return $post_link; | |
} | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); |
This file contains 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
<div class="event-wrapper"> | |
<a class="event-link" href="[wpbb post:url]"> | |
<div class="event-date-outer-wrapper mobilehide"> | |
<div class="event-date-wrapper"> | |
<div class="event-month"> | |
[wpbb post:the_events_calendar_start_date format='M'] | |
</div> | |
<div class="event-day"> | |
[wpbb post:the_events_calendar_start_date format='j'] | |
</div> |
This file contains 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
////////// Snippets from Behind the Site March 2022 ////////// | |
// Add to the functions.php of your active child theme or a custom functions plugin | |
/////////////// WooCommerce Modifications /////////////// | |
//Show FREE rather than $0.00 | |
//Source: https://www.businessbloomer.com/woocommerce-display-free-instead-0-00-empty-price/ | |