Skip to content

Instantly share code, notes, and snippets.

// Theme My Login - Remove Login Text from Login Area
function tml_title_filter( $title, $action ) {
if ( 'login' == $action ) return '';
return $title;
}
add_filter( 'tml_title', 'tml_title_filter', 10, 2 );
// Remove Visual Composer Update Nag
add_action('admin_init', function()
{
setcookie('vchideactivationmsg', '1', strtotime('+3 years'), '/');
});
// Remove Yoast SEO Update Nags
add_action('admin_init', 'wpc_disable_yoast_notifications');
function wpc_disable_yoast_notifications() {
if (is_plugin_active('wordpress-seo/wp-seo.php')) {
remove_action('admin_notices', array(Yoast_Notification_Center::get(), 'display_notifications'));
remove_action('all_admin_notices', array(Yoast_Notification_Center::get(), 'display_notifications'));
}
}
// Change Pods MORE FIELDS Metabox Title to Custom
add_filter('pods_meta_default_box_title','changethatname',10,5);
function changethatname($title, $pod, $fields, $type, $name ) {
$title = ($name=='pod-slug') ? __('Your New Title Here', 'plugin_lang') : $title ;
return $title;
}
<script type="text/javascript">
jQuery(document).on( 'keypress', '.gform_wrapper', function (e) {
var code = e.keyCode || e.which;
if ( code == 13 && ! jQuery( e.target ).is( 'textarea,input[type="submit"],input[type="button"]' ) ) {
e.preventDefault();
return false;
}
} );
</script>
//Add placeholder text for Gravity Forms
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
//WP Logout URL Shortcode
function ni_Logout() {
$NIlogout = wp_logout_url();
return $NIlogout;
}
add_shortcode('logout', 'ni_Logout');
@nathaningram
nathaningram / gist:a25f5bbcaf2a01ac0bde
Last active January 18, 2016 20:02
Hides WP Help Functions for Non-Admins
// Hides WP Help Functions for Non-Admins
// Add to the functions.php of your active child theme
function ni_hide_wphelp_actions() {
echo '<style type="text/css">
#cws-wp-help-actions {display:none !important;}
</style>';
}
if ( ! current_user_can('administrator') ) {
// Fixes Gravity Form Display in WP Help
// Add to functions.php of active child theme
function ni_gf_in_wphelp() {
echo '<style type="text/css">
#cws-wp-help-document .gform_wrapper {display:inline-block !important;}
</style>';
}
add_action('admin_head', 'ni_gf_in_wphelp');
@nathaningram
nathaningram / gist:f1da2136d3da20553868
Created January 18, 2016 18:00
WP Help Webinar - Gravity Form Prefills
// Prefill Gravity Form with User Data
function populate_usermeta($meta_key){ global $current_user;
return $current_user->__get($meta_key);
}
add_filter('gform_field_value_userfirstname', create_function("", '$value = populate_usermeta(\'user_firstname\'); return $value;' ));
add_filter('gform_field_value_userlastname', create_function("", '$value = populate_usermeta(\'user_lastname\'); return $value;' ));
add_filter('gform_field_value_useremail',
create_function("", '$value = populate_usermeta(\'user_email\'); return $value;' ));