Baart GA4 Tracking

/** * WPCode snippet: Baart GA4 Tracking (all Baart sites – baartgroup.com and every brand site) * Version 3.1 * * Page groups and HubSpot form names come from the content group rules snippet on baartgroup.com. * Each site refreshes…Continue reading

lokalstolz | Rolle Kunde

/* * WPCode-Snippet “lokalstolz | Rolle Kunde” (Typ php, Location everywhere, Auto-Insert an) * Legt die Benutzerrolle “Kunde” (ls_kunde) an: Rechte eines Redakteurs plus Pakete und Einzelrechte nach Wahl. * Einstellungen unter Benutzer > Rolle Kunde (nur Administratoren): sichtbare Menuepunkte…Continue reading

lokalstolz | Backend

/* lokalstolz | Backend: Backend und Anmeldung im lokalstolz-Look (Schwarz #1d1d1b, Weiss, gerade Ecken), Logo statt WordPress-Logo. Nur CSS und offizielle Hooks. */ if ( ! defined( ‘ABSPATH’ ) ) { return; } if ( ! function_exists( ‘ls_be_icon’ ) )…Continue reading

lokalstolz | Pferdeverkauf

/** * lokalstolz | Pferdeverkauf * Allgemeines Modul fuer Verkaufsseiten (Pferdezucht- und andere Verbaende). Liegt privat in der WPCode-Bibliothek. * Nichts Kundenspezifisches in diesem Snippet: Namen, Farben und Formular-IDs kommen aus der Option ls_pferdeverkauf * (Backend: Pferde > Einstellungen) bzw.…Continue reading

CCT repeater tree callback

// Callback pre JetEngine Dynamic Field – vykreslí vnorený repeater ako strom add_filter( ‘jet-engine/listings/allowed-callbacks’, function ( $callbacks ) { $callbacks[‘gruppa_render_terms_tree’] = ‘Render terms tree’; return $callbacks; } ); function gruppa_render_terms_tree( $items, $child_key = ‘terms’ ) { $items = maybe_unserialize( $items…Continue reading

PHP Runtime Diagnostic

add_filter( ‘debug_information’, function ( $info ) { if ( ! current_user_can( ‘manage_options’ ) ) { return $info; } $settings = ini_get_all( null, true ); $memory = $settings[‘memory_limit’] ?? []; $values = [ ‘PHP version’ => PHP_VERSION, ‘PHP handler’ => PHP_SAPI,…Continue reading

Enable Admin Email after Formidable Forms Entry Saved as Spam

add_action( ‘frm_after_create_entry’, ‘rd_email_admin_on_spam_entry’, 30, 2 ); function rd_email_admin_on_spam_entry( $entry_id, $form_id ) { $entry = FrmEntry::getOne( $entry_id ); if ( ! $entry || ! FrmSpamEntriesHelper::is_spam( $entry ) ) { return; } $recipient = ‘[email protected]’; $url = admin_url( ‘admin.php?page=formidable-entries&frm_action=show&id=’ . $entry_id );…Continue reading

CCT ID display as name

function gt_id_label_map() { return array( // CCT slug => [ field => target ] ‘cct’ => array( // ‘articles’ => array( ‘type’ => ‘term:article-types’ ), ), // CPT slug => [ meta_key => target ] (adds a new admin column)…Continue reading

CCT select field width 100%

add_action( ‘admin_head’, function () { $page = isset( $_GET[‘page’] ) ? sanitize_key( $_GET[‘page’] ) : ”; if ( strpos( $page, ‘jet-cct-‘ ) !== 0 ) { return; } ?>Continue reading

Logout without confirmation

add_action(‘check_admin_referer’, ‘logout_without_confirm’, 10, 2); function logout_without_confirm($action, $result) { if ($action == “log-out” && !isset($_GET[‘_wpnonce’])) { $redirect_to = isset($_REQUEST[‘redirect_to’]) ? $_REQUEST[‘redirect_to’] : ‘https://gruppa.cloud’; /* https://gruppa.cloud/wp-login.php?action=logout */ $location = str_replace(‘&’, ‘&’, wp_logout_url($redirect_to)); header(“Location: $location”); die; } }Continue reading