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