Archives: Snippets
WP Mail SMTP: Don’t Save Outlook Emails to Sent Items
/** * WP Mail SMTP: stop the Outlook mailer from saving a copy of every * sent email to the Sent Items folder of the connected Microsoft 365 account. * * Note: emails larger than 4 MB with attachments are…Continue reading
Add Custom Post Selector Avada
/** * Curated Post Grid for Avada Builder * Version 1.3 * * WPCode: PHP Snippet > Auto Insert > Run Everywhere * No opening PHP tag required. */ if (!defined(‘ABSPATH’)) { return; } /** * Published posts for the…Continue reading
inline campaign quiz locking
Gruppa Custom CSS
:root { –gruppa-black: #040506; /* nadpisy */ –gruppa-dark-gray: #575770; /* text, border accent formulárov */ –gruppa-hover: #1234B5; /* hover, border hover formulárov */ –gruppa-blue: #2952EA; /* accent */ –gruppa-divider: #B0B0C3; /* divider */ –gruppa-focus: 0 0 0 3px rgba(41, 82,…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
CCT SEO post relations
/** * ========================================= * Gruppa CCT SEO * Relation: post_id -> WP Post ID * ========================================= */ /** * ========================================= * SAFE GET * ========================================= */ function gt_safe($obj, $key, $default = ”) { if (is_object($obj) && isset($obj->$key)) { return trim((string)…Continue reading
CCT overrides CPT slug
// 1. Zachytíme dáta tesne pred zápisom do DB add_filter( ‘wp_insert_post_data’, function( $data, $postarr ) { // Overíme, či ide o CPT, ktoré má prepojenie na CCT (Has Single Page) // JetEngine posiela v $_POST dáta z CCT pri ukladaní…Continue reading