Skip to content

Instantly share code, notes, and snippets.

@robsonsanches
robsonsanches / transitions.css
Last active Dec 30, 2021
Force Bootstrap v4 transitions (ignores prefers-reduced-motion media feature)
View transitions.css
/*
* Force Bootstrap v4 transitions
* (ignores prefers-reduced-motion media feature)
* https://gist.github.com/robsonsanches/33c6c1bf4dd5cf3c259009775883d1c0
*/
.fade {
transition:opacity 0.15s linear !important;
}
.collapsing {
View woocommerce_loop-custom.php
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@Shelob9
Shelob9 / serve-side-block.js
Last active Feb 16, 2022
Example Gutenberg block with server-side rendering. Gutenberg edit() block creates interface. Gutenberg saves settings automatically, the PHP function passed as `render_callback` to `register_block_type` is used to create HTML for front-end rendering of block.
View serve-side-block.js
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const el = wp.element.createElement;
registerBlockType( 'hiRoy/serverSide', {
title: __( 'Server Side Block', 'text-domain' ),
icon: 'networking',
category: 'common',
attributes: {
View bootstrap-4-classes-list.txt
/* file:///Users/henryhuman/Documents/04_Business/Bootstrap%20Creative/GitHub%20repositories/bootstrap-classes-list/bootstrap4.5.0.html */
.accordion
.active
.alert
.alert-danger
.alert-dark
.alert-dismissible
.alert-heading
.alert-info
@Phlow
Phlow / MySQL Queries When Moving WordPress.sql
Last active May 6, 2020
MySQL Queries When Moving WordPress
View MySQL Queries When Moving WordPress.sql
/*
There's a better tool https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
MySQL Queries When Moving WordPress
To use this snippet, you have to:
1. Change the table prefix according your installation. In the example it's: wp_
2. Change http://old-domain.com to your old domain.
@WillBrubaker
WillBrubaker / remove-woocommerce-submenu-items
Last active Oct 20, 2021
Remove WooCommerce submenu items for Shop Managers
View remove-woocommerce-submenu-items
<?php
/*
Don't copy the opening php tag
*/
/*
Removes submenu items from WooCommerce menu for 'Shop Managers'
available submenu slugs are:
wc-addons - the Add-ons submenu
wc-status - the System Status submenu
@rxaviers
rxaviers / gist:7360908
Last active May 28, 2022
Complete list of github markdown emoji markup
View gist:7360908

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kovshenin
kovshenin / something.php
Created Jul 10, 2012
Yes, you can use printf and sprintf in WordPress too!
View something.php
<?php
// Dirty, easy to miss a ' or " or .
echo '<a href="' . get_permalink() . '" class="link">' . get_the_title() . '</a>';
// Clean, easier to read
printf( '<a href="%s" class="link">%s</a>', get_permalink(), get_the_title() );
// Almost as clean, and more secure, maybe a little paranoic :)
printf( '<a href="%s" class="link">%s</a>', esc_url( get_permalink() ), esc_html( get_the_title() ) );