This file contains 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 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 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 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 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 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); |
This file contains 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
form.pods-form .pods-field-template-tiles ul.pods-dfv-list.ui-sortable { | |
background: #eee; | |
margin: 0 0 5px 0; | |
padding: 0px; | |
border-radius: 4px; | |
border:0; | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
box-shadow:inset 0 0 4px #ccc; |
This file contains 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
-- 1) Create a temporary table to store rows to delete | |
CREATE TEMPORARY TABLE `gf_spam_entries` AS | |
SELECT `entry_id` | |
FROM `wp_gf_entry_meta` | |
WHERE ( | |
LENGTH(meta_value) > 700 | |
OR LOWER(`meta_value`) REGEXP '^(http|\\<a href)' | |
OR `meta_value` REGEXP '[\\p{Cyrillic}]' | |
OR `meta_value` REGEXP 'http.+\\.(ru|cz|de|jp|bz|bx|php|asp|xyz|ua|tk|icu|bit\\.ly)' | |
OR LOWER(`meta_value`) REGEXP '([a-z0-9._%+-]+)@(.*\\.)?(ru|xy|xx|xv|cz|cc|de|xyz|bagat|[a-z]maill)' |
This file contains 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
/* Create underline effect */ | |
.animated-underlines a{ | |
position: relative; | |
} | |
.animated-underlines a::after { | |
content: ''; | |
display: block; | |
width: 100%; | |
height: 1px; |
NewerOlder