Skip to content

Instantly share code, notes, and snippets.

View colorful-tones's full-sized avatar
💓
Don’t believe the hype!

Damon Cook colorful-tones

💓
Don’t believe the hype!
View GitHub Profile
@colorful-tones
colorful-tones / multisite.sh
Created November 17, 2017 15:00
[Active Theme in Multisite] List the active theme per site in a Multisite install #wp-cli #bash #multisite
#!/bin/bash
for site in $(wp site list --field=url)
do
wp theme list --status=active --url=$site
done
@colorful-tones
colorful-tones / buddypress-email-situations-tax.php
Last active July 12, 2017 15:54
List BuddyPress's Email custom post type terms for 'Situations'
$terms = get_terms('bp-email-type');
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li>' . $term->name . '</li>';
}
echo '</ul>';
}
/**
* This paradigm allows for horizontal scrolling on tablet and mobile.
* Mostly the horizontal scrolling is accomplished with CSS. However, we
* wanted to hide the scrollbars and do some height calculations on child
* elements. Therefore, we enhanced it with some Javascript.
*
* File horizontal-scroller.js
* @author Damon Cook
*
*/

Keybase proof

I hereby claim:

  • I am colorful-tones on github.
  • I am damoncook (https://keybase.io/damoncook) on keybase.
  • I have a public key whose fingerprint is EF50 20E2 E053 ADE5 7973 5249 4537 9BB4 BE93 4BE9

To claim this, I am signing this object:

@colorful-tones
colorful-tones / class-custom-vc-element.php
Last active January 12, 2017 21:23
Example of using the `vc_shortcodes_css_class` to streamline VC's class name output on parent elements. See line #53 `add_filter()` and the `filter_vc_row_class()` function on line 73.
<?php
/**
* WDS Visual Composer Custom Element
*
* @since NEXT
* @package WDS Visual Composer
*/
/**
* WDS Visual Composer Custom Element
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
/**
* Register new subnav tabs for BP 'Profile'
*
* @author Damon Cook
*/
function wds_ye_add_profile_tabs() {
global $bp;
// Define new subnav items.
$subnav_items = array(
if ( ! is_admin() ) {
wp_dequeue_styles( 'cmb2-styles' );
}
// or this?
apply_filters( 'cmb2_enqueue_css', false );
function bp_rename_profile_tabs() {
buddypress()->members->nav->edit_nav( array(
'name' => __( 'Dashboard', 'textdomain' ),
'slug' => __( 'dashboard', 'textdomain' )
), 'activity' );
}
add_action( 'bp_actions', 'bp_rename_profile_tabs' );
@colorful-tones
colorful-tones / wds-javascript-style.js
Created February 10, 2016 18:07 — forked from gregrickaby/wdsjQuery.js
WDS Javascript Style
/**
* Foo Script.
*/
window.Foo_Object = {};
( function( window, $, that ) {
// Private variable.
var fooVariable = 'foo';
// Constructor.