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
echo “© ” . get_bloginfo(‘name’);Continue reading
add_filter( ‘frm_section_is_open’, ‘open_section_for_target_field’, 10, 2 ); function open_section_for_target_field( $open, $field ) { $target_section_id = 2812; //Replace 18635 with the section field ID $id = is_object( $field ) ? $field->id : $field[‘id’]; if ( (int) $id === $target_section_id ) { $open…Continue reading
add_filter( ‘frm_section_is_open’, ‘open_section_for_target_form’, 10, 2 ); function open_section_for_target_form( $open, $field ) { $form_id = is_object( $field ) ? $field->form_id : $field[‘form_id’]; $target_form_id = 102; //Replace 1012 with your form ID if ( (int) $form_id === $target_form_id ) { $open =…Continue reading
function custom_related_products_args( $args ) { $args[‘posts_per_page’] = 2; // Related products সংখ্যা $args[‘columns’] = 2; // কলাম সংখ্যা return $args; } add_filter( ‘woocommerce_output_related_products_args’, ‘custom_related_products_args’ );Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
add_filter( ‘et_grab_image_setting’, ‘prefix_disable_image_setting_on_checkout’, 100 ); /** * Disable the Divi image setting on checkout. * * @param bool $setting * @return bool */ function prefix_disable_image_setting_on_checkout( $setting ) { return edd_is_checkout() ? false : $setting; }Continue reading