View wp-meta_cache.php
$cache_key = '_ssr-schedule';
$cache = get_post_meta( $frag_ID, $cache_key, true );
if ( empty( $cache ) || $cache['expires'] < time() ) {
$var = '[path]';
$url = '[path]' . $var;
$request = wp_remote_get( $url, array( 'timeout' => 120, ) );
if( is_wp_error( $request ) ) { return false; }
$response = wp_remote_retrieve_body( $request );
$data = json_decode( $response, true ); // `true` translate into an array instead of an object
View archive-conditionals.php
<?php
function archive_title() {
//Conditionals to Title Display in WordPress Archive Templates
if( is_archive() ) {
$queried_object = get_queried_object();
if( is_tag() ) {
$slug = $queried_object ? $queried_object->slug : ' ' ;
View add-upstream.md

#tl;dr

setting up a branch to track a repo

pre: assuming you have forked a repo and cloned your fork to your computer

  1. git remote add [maintainer's name] [paste URL here]
  2. git fetch --all
  3. git branch --track [maintainer's name]_[branch] [remote name from step 1]/[branch you want to track] At this point you may watch to checkout to your newly create branch and issue a git pull command.
View bower.json
{
"name": "blue-leaf",
"description": "Physics-like animations for pretty particles",
"main": [
"js/motion.js",
"sass/motion.scss"
],
"dependencies": {
"get-size": "~1.2.2",
"eventEmitter": "~4.2.11"
View paginate_array_original.php
<?php
$items = array(1,2,3,4,5,6,7,8,9,10,11,12);
$limit = 5;
$qty_items = count($items);
$qty_pages = ceil($qty_items / $limit);
$curr_page = isset($_GET&#91;'page'&#93;) ? $_GET&#91;'page'&#93; : 1;
$next_page = $curr_page < $qty_pages ? $curr_page + 1 : null;
$prev_page = $curr_page > 1 ? $curr_page - 1 : null;
View schema-wp-extend-output.php
<?php //* do not include php tag
add_filter('schema_output', 'schema_wp_extend_output_987345256');
/**
* Extend / Override Schema Output
*
* @since 1.0
*/
function schema_wp_extend_output_987345256( $schema ) {
View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
View Facet log
This file has been truncated, but you can view the full file.
[06-Jan-2017 15:52:30 UTC] PHP Notice: Undefined offset: 3 in /code/wp-content/plugins/facetwp/includes/class-helper.php on line 273
[06-Jan-2017 15:52:30 UTC] PHP Stack trace:
[06-Jan-2017 15:52:30 UTC] PHP 1. {main}() /code/wp-admin/admin-ajax.php:0
[06-Jan-2017 15:52:30 UTC] PHP 2. do_action() /code/wp-admin/admin-ajax.php:91
[06-Jan-2017 15:52:30 UTC] PHP 3. WP_Hook->do_action() /code/wp-includes/plugin.php:453
[06-Jan-2017 15:52:30 UTC] PHP 4. WP_Hook->apply_filters() /code/wp-includes/class-wp-hook.php:323
[06-Jan-2017 15:52:30 UTC] PHP 5. call_user_func_array:{/code/wp-includes/class-wp-hook.php:298}() /code/wp-includes/class-wp-hook.php:298
[06-Jan-2017 15:52:30 UTC] PHP 6. FacetWP_Ajax->refresh() /code/wp-includes/class-wp-hook.php:298
[06-Jan-2017 15:52:30 UTC] PHP 7. FacetWP_Facet->render() /code/wp-content/plugins/facetwp/includes/class-ajax.php:265
View log_included_fiels.php
/*
SHUTDOWN LOG INCLUDED FILES
========================================================================== */
add_action( 'shutdown', __NAMESPACE__ . '\\my_shutdown_callback' );
function my_shutdown_callback() {
$included_files = get_included_files();
foreach ($included_files as $filename) {
error_log("$filename\n");
View loop-color-shades-output.css
li {
color: white;
}
li:nth-of-type(1) {
background: #663fb5;
}
li:nth-of-type(2) {
background: #6e49b9;
}
li:nth-of-type(3) {