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 | |
// note, to use $subject within your closure below you have to pass it along in the "use (...)" clause. | |
$subject = 'Welcome!'; | |
Mail::send('emails.welcome', ['key' => 'value'], function($message) use ($subject) { | |
// note: if you don't set this, it will use the defaults from config/mail.php | |
$message->from('bar@example.com', 'Sender Name'); | |
$message->to('foo@example.com', 'John Smith') | |
->subject($subject); |
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
// Vars - note the quotes around comma separated selectors | |
$a-tags: 'a, a:active, a:hover, a:visited'; | |
$a-tags-hover: 'a:active, a:hover'; | |
// Usage | |
#{$a-tags} { | |
color: red; | |
font-size: 1em; | |
text-decoration: none; | |
} |
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
[alias] | |
subup = "!f() { git submodule sync; git submodule update --init --recursive; }; f" |
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 filter for front-end requests | |
if (!is_admin() && !is_feed()) { | |
add_filter('parse_request', 'my_add_posts_per_page'); | |
} | |
// add our condition-checking filter | |
function my_add_posts_per_page() { | |
add_filter('pre_get_posts', 'my_posts_per_page'); |
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 | |
global $wpdb; | |
$keys = $wpdb->get_col(" | |
SELECT DISTINCT meta_key | |
FROM $wpdb->postmeta | |
"); | |
foreach ($keys as $key) { |
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($) { | |
$('#menu-pages > a[href="edit.php?post_type=page"]') | |
.attr('href', 'edit.php?post_type=page&page=cf-admin-column-view-page'); | |
}) |
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
[alias] | |
up = "pull --rebase" | |
pullmerge = "pull --no-rebase" | |
subup = "!f() { git submodule sync; git submodule update --init --recursive; }; f" | |
subreset = "submodule foreach 'git reset --hard HEAD'" | |
who = shortlog -s -- | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
info = remote -v | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |
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 | |
$feed = fetch_feed('https://github.com/alexkingorg.atom'); | |
// some activity isn't interesting enough to output | |
$ignore_types = array( | |
'issue_comment', | |
'watch', | |
); |
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 akv3_project_group_shortcode($atts) { | |
extract(shortcode_atts(array( | |
'group' => null, | |
'description' => null, | |
), $atts)); | |
if (empty($group)) { | |
return ''; | |
} |
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 akv3_apply_projects_terms() { | |
$project_posts = array(); | |
$project_posts['threads'] = array(16176); | |
$project_posts['carrington-build'] = array(16291, 13738, 5657, 5608, 4956, 4547, 4556, 4509); | |
$project_posts['carrington-core'] = array(12784, 14179, 13830, 13730, 13602, 12784, 5168, 5058, 4507, 4343, 3968, 3576, 3566, 3549, 3536, 3512, 3454, 3424, 3391, 3314, 3315, 3303, 3294, 3290, 3283, 3260, 3233, 3228, 3219, 3208); | |
$project_posts['sharethis'] = array(3133, 3012, 2979, 2948, 2603, 2704, 2681, 2627, 2600, 2620, 2595, 2568, 2581, 2577, 2535, 2511, 2032, 2484); |