add_action(‘pmxi_saved_post’, function($post_id, $xml_node, $is_update) { // Check if Polylang & DeepL API are active if (!function_exists(‘pll_set_post_language’) || !class_exists(‘PLL_DeepL’)) return; // Get language code from custom field $lang_code = get_post_meta($post_id, ‘language_code’, true); if (!$lang_code) $lang_code = ‘en’; // Default fallback //…Continue reading
/** * Optimized Dashboard for WPCode Shortcodes * Combined with advanced features from the beautiful version */ // Register our AJAX handler for processing shortcodes – EXACTLY as in “Dashboard Main version” add_action(‘wp_ajax_process_wpcode_shortcode’, ‘myonlytab_process_shortcode’); add_action(‘wp_ajax_nopriv_process_wpcode_shortcode’, ‘myonlytab_process_shortcode’); /** * Process any…Continue reading
// Disable core auto-updates add_filter( ‘auto_update_core’, ‘__return_false’ ); // Disable auto-updates for plugins. add_filter( ‘auto_update_plugin’, ‘__return_false’ ); // Disable auto-updates for themes. add_filter( ‘auto_update_theme’, ‘__return_false’ );Continue reading
/** Get Member Data **/ global $member; function hvt_get_member_data( $email) { //FOR DEBUGGING ONLY: // $email = “[email protected]”; $user = get_user_by( ’email’, $email ); ////FOR DEBUGGING ONLY: // echo “ USER ID: “.$user->ID; if ( ! $user ) { //Leave…Continue reading
// Description: Displays the responsive width of the preview in the Elementor editor // Author: Carlos Béjinha // Author URI: https://binformatica.pt // ———————————— // Info Width In Elementor Editor function add_custom_script_to_elementor() { ?>Continue reading
// Check if Referral URL exists if (isset($_SERVER[‘HTTP_REFERER’])) { // Store Referral URL in a variable $refURL = $_SERVER[‘HTTP_REFERER’]; // Display the Referral URL on web page echo $refURL; } else { echo “No referer URL”; }Continue reading
add_filter(‘frm_get_default_value’, ‘my_custom_default_value’, 10, 2); function my_custom_default_value($new_value, $field){ if($field->id == 25){ //change 25 to the ID of the field $new_value = reset($_SESSION[‘frm_http_referer’]); //stores the value of the referring URL } return $new_value; }Continue reading
function purge_varnish_shell() { $key = ‘6d6d9436-4d82-4404-9592-a3d0e40d80f4’; $cmd = “echo ‘$key’ | varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 ‘ban req.url ~ .’”; exec($cmd, $output, $result); error_log(‘Varnishadm purge: ‘ . ($result === 0 ? ‘erfolgreich’ : ‘fehlgeschlagen’)); } add_action(‘after_rocket_clean_domain’, ‘purge_varnish_shell’);Continue reading
add_action(‘frm_after_create_entry’, ‘link_fields’, 1123, 22); add_action(‘frm_after_update_entry’, ‘link_fields’, 2, 146); function link_fields($entry_id, $form_id){ if($form_id ==22 global $wpdb; $first_field = $_POST[‘item_meta’][22]; $user = $wpdb->get_var($wpdb->prepare(“SELECT user_id FROM “. $wpdb->prefix .”frm_items WHERE id=%d”, $entry_id)); $entry_ids = $wpdb->get_col(“Select id from “. $wpdb->prefix .”frm_items where form_id=’2′ and…Continue reading