Skip to content

Instantly share code, notes, and snippets.

@SchneiderSam
SchneiderSam / gp-mega-menu.php
Last active January 26, 2024 07:13 — forked from diggeddy/gp-mega-menu.php
Create a sub menu item container with action hook (Mega Menu with GeneratePress and GenerateBlocks)
<?php
add_filter( 'walker_nav_menu_start_el', 'db_sub_menu_item_hook', 10, 4 );
function db_sub_menu_item_hook( $item_output, $item, $depth, $args ) {
// Specify menu item class to target
$class_string = 'gp_mega_item';
$menu_item_classes = $item->classes;
if ( empty( $menu_item_classes ) || !in_array( $class_string , $menu_item_classes ) ) {
return $item_output;
@diggeddy
diggeddy / gp-mega-menu.php
Last active February 15, 2024 17:09
Create a sub menu item container with action hook
<?php
add_filter( 'walker_nav_menu_start_el', 'db_sub_menu_item_hook', 10, 4 );
function db_sub_menu_item_hook( $item_output, $item, $depth, $args ) {
// Specify menu item class to target
$class_string = 'gp_mega_item';
$menu_item_classes = $item->classes;
if ( empty( $menu_item_classes ) || !in_array( $class_string , $menu_item_classes ) ) {
return $item_output;
@verygoodplugins
verygoodplugins / wpf-daily-import.php
Created December 11, 2020 14:02
Creates a daily cron to run an Import Users operation via WP Fusion
<?php
// This runs every day and imports any new users from the connected CRM who have the specified tag ID ("123" in this example)
// If contacts with that tag already have user accounts on the site they will be skipped and no data will be loaded
// i.e. this just imports *new* users
if ( ! wp_next_scheduled( 'wpf_daily_import' ) ) {
wp_schedule_event( time(), 'daily', 'wpf_daily_import' );
}