Skip to content

Instantly share code, notes, and snippets.

View danfisher85's full-sized avatar
😎
Focusing

Dan Fisher danfisher85

😎
Focusing
View GitHub Profile
<?php
/*
Copyright 2018 - Pirenko Studio
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CO
<?php
/**
* Get all type posts
*
* @return void
* @author alispx
**/
function alispx_get_type_posts_data( $post_type = 'post' ) {
@robertknight
robertknight / wrap.html
Created October 11, 2016 12:45
Using min-width and overflow-wrap to wrap long words in flexbox layouts
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<style>
.container {
display: flex;
flex-direction: row;
max-width: 100%;
@mikejolley
mikejolley / gist:f19bdc23ef5bd4123089
Created September 16, 2015 13:15
Add a region bias to geolocation in job manager
<?php
/**
* Add to functions.php. Replace country_code with a CCTLD
*/
function wp_job_manager_region_bias() {
return 'country_code';
}
add_filter( 'job_manager_geolocation_region_cctld', 'wp_job_manager_region_bias' );
<?php
/*
Register Fonts
*/
function studio_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
@mikejolley
mikejolley / gist:4b495f544bb632757e27
Last active May 12, 2022 12:14
Resume Manager Repeated Rows Example. Requires 1.11.4
/**
* Return an array of fields which will repeat (have multiple rows)
*
* Subfields should be named group_fieldname[]
*
* @return array
*/
function get_custom_repeated_field_fields() {
return array(
'field1' => array(
@adamsilverstein
adamsilverstein / expanded_alowed_tags
Last active April 3, 2024 18:15
WordPress expanded allowed tags for wp_kses with iframe, forms, etc.
function expanded_alowed_tags() {
$my_allowed = wp_kses_allowed_html( 'post' );
// iframe
$my_allowed['iframe'] = array(
'src' => array(),
'height' => array(),
'width' => array(),
'frameborder' => array(),
'allowfullscreen' => array(),
);
@rutger1140
rutger1140 / map.js
Last active July 21, 2017 17:54
Javascript module pattern to 'lazy load' Google Maps asynchronous, with jQuery
// global.js
// Global debug logger
var debug = true,
log = function(s){
if(debug) {
console.log(s);
}
};
@dovy
dovy / Redux-required-arg-exampes.php
Last active March 4, 2021 14:16
Example of the required attribute for the Redux Framework.
<?php
$options = array(
'required' => array('id','equals',array( 1,3 ) ) // Multiple values
);
$options = array(
'required' => array('id','equals', array( 1 ) ) // Single value
);
@stephenharris
stephenharris / color_luminance.php
Created May 7, 2013 14:19
Lighten or darken a given colour
<?php
/**
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7
* @param str $hex Colour as hexadecimal (with or without hash);
* @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() )
* @return str Lightened/Darkend colour as hexadecimal (with hash);
*/
function color_luminance( $hex, $percent ) {
// validate hex string