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 | |
wp_enqueue_script('whatev-handle', __FILE__ . '/js/script.js', 'jquery', true); | |
/* | |
* Usage: | |
* wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); | |
* | |
* @param string $handle Name of the script. | |
* @param string|bool $src Path to the script from the root directory of WordPress. Example: '/js/myscript.js'. | |
* @param array $deps An array of registered handles this script depends on. Default empty array. |
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 | |
/** | |
* Custom Category Template | |
* | |
* @package my_child_theme | |
* @since 1.0.0 | |
* @author Travis Smith <t@wpsmith.net> | |
* @copyright Copyright (c) 2013, Travis Smith | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @link https://gist.github.com/wpsmith/5062834 |
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
<span id="main-feedback" class="inline-block mt2" style="width:100%;"> | |
<span class="col col-4 h2 inline-block left-align">Charge:<br><span class="h2">$225<span></span></span></span> | |
<span class="col col-4 inline-block left-align"> | |
<form action=""> | |
<input class="mb2" type="radio" value="am" name="tod">Daytime<br> | |
<input type="radio" name="tod" value="pm">After-hours | |
</form> | |
</span> | |
<span class="col col-4 inline-block left-align"> | |
<span class="h3 block">Region: North</span> |
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
/* | |
Ref: https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d | |
What are you testing? | |
What should it do? | |
What is the actual output? | |
What is the expected output? | |
How can the test be reproduced? | |
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 | |
/** | |
* Determines if a post, identified by the specified ID, exist | |
* within the WordPress database. | |
* | |
* Note that this function uses the 'acme_' prefix to serve as an | |
* example for how to use the function within a theme. If this were | |
* to be within a class, then the prefix would not be necessary. | |
* | |
* @param int $id The ID of the post to check |
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 | |
function mm_sanitize($unsanitized_input) { | |
//calls a WordPress core function | |
//verifies UTF-8 encoding, strips tags | |
//removes whitespace/newlines & octets | |
//reference: | |
//https://codex.wordpress.org/Function_Reference/sanitize_text_field | |
return sanitize_text_field($unsanitized_input); | |
} |
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
// Include gulp | |
var gulp = require('gulp'); | |
// Include Our Plugins | |
var jshint = require('gulp-jshint'); | |
var sass = require('gulp-sass'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var rename = require('gulp-rename'); |
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
//Cursor named "result" | |
//if statement makes sure we actually got back some data from the db | |
if (result.moveToFirst() != false) { | |
//for each row (representing a row of db) | |
while (result.moveToNext() != false) { | |
//for each column, representing a value from the row | |
for (int i = 0; i < result.getColumnCount(); i++) { | |
Log.d("Name of db column: ", result.getColumnName(i)); | |
String val = result.getString(i); | |
Log.d("Value for column: ", val); |
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
// Include gulp | |
var gulp = require('gulp'); | |
// Include Our Plugins | |
var jshint = require('gulp-jshint'); | |
var sass = require('gulp-sass'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var rename = require('gulp-rename'); | |
var browserSync = require('browser-sync').create(); |
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
array( | |
'name' => __( 'My Number Field', 'theme-domain' ), | |
'desc' => __( 'Numbers only', 'msft-newscenter' ), | |
'id' => $prefix . 'number', | |
'type' => 'text', | |
'attributes' => array( | |
'type' => 'number', | |
'pattern' => '\d*', | |
), | |
), |