Skip to content

Instantly share code, notes, and snippets.

@Qubadi
Qubadi / gist:2e158f1e4d67cccb4d41743bc66ca871
Last active December 13, 2024 02:14
JetFormBuilder: Confirmation popup on form submission
UPDATED: 23.08.2024
Description:
Copy the following JS code and create a JS snippet using your snippet plugins.
Paste the code into the plugin and save it.
I have appended the submit button with a class name called submit_confirm.
The advantage of this class is that it will only affect the form that holds the submit_confirm class and not any other forms,
in case you have many forms.
@Qubadi
Qubadi / gist:4e312e4fe5fb82f05d965616365d3a4d
Created August 8, 2024 23:20
Jetformbuilder content Template with RTL and Amiri font
Add this HTML code to your Jetformbuilder (Send Email) content, and do not forget to add your field names.
If you have more field names, just duplicate the code lines.
This template is designed for use with Jetformbuilder, featuring RTL (Right-to-Left)
text alignment and the elegant Amiri font. The template ensures proper rendering of text in
languages that read from right to left, such as Arabic. Simply add your content within the designated section,
and the template will automatically apply the specified font and alignment styles.
<style>
@Qubadi
Qubadi / gist:da08ced02431169768e558483c4bf099
Last active September 5, 2024 12:02
Enhanced input fields with clear button for JetFormBuilder
Updates Made 31.08.2024:
Used input.onClear(): This method is used to clear the input field when available.
Checked for Input Type: Added a check to skip adding the clear button for checkbox and radio input types to avoid issues.
Description:
Copy the following HTML code and create a HTML snippet using your snippet plugins. Paste the code into the plugin and save it.
This code enhances the input fields in JetFormBuilder forms by adding a clear button that allows users to easily clear the input content.
The clear button appears when there is input and disappears when the input is empty. It also includes a smooth hover effect for the
clear button, changing its background and font colors.
@Qubadi
Qubadi / gist:d5a28134180bedf7106433f190bf0008
Created July 21, 2024 18:22
JetEngine profile builder menu,add Font Awesome icons to menu items
Copy the following PHP code and create a PHP snippet using your snippet plugin. Paste the code into the plugin and save it.
This code snippet enhances the Profile Builder menu by allowing you to add Font Awesome icons to menu items.
It provides functionality in the backend to edit the icon's margin and position (left or right).
This customization ensures that you can visually enhance your menus to better suit your design needs.
_________________________________________________________________
// Enqueue Font Awesome CSS from CDN
function enqueue_font_awesome_cdn() {
@Qubadi
Qubadi / gist:debc97dc9978dbadc50977ccfe1ef467
Last active September 5, 2024 12:02
JetEngine profile builder menu and dropbar
UPDATED: 22.07.2024: User role functionality has been added to WordPress menus.
Remember to select a user role for any specific menu item if applicable.
Copy the following PHP code and create a PHP snippet using your snippet plugin. Paste the code into the plugin and save it.
This code snippet integrates the JetEngine Profile Builder menu into the WordPress menu system.
After adding this code, you will see a new menu item named "My Templates" on the left side of the WordPress menus.
Create a new menu and add the desired items from "My Templates". Save the menu, and you can then use any navigation
menu or megamenu widget to display the menu you just created.
@Qubadi
Qubadi / gist:74e13293a7ebd23058ee005f9c66497d
Created July 20, 2024 11:45
Enhance WordPress 404 Page Using Elementor Template
Description:
1. Copy the following PHP code and create a PHP snippet using your snippet plugin. Paste the code into the plugin and save it.
2. Create a template page using Elementor Templates
3. Replace the actual Elementor template ID in this line: $elementor_404_template_id = 8209;. Change the ID number 8209 to your
template page ID, and save/update the code.
This code snippet customizes the default 404 error page in WordPress by using a specified Elementor template.
It hooks into the template_include filter and checks if the current page is a 404. If it is, it attempts to load and
display a custom 404 template created with Elementor (using the provided template ID). If successful, it outputs the
custom template content, otherwise, it falls back to the default template. This allows for a more visually appealing
@Qubadi
Qubadi / gist:3bfd007650a03c2668a74a7987fda4fa
Last active September 5, 2024 12:03
JetEngine CPT preview image in full size modal in backend
Description:
1. Copy the following PHP code and create a PHP snippet using your snippet plugins. Paste the code into the plugin and save it.
This code snippet enhances the JetEngine custom post type (CPT) backend by allowing users to click on preview images to view them
in full size within a modal popup. It includes CSS for styling the modal, JavaScript for handling the click events to open and
close the modal, and ensures the image opens centered with a pointer cursor on hover. The modal displays the full-size image and
any associated caption.
______________________________________________
function custom_modal_scripts() {
@Qubadi
Qubadi / gist:5fdb2ea77e400110c2b33a5695c3e9f9
Last active August 11, 2024 14:32
Jetformbuilder and Jetengine form custom configuration for WYSIWYG editor
UPDATED: 11-08-2024
Description:
1. Copy the following PHP code and create a PHP snippet using your snippet plugins. Paste the code into the plugin and save it.
Jetformbuilder and Jetengine form custom configuration for WYSIWYG editor
It works for both forms, JetFormBuilder and JetEngine Form.
This code customizes the JetFormBuilder WYSIWYG editor by adding essential toolbar buttons and enabling media buttons
for enhanced functionality. It ensures that users have access to a wide range of formatting options, making content
creation more efficient. This setup enhances the overall user experience with improved editing capabilities.
_____________________________________________________
@Qubadi
Qubadi / gist:7eb535d9bb74e21fe5236adabe04462f
Created May 18, 2024 19:29
Smooth scroll to feedback message on Jetformbuilder form submission
Smooth scroll to feedback message on Jetformbuilder form submission
1. Copy the following JS code and create a JS snippet using your snippet plugins. Paste the code into the plugin and save it.
Description:
This script enhances the user experience of JetFormBuilder forms by automatically scrolling the view to display feedback
messages smoothly upon form submission. It utilizes jQuery and a MutationObserver to detect changes within the form,
ensuring that whether the form submission is successful or encounters errors, users are smoothly guided to the
feedback message. This feature is especially useful in long forms or on pages with substantial content, improving
visibility of form outcomes and reinforcing user interaction without manual scrolling.
@Qubadi
Qubadi / gist:e058555a9a5fd7dea00f882a5e0abb3c
Last active December 30, 2024 11:41
Real-time loading and progress indicator integration with Jetformbuilder forms
UPDATED: Fixed some issues..... 10.07.2024
Real-time loading and progress indicator integration with Jetformbuilder forms
1. Copy the following HTML code and create a HTML snippet using your snippet plugins. Paste the code into the plugin and save it.
Description:
This comprehensive solution integrates real-time loading and progress indicators into JetFormBuilder forms,
significantly enhancing user interaction and experience during form submissions. Employing HTML, CSS, and JavaScript,
the setup includes a visually appealing loading spinner and a dynamically updating percentage progress bar.