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 createFontAwesomeStarRating($rating=0,$min=0,$max=10,$maxStars=5,$return=false){ | |
$score=(($rating - $min) * ($maxStars)) / ($max - $min) ; | |
$full=floor($score); | |
$half=ceil($score)-$full; | |
$empty=$maxStars-$full-$half; | |
$result='<div class="rating-stars" title="'.$score.'">'; | |
$result.=str_repeat('<i class="fa fa-star"></i>',$full); | |
$result.=str_repeat('<i class="fa fa-star-half-o"></i>',$half); | |
$result.=str_repeat('<i class="fa fa-star-o"></i>',$empty); |
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 | |
namespace wppress; | |
class GarbageCollection | |
{ | |
public function __construct() | |
{ | |
add_filter('cron_schedules', function ($schedules) { | |
$schedules['weekly'] = array( | |
'interval' => 604800, |
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
var svgPHPArray = function (dest) { | |
var File = gutil.File; | |
var files = []; | |
var prepareFiles = function (f, enc, cb) { | |
if (f.isNull()) { | |
cb(); | |
return; | |
} | |
if (f.isStream()) { | |
cb(); |
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
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var lessImport=require('less-imports.js'); | |
gulp.task('less_parts', function() { | |
gulp.src("src/less/parts/*.less") | |
.pipe(lessImport('style.css')) | |
.pipe(less()) | |
.pipe(gulp.dest("./")); |
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 | |
class WPPress_Post_Views | |
{ | |
function __construct() { | |
add_action('wp_ajax_post_heartbeat', array(&$this, | |
'increase' | |
)); | |
add_action('wp_ajax_nopriv_post_heartbeat', array(&$this, | |
'increase' |