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_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; |
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_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' ); | |
} |
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_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( |
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_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, '' ); | |
} |
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
//* 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" ); |
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_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); | |
/** |
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_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'; | |
} | |
} |
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_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 ) ){ |
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
//* 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', |
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_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' ); | |
} | |
} |