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 | |
//[random_testimonial] | |
function random_testimonial_func( $atts ){ | |
$query = new WP_Query( array ( 'category__in' => array( 4 ), 'posts_per_page' => -1, 'ignore_sticky_posts' => 1, ) ); | |
$testimonials = array(); | |
while( $query->have_posts() ) : $query->the_post(); | |
$testimonials[] = get_the_content(); | |
endwhile; |
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
#!/bin/bash | |
# This script creates a new project (or site) under /var/sites and creates | |
# new virtual host for that site. With the options a site can also | |
# install the latest version of Laravel directly. | |
# This script was originally based on the following script by @Nek from | |
# Coderwall: https://coderwall.com/p/cqoplg | |
# Display the usage information of the command. | |
create-project-usage() { |
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 | |
/* Convo Custom Feed API | |
* | |
* This is the PHP version of the python example script Convo offers on their website: | |
* https://www.convo.com/developer_center/api/imported_feed_api.py | |
*/ | |
function add_link_in_feed($resource_id, $url, $title, $description, $image, $site_name) { | |
global $access_key_id, $secret_access_key; | |
$params = http_build_query(['resource_id' => $resource_id, 'url' => $url, 'title' => $title, 'description' => $description, 'image' => $image, 'site_name' => $site_name ]); |
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 | |
/** | |
* Add "Include in Rotator" option to media uploader | |
* | |
* @param $form_fields array, fields to include in attachment form | |
* @param $post object, attachment record in database | |
* @return $form_fields, modified form fields | |
*/ |
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 images attached to post that have "Include in Rotator" marked as "Yes" | |
$args = array( | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'post_status' => 'inherit', | |
'posts_per_page' => '-1', | |
'order' => 'ASC', |
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 | |
/** | |
* Add Photographer Name and URL fields to media uploader | |
* | |
* @param $form_fields array, fields to include in attachment form | |
* @param $post object, attachment record in database | |
* @return $form_fields, modified form fields | |
*/ | |
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 | |
/* | |
Plugin Name: Test | |
*/ | |
class My_Like_Button { | |
function __construct() | |
{ | |
$this->hooks(); | |
} |
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: Average | |
* Calculates average of values taken from custom fields out of a WordPress loop. Built of Jason ;) | |
* Author: Baki Goxhaj | |
*/ | |
function average( $post_no ); | |
$no = 0; | |
$query = new WP_Query('posts_per_page=' . $post_no ); while( $query->have_posts() ) : $query->the_posts(); | |
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 | |
/** | |
* Tests if the current request is an AJAX request by checking the X-Requested-With HTTP | |
* request header that most popular JS frameworks now set for AJAX calls. | |
* | |
* @return boolean | |
*/ | |
function is_ajax() | |
{ | |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'); |
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
presentation | |
.title('My Great Presentation') | |
.slide({ | |
title: 'Learn About Borders', | |
bullets: [ | |
'Thing 1', | |
'Thing 2', | |
], | |
code: ['path/to/file.css', [2,4]] // path to file, lines to grab |
OlderNewer