Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* file: wp-content/plugins/gravityforms/includes/query/class-gf-query.php
* lines: 331 - 333
* Line 331: Here is where the bug starts, $value = [1, 2, 3], input type = 'number', and condition = 'in'. Despite $value being
* an array, the conditions pass.
* Line 332: The array is not numeric, so the condition passes
* Line 333: The value is converted to a float (1.0) so the filter doesn't work
*/
@ridinghoodmedia
ridinghoodmedia / camila-validation.js
Last active February 18, 2022 19:15
Camila validation example
const name = document.getElementById('userName');
const email = document.getElementById('userEmail');
const form = document.getElementById('form');
const modal = document.querySelector('.modal');
const overlay = document.querySelector('.overlay');
const openBtn = document.querySelector('.openBtn');
const closeBtn = document.querySelector('.closeBtn');
/**
@ridinghoodmedia
ridinghoodmedia / sample.php
Last active March 2, 2021 23:19
Schema Planning
<?php
$properties = [
{property, 'name' => 'img'}
{property, 'name' => 'address'}
];
$properties = [
['img' => {property, 'name' => 'img'}],
['address' {property, 'name' => 'address'}]
@ridinghoodmedia
ridinghoodmedia / bem-css.md
Last active February 4, 2021 20:57
Ridinghood Media BEM CSS Guidelines
@ridinghoodmedia
ridinghoodmedia / flywheel-local-xdebug-vscode.md
Created December 6, 2020 05:03 — forked from ahmadawais/flywheel-local-xdebug-vscode.md
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@ridinghoodmedia
ridinghoodmedia / babel-webpack.md
Created November 10, 2020 15:27 — forked from ncochard/babel-webpack.md
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@ridinghoodmedia
ridinghoodmedia / PodsRedirect.php
Last active January 29, 2019 00:05
Custom redirect after pods creates new post
<?php
/**
* Allows custom redirect using custom fields belonging to newly created post
* after a pods form submission
*/
class PodsRedirect {
public function __construct()
@ridinghoodmedia
ridinghoodmedia / WpCustomPost.php
Last active August 10, 2018 20:27
Create custom post type
<?php
/**
* Participant class
*/
class Participant
{
public function __construct()
{
// Register post type with WP
@ridinghoodmedia
ridinghoodmedia / gist:960ced6ff9136b3602c9c708f64f0d2f
Created August 9, 2018 17:03
ACF bidirectional relationship
class ConfigACF
{
public function __construct()
{
// Configure ACF plugin custom functionality
add_filter('acf/update_value/name=field_name', [$this, 'bidirectionalAcfUpdate'], 10, 3);
}
public function bidirectionalAcfUpdate($value, $post_id, $field)
{
@ridinghoodmedia
ridinghoodmedia / style.css
Created July 31, 2018 16:26
Default stylesheet
/* Prevent ios auto zooming select */
@media (max-width: 767px) {
select {
font-size: 16px;
}
select:focus {
font-size: 16px;
}