This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * HubSpot Embedded Form Accessibility Pollyfills | |
| * | |
| * This script fixes the HubSpot HTML blunders that make their embedded forms inaccessible for assistive technology. | |
| * - Replaces/removes improper use of <fieldset>, <legend>, <label>, and role attributes. | |
| * - Note - this can cause forms configured for mulitple column field layouts to break - you will need to adjust your CSS accordingly. | |
| **/ | |
| hubspotFormA11y = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function arrayToObject(arr) { | |
| return arr.reduce((acc, curr) => { | |
| acc[curr.name] = curr.value; | |
| return acc; | |
| }, {}); | |
| } | |
| // Example usage: | |
| const inputArray = [ | |
| { name: "firstName", value: "John" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function elementor_password_form_page() { | |
| // Elementor Template ID | |
| $template_id = 3785; // Replace with your Elementor template ID | |
| // Check if Elementor is active and the template exists | |
| if (defined('ELEMENTOR_VERSION') && \Elementor\Plugin::$instance->templates_manager->get_source('local')->get_item($template_id)) { | |
| // Render the Elementor template | |
| return \Elementor\Plugin::$instance->frontend->get_builder_content_for_display($template_id, true); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function observeElementAddedToDOM(elementId, callback) { | |
| // Select the target node | |
| var targetNode = document; | |
| // Options for the observer (which mutations to observe) | |
| var config = { childList: true, subtree: true }; | |
| // Callback function to execute when mutations are observed | |
| var observerCallback = function(mutationsList, observer) { | |
| for(var mutation of mutationsList) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * WordPress stores all meta fields as strings, which causes problems for ordering by numbers. When using Pods::find() directly, this issue can be addressed by casting the field as a decimal, as shown here: https://github.com/pods-framework/pods-code-library/blob/master/example/classes/Pods/find/examples/orderby-number.php | |
| * | |
| * In shortcodes, this strategy is not possible, as MySQL functions can not be used in the WordPress post editor. Instead, you can use the "pods_shortcode_findrecords_params" params filter, as shown below: | |
| */ | |
| /** | |
| * Example to order by a price field properly. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** Override default Animations.css ***/ | |
| @keyframes fadeInDown { | |
| from { opacity: 0;transform: translate3d(0,-20px,0)} | |
| to { opacity: 1; transform: none } | |
| } | |
| @keyframes fadeInLeft { | |
| from { opacity: 0; transform: translate3d(-30%,0,0)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** .vh100 *** | |
| * add this class to any elemtent to make it full-height | |
| * (excluding address bar on mobile) | |
| */ | |
| .vh100{ | |
| height: 100vh; | |
| max-height: 100svh; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var script = document.createElement('script'); | |
| script.src = 'https://example.com/external-script.js'; | |
| script.async = true; // or script.defer = true; for defer attribute | |
| document.body.appendChild(script); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function custom_admin_styles() { | |
| echo '<style> /*...*/ </style>'; | |
| } | |
| add_action('admin_head', 'custom_admin_styles', 99); | |
| // Alternate to hook in post-edit screen | |
| //add_action('admin_head-post.php', 'custom_admin_styles', 99); |