function auto_register_woocommerce_context() { global $register_context; // Default register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Default', 'framework'), 'woocommerce-default', 'verify_woocommerce_context'); // Home register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Home', 'framework'), 'woocommerce-home', 'verify_woocommerce_context'); // Product register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Product', 'framework'), 'woocommerce-product', 'verify_woocommerce_context'); // Category register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Category', 'framework'), 'woocommerce-category', 'verify_woocommerce_context'); // Tag register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Tag', 'framework'), 'woocommerce-tag', 'verify_woocommerce_context'); // Cart register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Cart', 'framework'), 'woocommerce-cart', 'verify_woocommerce_context'); // Checkout register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Checkout', 'framework'), 'woocommerce-checkout', 'verify_woocommerce_context'); // Account register_context("<strong>" . __('WooCommerce', 'framework') . ": </strong>" . __('Account', 'framework'), 'woocommerce-account', 'verify_woocommerce_context'); }
function auto_register_bp_groups_context() { if (class_exists('BP_Groups_Group')) { $bpGroups = BP_Groups_Group::get(); // database look up of all bp groups foreach ($bpGroups['groups'] as $group) { register_context("<strong>" . __('BP Group') . ": </strong>" . esc_attr(stripslashes($group->name)), 'bp-group-' . $group->id, 'verify_bp_groups_context'); } } }
function bbp_template_context($template) { if (function_exists('is_bbpress')) { register_context('bbPress', 'bbpress', 'bbpress_context', 10); } return $template; // pass the template back or the bbPress plugin will fail to load }