Skip to content

Instantly share code, notes, and snippets.

View alessandrotesoro's full-sized avatar
👨‍💻
Probably coding right now...

Alessandro Tesoro alessandrotesoro

👨‍💻
Probably coding right now...
View GitHub Profile
@westonruter
westonruter / phpcs.xml
Last active October 1, 2018 11:22
WPSE 286268: Demonstration of adding controls which are contextual to device previews. https://wordpress.stackexchange.com/a/286294/8521
<?xml version="1.0"?>
<ruleset name="WPSE 286268 Plugin">
<rule ref="WordPress-Core" />
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" value="wpse-286268" />
</properties>
</rule>
<rule ref="WordPress-Docs" />
@bradyvercher
bradyvercher / helpscout-rest-controller.php
Created March 10, 2016 21:00
A starter WP REST API controller for creating a Dynamic App for Help Scout. http://developer.helpscout.net/custom-apps/dynamic/
<?php
/**
* Help Scout REST controller class.
*
* @license GPL-2.0+
* @link http://developer.helpscout.net/custom-apps/dynamic/
*/
class HelpScout_REST_Controller {
/**
* Secret key.
this.$el.find( '.taxonomy-terms' ).select2({
multiple: true,
ajax: {
url: WP_API_Settings.root + 'wp/v2/terms/' + this.options.taxonomy.slug,
data: function( term, page ) {
return {
search: term,
page: page,
_envelope: true
}
@DavidWells
DavidWells / deploy.sh
Last active August 29, 2015 14:12
Deploying WordPress Plugin to Github and then to WordPress.org SVN
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# Instructions
#
# Important!!!!!
# Replace YOUR-WORDPRESS-PLUGIN-SLUG-HERE, YOUR-WORDPRESS-MAIN-PLUGIN-FILE-HERE, YOUR_WORDPRESS_USERNAME_HERE with yours
# End Important!!!!!
#
@georgiecel
georgiecel / wp-comment-callback
Created March 9, 2014 09:09
Custom callback for HTML5 friendly WordPress comment. Also includes schema.org microdata. To use, insert the following into comments.php: <?php wp_list_comments('callback=better_comment&end-callback=better_comment_close'); ?>
// awesome semantic comment
function better_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ( 'article' == $args['style'] ) {
$tag = 'article';
$add_below = 'comment';
} else {
@jonathonbyrdziak
jonathonbyrdziak / CustomWidgetFile.php
Last active September 29, 2022 22:00
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com