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
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes"> | |
<a id="wpuf-featured_image-pickfiles" data-form_id="61" class="button file-selector wpuf_featured_image_61" href="#" style="position: relative; z-index: 1; display: none;">Select Image</a> | |
<ul class="wpuf-attachment-list thumbnails"> | |
<li class="wpuf-image-wrap thumbnail"> | |
<div class="attachment-name"><img src="http://example.com/wp-content/uploads/2016/07/1400x1400_10808553-400x4001-1-150x150.jpg" alt="1400x1400_10808553-400x400[1]"></div> | |
<input type="hidden" name="wpuf_files[featured_image][]" value="100"> | |
<div class="caption"><a href="#" class="btn btn-danger btn-small attachment-delete" data-attach_id="100">Delete</a></div> | |
</li> | |
</ul> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// HOW TO USE | |
$('#target').readme({ | |
url: readurl, | |
strip_tags: true, // default true: OPTIONAL | |
featured_image: true // default true: OPTIONAL | |
}); | |
// HOW TO USE: SIMPLE | |
$('#target').readme({ url: readurl}); |
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 | |
header('Content-Type: application/json; charset=utf-8'); | |
ini_set('display_errors', '1'); | |
ini_set('display_startup_errors', '1'); | |
include '../src/autoloader.php'; | |
function get($name, $default = '') | |
{ |
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: oEmbed in Comments | |
* Description: Allow oEmbeds in comment text. A fork of http://wordpress.org/plugins/oembed-in-comments/ | |
* Version: 1.2 | |
* Author: Evan Solomon, modified by Shea Bunge | |
*/ | |
class oEmbed_Comments { |
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
jQuery(function($) { | |
var $input = $('#get_url'); | |
$input.data('curr_val', $input.val()); //sets initial value | |
var count = 0; | |
setInterval(function() { | |
if ($input.data('curr_val') == $input.val()) //if it still has same value | |
return false; //returns false | |
$input.data('curr_val', $input.val()); //if val is !=, updates it and | |
//do your stuff |
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: Readme Parser | |
Plugin URI: http://www.tomsdimension.de/wp-plugins/readme-parser | |
Description: Loads and formats (a little) readme files [readme-parser url="http://www.xyz.com/readme.txt"] | |
Version: 0.3 | |
Author: Tom Braider | |
Author URI: http://www.tomsdimension.de | |
*/ |
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 | |
echo "<h2>Get Domain and Base URL</h2>"; | |
echo "- Example 1<br>"; | |
$url = "https://francais.rt.com/international"; | |
echo getBaseUrl($url) ; | |
echo "<br>- Example 2<br>"; | |
echo getBaseUrl("https://techcrunch.com/2016/10/23/honeycombtv/?ncid=rss") ; | |
echo "<br>- Get Domain Only<br>"; | |
echo getDomain("https://techcrunch.com/2016/10/23/honeycombtv/?ncid=rss") ; |
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 | |
//Write your PHP code here | |
$url = "http://stackoverflow.com/questions/6240414/add-http-prefix-to-url-when-missing"; | |
$scheme = parse_url($url, PHP_URL_SCHEME); | |
if (empty($scheme)) { | |
$url = 'http://' . ltrim($url, '/'); | |
} | |
$urlnohttp = preg_replace("(^https?://)", "", $url ); |
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 parseFavicon($html) { | |
// Get the 'href' attribute value in a <link rel="icon" ... /> | |
// Also works for IE style: <link rel="shortcut icon" href="http://www.example.com/myicon.ico" /> | |
// And for iOS style: <link rel="apple-touch-icon" href="somepath/image.ico"> | |
$matches = array(); | |
// Search for <link rel="icon" type="image/png" href="http://example.com/icon.png" /> | |
preg_match('/<link.*?rel=("|\').*icon("|\').*?href=("|\')(.*?)("|\')/i', $html, $matches); | |
if (count($matches) > 4) { |