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
| .css-selector { | |
| background: linear-gradient(288deg, #8b7acb, #f69786, #f2c4bc, #c4bfd5); | |
| background-size: 800% 800%; | |
| -webkit-animation: AnimationName 46s ease infinite; | |
| -moz-animation: AnimationName 46s ease infinite; | |
| -o-animation: AnimationName 46s ease infinite; | |
| animation: AnimationName 46s ease infinite; | |
| } | |
| @-webkit-keyframes AnimationName { | |
| 0%{background-position:30% 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
| <?php | |
| /* | |
| Plugin Name: wordpress assist clean header | |
| Plugin URI: http://www.wordpressassist.nl/ | |
| Description: Remove shortlink hook | |
| Version: 1.0 | |
| Author: AukeJomm | |
| Author URI: http://www.aukejongbloed.nl | |
| */ | |
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
| <? | |
| /** | |
| * GTM data layer push for gravity forms contact form | |
| */ | |
| /** | |
| * Pushes a submission variables to the GTM dataLayer | |
| * Also pushes the event label for use in GTM tracking | |
| * @param Array $entry the data submitted with the form | |
| * @param Array $form Form data | |
| * @return null |
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
| # Install brew | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # Install composer | |
| brew install homebrew/php/composer | |
| ### PHPCS | |
| composer global require "squizlabs/php_codesniffer=*" | |
| # Add to your .bash_profile |
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 | |
| // NEWS!!! NEWS!!! **** FEBRUARY 2020 // | |
| // I rolled this code into a plugin! | |
| // Download plugin Lazy Load Background Images for Elementor. Link is in comments below. | |
| // Or go to https://james.revillini.com/projects/ | |
| // if you don't want another plugin, the code below works (last time I checked) |
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
| /** | |
| * Preload any footer JS files in the header | |
| * | |
| * originally from: https://macarthur.me/posts/preloading-javascript-in-wordpress | |
| */ | |
| add_action('wp_head', function () { | |
| global $wp_scripts; |
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
| SELECT meta_key, COUNT( * ) c FROM `wp_postmeta` GROUP BY meta_key ORDER BY `c` ASC |
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
| jQuery(document).ready(function($) { | |
| $.ajax({ | |
| url: ajaxurl, // WP variable, contains URL pointing to admin-ajax.php | |
| type: 'POST', | |
| data: { | |
| 'action':'get_custom_data', | |
| '_ajax_nonce':plugin_ajax_object.nonce, | |
| 'user_data':'Some input from a user' | |
| }, | |
| success: function( response ) { |
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 | |
| add_action('wp_ajax_get_custom_data', 'get_custom_data'); | |
| function get_custom_data() { | |
| // Ready for the magic to protect your code? | |
| check_ajax_referer('secure-plugin-nonce'); | |
| /* That's it - the check_ajax_referer function verifies the nonce is correct or it dies and stops code execution if it fails. |
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 | |
| add_action('wp_enqueue_scripts', 'load_my_plugin_script'); | |
| function load_my_plugin_script() { | |
| // Register the script with all details and ensures it is loaded after jQuery | |
| wp_register_script('secure-plugin', plugin_dir_url( __FILE__ ). 'js/secure-plugin.js', array( 'jquery' ) ); | |
| // Here happens the magic, we add some details to an object that we can later reference and read from in our JS code. | |
| wp_localize_script( |