Skip to content

Instantly share code, notes, and snippets.

View daveromsey's full-sized avatar

David Romsey daveromsey

  • WebDevStudios
  • Kent, Ohio, USA
View GitHub Profile
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active May 3, 2024 12:07
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
@pento
pento / stars-block.js
Last active January 4, 2022 14:00
Gutenberg Stars Block
( function( blocks, element ) {
var el = element.createElement;
function Stars( { stars } ) {
return el( 'div', { key: 'stars' },
'★'.repeat( stars ),
( ( stars * 2 ) % 2 ) ? '½' : '' );
}
blocks.registerBlockType( 'stars/stars-block', {
@soderlind
soderlind / wp.media.view.Modal.prototype.on.open.js
Created February 22, 2016 16:57
wp.media.view.Modal.prototype.on('open', function() {});
jQuery(document).ready(function($){
if (wp.media) {
wp.media.view.Modal.prototype.on('open', function() {
console.log('media modal open');
});
}
});
@pelmered
pelmered / composer.json
Created October 9, 2015 17:14
Example composer.json for WordPress
{
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
@gregrickaby
gregrickaby / wdsjQuery.js
Last active April 2, 2021 19:37
WDS Javascript Style
/**
* file: wdsjQuery.js
*
* Handle Foo things for the foo theme.
*/
window.wdsFoo = {};
( function( window, $, app ) {
// Private variable.
var fooVariable = 'foo';
@windyjonas
windyjonas / wordpress-escaping.md
Last active September 21, 2020 16:10
Most of the escaping functions in WordPress, with a short explanation and example.

WordPress escaping functions

By: Jonas Nordström, @windyjonas
Date: 2013-04-16

esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:

@westonruter
westonruter / nav-menu-item-custom-fields.php
Created September 28, 2012 22:47
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/