Skip to content

Instantly share code, notes, and snippets.

View stoi2m1's full-sized avatar

Storm stoi2m1

View GitHub Profile
/*
* information used to create the needed functions found here https://webdevstudios.com/2015/10/06/buddypress-adding-custom-notifications/
*
* hooks a code within functions modified to my needs to work with rtmedia
*/
/* --- Custom Notifications --- */
// this is to add a fake component to BuddyPress. A registered component is needed to add notifications
function custom_filter_notifications_get_registered_components( $component_names = array() ) {
@stoi2m1
stoi2m1 / podcasts.php
Last active September 15, 2016 00:20
Merge Two Post Queries and Sort with WP_Query
// number of posts to display
$count = 20;
// post type podcasts
$podcasts = get_posts(
array(
'fields' => 'ids',
'post_type' => array( 'podcast' ),
'post_status' => array( 'publish' ),
'posts_per_page' => $count,
@stoi2m1
stoi2m1 / Filter Empty Categories (Taxonomies) Menu Items From a Menu
Last active September 14, 2016 23:58
Client needed taxonomies in menu for future use, but wanted empty taxonomies excluded in the meantime
/*
*
* description: filters the menu items for empty categories on the front end only
*
* purpose: to allow future used categories to be added to the menu but not displayed on front end if empty
*
* based on code found on wordpress.stackexchange - http://wordpress.stackexchange.com/a/147368/10907
*
* My Improvements:
* 1. filtering based on menu_item->objectid and cat->id instead of titles which can be changed for the menu