Skip to content

Instantly share code, notes, and snippets.

View edheltzel's full-sized avatar
🇺🇸
Just your average run-of-the-mill kinda guy

Mr. ED edheltzel

🇺🇸
Just your average run-of-the-mill kinda guy
View GitHub Profile
@edheltzel
edheltzel / custom-wp-menus.php
Created October 22, 2012 23:57 — forked from arod2634/custom-wp-menus.php
Customize Wordpress Admin Menus
<?php
//Remove any unnecessary admin menus & sub-menus
function my_remove_menu_pages() {
remove_menu_page('link-manager.php');
remove_menu_page('edit-comments.php');
//remove_menu_page('index.php');
//remove_menu_page('edit.php?post_type=page');
//remove_menu_page('upload.php');
//remove_menu_page('themes.php');
// Mobile First
@media screen and (min-width: 321px) { // iPhone landscape
}
@media screen and (min-width: 481px) { // iPad portrait
}
/* Generates current template file name - For debugging only! */
add_filter( 'template_include', 'var_template_include', 1000 );
function var_template_include( $t ){
$GLOBALS['current_theme_template'] = basename($t);
return $t;
}
function get_current_template( $echo = false ) {
if( !isset( $GLOBALS['current_theme_template'] ) )
return false;
@edheltzel
edheltzel / index.php
Created August 27, 2013 18:25
Auto Year with PHP
&copy; <?php echo date("Y") ?>
@edheltzel
edheltzel / fucntions.php
Last active February 15, 2023 18:47
Remove personal options from profile page in wordpress
/** REMOVE PERSONAL OPTIONS FROM PROFILE PAGE **/
<?
// removes the `profile.php` admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'rdm_remove_personal_options' ) ) {
// removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
function rdm_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h2>Personal Options</h2>.+?/table>#s', '', $subject, 1 );
@edheltzel
edheltzel / custom.js
Created September 4, 2013 17:14
Auto Year with JS
<p>Copyright &copy; <script language="JavaScript" type="text/javascript">document.write((new Date()).getFullYear());</script> My Company Name</p>
@edheltzel
edheltzel / fucntions.php
Last active March 5, 2018 08:36
Remove specific Plugin from the Plugin List inside of the Wordpress Dashboard
<?php
/* Remove specific plugin from the Plugin List
* update plugin-directory/plugin-file.php whatever plugin
*/
add_action('pre_current_active_plugins', 'rdm_hide_plugin');
function rdm_hide_plugin() {
global $wp_list_table;
$hidearr = array('plugin-directory/plugin-file.php');
$myplugins = $wp_list_table->items;
@edheltzel
edheltzel / function.php
Last active August 29, 2015 14:06
Disable the Wordpress Admin Bar for ALL Users except Admin
<?php
add_action('after_setup_theme', 'rdm_remove_admin_bar');
function rdm_remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
@edheltzel
edheltzel / functions.php
Created September 18, 2014 16:34
redirect for contact form 7
// ADD TO FUNCTIONS.PHP OR require get_template_directory() . '/inc/custom_fuctions.php';
<?php
add_action('wpcf7_mail_sent', 'rdm_wpcf7_mail_sent');
function rdm_wpcf7_mail_sent($wpcf7)
{
$on_sent_ok = $wpcf7->additional_setting('rdm_on_sent_ok', false);
if (is_array($on_sent_ok) && count($on_sent_ok) > 0)
{
@edheltzel
edheltzel / index.html
Last active August 29, 2015 14:09
RDM email Signatures
<div id="signature">
<div id="content">
<img src="http://cl.ly/YQhT/flat_drop200x200.png"/></p>
<p id="title">Edward D Heltzel</p>
<p id="subtitle">Founder & Technical Strategist</p>
<p id="web"><a href="http://rainydaymedia.net">rainydaymedia.net</a>&nbsp;&nbsp;<span>•</span>&nbsp;&nbsp;<a href="tel:19372388756">937-238-8756</a>
</div>
</div>
<div id="signature">