Skip to content

Instantly share code, notes, and snippets.

Bruce Munson WebEndevSnippets

Block or report user

Report or block WebEndevSnippets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Mar 19, 2014
Soliloquy: White label Soliloquy slider
View functions.php
add_filter( 'gettext', 'tgm_soliloquy_whitelabel', 10, 3 );
/**
* White label Soliloquy slider
* Change all instances of Soliloquy to 'Slider'
*/
function tgm_soliloquy_whitelabel( $translated_text, $source_text, $domain ) {
// If not in the admin, return the default string.
if ( ! is_admin() ) {
return $translated_text;
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Mar 19, 2014
Soliloquy: Remove Soliloquy Settings panel from post types
View functions.php
add_filter( 'soliloquy_skipped_posttypes', 'we_remove_soliloquy_setting_panel' );
/**
* Remove Soliloquy Settings panel from post types
*
*/
function we_remove_soliloquy_setting_panel() {
return array( 'attachment', 'revision', 'nav_menu_item', 'envira', 'soliloquy', 'foobar' );
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Mar 18, 2014
Gravity Forms: Assign unique ID to form
View functions.php
add_action('gform_after_submission_3', 'we_add_submission_id', 10, 2);
/**
* Assign unique ID to the Service & Support form, for Request Number
*/
function we_add_submission_id($entry, $form) {
global $wpdb;
$field_number = 14;
$SubmissionID = 'S-' . $entry['id'];
$wpdb->insert("{$wpdb->prefix}rg_lead_detail", array(
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Mar 3, 2014
Gravity Forms: Auto login to site after GF User Registration Form Submittal
View functions.php
add_action( 'gform_user_registered','we_autologin_gfregistration', 10, 4 );
/**
* Auto login to site after GF User Registration Form Submittal
*
*/
function we_autologin_gfregistration( $user_id, $config, $entry, $password ) {
wp_set_auth_cookie( $user_id, false, '' );
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 30, 2014
WordPress: Require a featured image before you can publish post
View functions.php
//* From http://wpsnipp.com/index.php/functions-php/require-featured-image-can-publish-post/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+wpsnipp+%28wpsnipp+-+wordpress+code+snippets%29
add_action('save_post', 'wpds_check_thumbnail');
add_action('admin_notices', 'wpds_thumbnail_error');
function wpds_check_thumbnail($post_id) {
// change to any custom post type
if(get_post_type($post_id) != 'post')
return;
if ( !has_post_thumbnail( $post_id ) ) {
// set a transient to show the users an admin message
set_transient( "has_post_thumbnail", "no" );
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 27, 2014
WordPress: Modify WP registration signup email message and subject
View functions.php
add_filter( 'wpmu_signup_user_notification_subject', 'we_modify_register_user_notification_subject', 10, 4 );
/**
* Modify the user registration email activation subject
*/
function we_modify_register_user_notification_subject( $text ) {
return 'Welcome to the Best Books on Writing site! (Activation Required)';
}
add_filter('wpmu_signup_user_notification_email', 'we_modify_register_user_notification_message', 10, 4);
/**
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 24, 2014
Genesis: Add content to Genesis Sandbos Featured Content widget, by widget instance
View functions.php
add_action( 'gsfc_before_post_content', 'we_before_gsfc_quote_content' );
/**
* Add lead-in content to GSFC widget (by instance)
*/
function we_before_gsfc_quote_content( $instance ) {
if ( $instance['custom_field'] == 'writing-quotes' ) {
echo 'boo';
}
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 15, 2014
WordPress: Add featured image to RSS feed for use in MailChimp campaign
View functions.php
add_filter('the_excerpt_rss', 'webendev_featured_to_RSS');
add_filter('the_content_feed', 'webendev_featured_to_RSS');
/**
* Add featured image to RSS feed for use in MailChimp campaign
*
*/
function webendev_featured_to_RSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 4, 2014
Genesis: Replace Genesis primary menu with a dynamically updated category menu. Uses a custom walker class.
View functions.php
//* Unregister primary/secondary navigation menus
remove_theme_support( 'genesis-menus' );
//* Add New Menu Navigation with dynamic child category walker class
add_action( 'genesis_after_header', 'webendev_subcat_navigation', 15 );
function webendev_subcat_navigation() {
echo '<nav class="nav-primary">';
wp_nav_menu(
array(
'container_class' => 'wrap',
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Jan 4, 2014
Genesis: Remove secondary menu on home page
View functions.php
add_action('get_header', 'webendev_remove_genesis_do_subnav');
/**
* Remove secondary menu on home page
*/
function webendev_remove_genesis_do_subnav() {
if ( is_home() ) {
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
}
}
You can’t perform that action at this time.