This file contains hidden or 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
$tpl = <<<JS | |
// region BlkTitle | |
CaxtonBlock( { | |
id: 'woobuilder-blocks/BlkID', | |
title: 'BlkTitle', | |
icon: 'layout', | |
category: 'woobuilder', |
This file contains hidden or 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
/** | |
* Class to handle batch set to docs maximum 500 per commit | |
*/ | |
class BatchSetHandler { | |
/** | |
* Construct BatchSetHandler object | |
* @param {firebase.firestore.WriteBatch} dbBatch | |
* @param {function} commitCallback Callback after commit promise is resolved. | |
*/ |
This file contains hidden or 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 | |
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/ |
This file contains hidden or 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 | |
/** | |
* Form Class | |
* | |
* Responsible for building forms | |
* | |
* @param array $elements renderable array containing form elements | |
* | |
* @return void |
This file contains hidden or 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 | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - 2012-2018 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit', '1024M'); |
This file contains hidden or 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 | |
/** | |
* Saves the file from file input and return attachment ID | |
* @param string $input_name Name of file input | |
* @param bool $return_id Whether | |
* @return int|string|WP_Error ID of the attachment or a WP_Error object on failure. | |
*/ | |
function shramee_upload_media( $input_name, $return_id = false ) { | |
if ( ! function_exists( 'media_handle_upload' ) ) { | |
require_once ABSPATH . 'wp-admin/includes/image.php'; |
This file contains hidden or 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
function getPending() { | |
var amount = 0; | |
$( 'tr.oPending' ).each( function() { | |
var | |
$t = $(this), | |
amt = $t.children( ':eq(4)' ).html().split( '<br>' )[0]; | |
amt = amt.trim().replace( '$', '' ) | |
if ( 0 == amt.indexOf( '(' ) ) { | |
amt = amt.replace( '(', '' ).replace( ')', '' ) * -1 | |
} |
This file contains hidden or 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 | |
/** | |
* Query user meta | |
* | |
* @param string|array $name_patt Meta key pattern match | |
* @param int $uid User ID | |
* @param string $query_suffix SQL query suffix | |
* | |
* @return array|null Results of query | |
*/ |
This file contains hidden or 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 | |
/** | |
* Query user meta table | |
* | |
* @param string|array $name_patt Meta key pattern match | |
* @param string $query_suffix SQL query suffix | |
* @param bool $post_meta Whether to query post meta table | |
* | |
* @return array|null Results of query | |
*/ |