Skip to content

Instantly share code, notes, and snippets.

View WebEndevSnippets's full-sized avatar

Bruce Munson WebEndevSnippets

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / functions.php
Created January 30, 2014 23:59
WordPress: Require a featured image before you can publish post
//* 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 March 18, 2014 12:58
Gravity Forms: Assign unique ID to form
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 March 19, 2014 19:37
Soliloquy: Remove Soliloquy Settings panel from post types
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 March 19, 2014 19:38
Soliloquy: White label Soliloquy slider
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 March 21, 2014 16:13
Genesis: Filter H1 post title output
add_filter( 'genesis_post_title_output', 'we_post_title_output', 15 );
/**
* Filter H1 post title to add Font Awesome Styling
*
*/
function we_post_title_output( $title ) {
if ( is_page( 22 ) )
$title = sprintf( '<h1 class="entry-title"><i class="fa fa-cog"></i> %s</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
@WebEndevSnippets
WebEndevSnippets / functions.php
Created March 24, 2014 13:46
Genesis: Display featured image on pages after title
add_action( 'genesis_entry_header', 'we_page_featured_image', 15 );
/**
* Display featured image on pages, after title
*/
function we_page_featured_image() {
if ( ! is_singular( 'page' ) )
return;
@WebEndevSnippets
WebEndevSnippets / 0_reuse_code.js
Created May 29, 2014 13:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 7, 2014 15:24
Gravity Forms: Remove Submit Button on Gravity Form
// Remove Submit Button on Gravity Form
add_filter( 'gform_submit_button_12', '__return_false' );
@WebEndevSnippets
WebEndevSnippets / gist:825bab879026e88f97e5
Created October 2, 2014 15:38
ssz taxo detail output
/**
* Displays the Single Activity Post Meta Details
*
* Sets a site transient to make this simple and display quickly.
*
* @uses genesis_grid_loop() Generates the Grid Loop
*/
function ssz_single_activities_post_meta() {
global $post;

/** Procedure for Site Transfer from WPE to Other Host */

  1. Download latest ZIP from WPE (Backup Points) + last 29 zips

  2. Download uploads folder (and all other custom/non-WordPress folders)

  3. Upload WPE ZIP to new server

  4. Extract/unzip WPE ZIP file on new server