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 | |
/* | |
* Converts CSV to JSON | |
* Example uses Google Spreadsheet CSV feed | |
* csvToArray function I think I found on php.net | |
*/ | |
header('Content-type: application/json'); | |
// Set your CSV feed |
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
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id | |
WHERE wp.ID IS NULL |
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
add_action('pmxi_attachment_uploaded', 'my_attachment_uploaded', 10, 3); | |
function my_attachment_uploaded($pid, $attid, $filepath){ | |
$attachment = get_post($attid); | |
// do something with $attachment file | |
if (get_post($pid) == 'industry-resource') { | |
wp_update_post(array('ID' => $attid, 'guid' => str_replace('uploads/', 'uploads/indres/', $filepath))); | |
} | |
} |
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 yst_clean(a){if(""==a||void 0==a)return"";try{a=jQuery("<div/>").html(a).text(),a=a.replace(/<\/?[^>]+>/gi,""),a=a.replace(/\[(.+?)\](.+?\[\/\\1\])?/g,"")}catch(b){}return a}function ptest(a,b){a=yst_clean(a),a=a.toLowerCase();var c=a.match(b);return null!=c?'<span class="good">Yes ('+c.length+")</span>":'<span class="wrong">No</span>'}function removeLowerCaseDiacritics(a){var b,c=[{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{ba |
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
<style>.om-feed-container{width: 100%;max-width: 300px;background: #dfdfdf;font-family: arial;float: left;}.om-feed-header{background: #505050;color: white;padding: 10px;clear: both;}.om-feed-header img, .om-feed-header h4{float: left;}.clear:after{clear: both; content: ""; display: table;}ul#feed{width: 100%;display: block;padding-left: 0;padding: 10px;/*margin-left: 0;*/}ul#feed li{list-style: none;margin-bottom: 10px;}ul#feed li a{color: #3d8180;font-size: 12px;}.gist{max-width: 600px;float: left;margin-left: 50px;}</style> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript">google.load("feeds", "1"); function initialize(){var feed=new google.feeds.Feed("https://www.openminds.com/market/child-welfare/feed/"); feed.setNumEntries(6); feed.load(function(result){if (!result.error){var container=document.getElementById("feed"); for (var i=0; i < result.feed.entries.length; i++){var entry=result.feed.entries[i]; var li=document.createElement("li"); var a=doc |
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
<style>.om-feed-container{width:100%;max-width:300px;background:#dfdfdf;font-family:arial;float:left}.om-feed-header{background:#505050;color:#fff;padding:10px;clear:both}.om-feed-header h4,.om-feed-header img{float:left}.clear:after{clear:both;content:"";display:table}ul#feed{width:100%;display:block;padding-left:0;padding:10px;box-sizing:border-box}ul#feed li{list-style:none;margin-bottom:10px}ul#feed li a{color:#3d8180;font-size:12px}</style><script type="text/javascript" src="https://www.google.com/jsapi"></script><script type="text/javascript">function initialize(){var e=new google.feeds.Feed("https://www.openminds.com/market/child-welfare/feed/");e.setNumEntries(6),e.load(function(e){if(!e.error)for(var t=document.getElementById("feed"),n=0;n<e.feed.entries.length;n++){var d=e.feed.entries[n],i=document.createElement("li"),l=document.createElement("a"),a=document.createTextNode(d.title);l.appendChild(a),l.title=d.title,l.href=d.link,i.className="om-rss-entry",i.appendChild(l),t.appendChild(i)}})}google. |
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 get_form_data($form){ | |
var search_form_data = $($form), | |
search_form_data_object = search_form_data.serializeArray(), | |
search_form_data_len = search_form_data_object.length; | |
// loop through object and asign key/value pairs | |
var returnObj = {}; | |
for (var i = 0; i < search_form_data_len; i++) { | |
returnObj[search_form_data_object[i].name] = search_form_data_object[i].value; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Hello!</title> | |
<link rel="stylesheet" href="https://stackedit.io/res-min/themes/base.css" /> | |
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> | |
</head> | |
<body><div class="container"><h1 id="membership-transition-notes">Membership Transition Notes</h1> |
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
object(Slim\Http\Request)[39] | |
protected 'env' => | |
object(Slim\Environment)[36] | |
protected 'properties' => | |
array (size=25) | |
'REQUEST_METHOD' => string 'POST' (length=4) | |
'REMOTE_ADDR' => string '::1' (length=3) | |
'SCRIPT_NAME' => string '/slimes' (length=7) | |
'PATH_INFO' => string '/contact' (length=8) | |
'QUERY_STRING' => string '' (length=0) |
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
/** | |
* Determine if user exists by ID | |
* @param int $user_id User ID | |
* @return bool true if user exists | |
*/ | |
public function user_id_exists( $user_id ){ | |
global $wpdb; | |
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->users WHERE ID = %d", $user ) ); |
OlderNewer