This file contains 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
/** | |
* This function is part of the WordPress Widget API. | |
* | |
* It's fired when the widget is being updated and using the incoming | |
* $new_instance to update the values stored in the incoming $old_instance. | |
* | |
* We're allowing users to store CSS and HTML in their input field but we're | |
* stripping out JavaScript tags. | |
*/ | |
public function update( $new_instance, $old_instance ) { |
This file contains 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
/** | |
* Registers a new sidebar with the theme. | |
* | |
* Note: replace 'themename' with the name of your theme. | |
*/ | |
function themename_add_sidebar() { | |
/* | |
* Description of the parameter array is as follows: | |
* |
This file contains 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 | |
/** | |
* An example function used to demonstrate how to use the `user_can_save` function | |
* that provides boilerplate security checks when saving custom post meta data. | |
* | |
* The ultimate goal is provide a simple helper function to be used in themes and | |
* plugins without the need to use a set of complex conditionals and constants. | |
* | |
* Instead, the aim is to have a simplified function that's easy to read and that uses | |
* WordPress APIs. |
This file contains 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
/** | |
* This gist demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't | |
* have to worry about using things such as `noConflict` or creating your own reference to the jQuery function. | |
* | |
* @version 1.0 | |
*/ | |
(function( $ ) { | |
"use strict"; | |
$(function() { |
This file contains 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
/** | |
* Note that the following media queries are intended to be used for the specified device or screen size | |
* in both portrait and landscape mode. | |
* | |
* Desktop queries are not provided since the default styles for most sites and applications typically focus | |
* on that for the default sites. | |
* | |
* Contributes, comments, and all that fun stuff always welcome :). | |
*/ | |
This file contains 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
/** | |
* This file is enqueued by means of wp_enqueue_script() - variables are passed | |
* in from PHP by means of wp_localize_script() | |
* | |
*/ | |
/* TM: We use an anonymous function to invoke the JavaScript. Also refactored for proper | |
* WordPress coding standards. | |
*/ | |
(function( $ ) { |
This file contains 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
/** | |
* Retrieves a list of all of the members on a Trello board and stores and | |
* returns their names in an array. It will not include any duplicates. | |
* | |
* Trello names are usually represented as "Elliot Alderson (mrrobot)" but the | |
* returned array will only return an array with their actual name (that is, | |
* Ellio Alderson). | |
* | |
* This does not require jQuery or any third-party library to run. If you want | |
* to run this from the console of Chrome, then paste this entire function into |
This file contains 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
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
OlderNewer