Skip to content

Instantly share code, notes, and snippets.

View fridaynext's full-sized avatar
🍰
Building out functionality in CakePHP, jQuery, and SCSS!

Casey Friday fridaynext

🍰
Building out functionality in CakePHP, jQuery, and SCSS!
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

<?php
// custom post type permalinks
add_filter('post_type_link', 'deb_permalink', 10, 4);
function deb_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%taxonomy_name%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
MacBook-Pro:streisand-openconnect caseyfriday$ ps aux | grep mono
caseyfriday 34637 131.2 0.6 811012 95708 ?? R 2:35PM 0:21.73 mono --debug /Applications/Sonarr.app/Contents/MacOS/NzbDrone.exe
caseyfriday 29319 0.0 0.7 906416 125756 ?? S 1:32PM 0:38.46 /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --debug /Applications/Sonarr.app/Contents/MacOS/NzbDrone.exe /nobrowser /restart
caseyfriday 34675 0.0 0.0 2432804 1916 s003 S+ 2:35PM 0:00.00 grep mono
MacBook-Pro:streisand-openconnect caseyfriday$ ps aux | grep mono
caseyfriday 29319 0.0 0.7 895300 122496 ?? S 1:32PM 0:37.62 /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --debug /Applications/Sonarr.app/Contents/MacOS/NzbDrone.exe /nobrowser /restart
caseyfriday 34578 0.0 0.0 2432804 1916 s003 S+ 2:34PM 0:00.00 grep mono
caseyfriday 34038 0.0 0.7 838580 113836 s000 S+ 2:24PM 0:09.15 mono /Applications/Sonarr.app/Contents/MacOS/NzbDrone.exe
@fridaynext
fridaynext / debug.log
Created February 3, 2017 18:50
wp debug log
[18-Jan-2017 16:16:18 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 16:16:18 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 17:35:03 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 17:35:03 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 19:00:13 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 19:00:13 UTC] PHP Notice: Trying to get property of non-object in /var/www/friday-next.com/htdocs/wp-content/themes/Divi/functions.php on line 8568
[18-Jan-2017 23:23:06 UTC] WordPress database error
<?php
// Add text to ticket sales "from - to" products
function add_membership_text( $price ) {
$this_variable_product = new WC_Product_Variable( get_the_ID() );
$prices = $this_variable_product->get_variation_prices( false );
$min_price = current( $prices['price'] );
$max_price = end( $prices['price'] );
$price = '<span class="member-price">' . $min_price . '</span> TBNA Membership Rate <br />';
$price .= '<span class="member-price">' . '$30' . '</span> Non-Member Rate';
<?php
// Get variation price for Ticket Sales
$the_min_price = null;
function this_variation_price( $price, $min_or_max = 'min', $display = false ) {
global $the_min_price;
$the_min_price = $price;
}
add_filter( 'woocommerce_get_variation_price', 'this_variation_price', 9 );
// Add text to ticket sales "from - to" products
<?php
// Get variation price for Ticket Sales
$the_min_price = null;
function this_variation_price( $price, $min_or_max = 'min', $display = false ) {
global $the_min_price;
$the_min_price = $price;
}
add_filter( 'woocommerce_get_variation_price', 'this_variation_price', 10, 1 );
<?php
// Change position of delivery/order time selction
add_filter('openinghours_chooser_position','change_position');
function change_position( $m ) {
return 'woocommerce_before_order_notes';
}
// Filter for message above time picker
add_filter('openinghours_frontendtext_choicelabel','change_closed_text');
<?php
//resize images uploaded to Gravity Form 1.
add_action("gform_after_submission_1", "gf_resize_images", 10, 2);
function gf_resize_images($entry, $form)
{
if( $url = pathinfo( $entry[18] ) ) {
$image = wp_get_image_editor($url);
if ( ! is_wp_error( $image ) )
{
//replace 640,480 with desired dimensions. false indicates not to crop image.