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 | |
/** | |
* Get all groups | |
* Utility function | |
* @author Antonio Blanco | |
* @see https://github.com/eggemplo/Groups-Utilities/blob/master/get_groups.php | |
*/ | |
function doublee_get_all_groups() { | |
global $wpdb; | |
$groups_table = _groups_get_tablename('group'); |
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
/** | |
* Widget areas | |
* | |
* @package WordPress | |
* @subpackage Promo Printing | |
* @since Promo Printing 1.0 | |
*/ | |
if (class_exists('Woocommerce')) { | |
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
/** | |
* Convert milliseconds to the desired format | |
* @param milliseconds | |
* @param format | |
* @returns {*} | |
* @see https://gist.github.com/flangofas/714f401b63a1c3d84aaa | |
*/ | |
function convertMilliseconds(milliseconds, format) { | |
var total_days, total_hours, total_minutes, total_seconds; |
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
function myDelayedThing() { | |
var mySelectors = document.querySelectorAll('.something'); | |
// Loop through mySelectors | |
for(var i = 0; i < menuLinks.length; i++) { | |
// Add 'open' class on mouseover | |
menuLinks[i].addEventListener('mouseover', function() { | |
this.classList.add('open'); |
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
/** | |
* Move the excerpt metabox to the top | |
* @param $post_type | |
*/ | |
function doublee_custom_excerpt_metabox( $post_type ) { | |
if(in_array($post_type, array('post','page'))) { | |
add_meta_box( | |
'excerpt_meta', __( 'Excerpt' ), 'post_excerpt_meta_box', $post_type, 'temp', 'high' | |
); | |
} |
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
function doublee_accessibility_admin_notice() { | |
$screen = get_current_screen(); | |
if(in_array($screen->id, array('post', 'page'))) { ?> | |
<div class="notice notice-warning notice-accessibility"> | |
<div id="accessibility-tips" class="meta-box-sortables"> | |
<div id="accessibility_meta" class="postbox closed"> | |
<button type="button" class="handlediv" aria-expanded="false"> | |
<span class="screen-reader-text">Toggle panel: Accessibility Tips</span> | |
<span class="toggle-indicator" aria-hidden="true"></span> | |
</button> |
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
/** | |
* Change the excerpt explanation in the backend | |
* @param $translated_text | |
* @param $text | |
* @param $domain | |
* | |
* @return string | |
*/ | |
function doublee_change_excerpt_explanation( $translated_text, $text, $domain ) { | |
$post_type = get_post_type(); |
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
/** | |
* Get the heights of all elements that match the given selector, and set all of them to the height of the highest one | |
* Note: According to https://coderwall.com/p/kvzbpa/don-t-use-array-foreach-use-for-instead, a for loop is faster than forEach | |
* @param selector - the CSS selector to set to the highest | |
*/ | |
function setHeightToHighest(selector) { | |
// Get our items - returns a NodeList of elements | |
var items = document.querySelectorAll(selector); | |
// Create an array to store the heights | |
var heights = []; |