This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!
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( 'sanitize_file_name', 'my_sanitize_file_name' ); | |
function my_sanitize_file_name( $filename ) { | |
$original_chars = array( | |
'/А/','/Б/','/В/','/Г/', // cyrillic alphabet | |
'/Д/','/Е/','/Ж/','/З/','/И/', | |
'/Й/','/К/','/Л/','/М/','/Н/', | |
'/О/','/П/','/Р/','/С/','/Т/', |
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_action( 'template_redirect', 'redirect_if_not_logged_in' ); | |
function redirect_if_not_logged_in() { | |
if ( ! is_user_logged_in() ) wp_redirect( wp_login_url( $_SERVER['REQUEST_URI'] ) ); | |
} |
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( 'the_content', 'old_posts_warning' ); | |
function old_posts_warning( $content ) { | |
if ( is_singular( 'post' ) ) { | |
global $post; | |
$past_date = date_i18n( 'Y-m-d H:i:s', strtotime( '-1 year' ) ); | |
if ( $post->post_date < $past_date ) { | |
$content = '<p><strong>This content is over one year old. It may not be updated.</strong></p>' . $content; | |
} | |
} |
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 my_acf_block_render_callback( $block ) { | |
$slug = str_replace('acf/', '', $block['name']); | |
$block['slug'] = $slug; | |
$block['classes'] = implode(' ', [$block['slug'], $block['className'], $block['align']]); | |
echo \App\template("blocks/${slug}", ['block' => $block]); | |
} |
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 | |
/* Removes the "added to cart" message and "continue shopping" link after a product was added to the cart and the user was redirected to the cart page */ | |
add_filter( 'wc_add_to_cart_message_html', 'remove_wc_add_to_cart_message_html' ); | |
function remove_wc_add_to_cart_message_html( $message ) { | |
$message = ''; | |
return $message; | |
} | |
?> |
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
//Marco Almeida - Webdados | |
#target photoshop | |
app.bringToFront(); | |
app.preferences.rulerUnits = Units.PIXELS; | |
gFilesToSkip = Array( "db", "xmp", "thm", "txt", "doc", "md0", "tb0", "adobebridgedb", "adobebridgedbt", "bc", "bct" ); |
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( 'woocommerce_email_recipient_cancelled_order', 'cancelled_order_add_customer_email', 10, 2 ); | |
function cancelled_order_add_customer_email( $recipient, $order ) { | |
if ( $order ) { | |
return $recipient . ',' . ( version_compare( WC_VERSION, '3.0', '>=' ) ? $order->get_billing_email() : $order->billing_email ); | |
} else { | |
return $recipient; | |
} | |
} |
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
if ( ! function_exists( 'generate_lifterlms_start' ) ) : | |
/** | |
* Add LifterLMS starting wrappers | |
*/ | |
add_action('lifterlms_before_main_content', 'generate_lifterlms_start', 10); | |
function generate_lifterlms_start() | |
{ ?> | |
<div id="primary" <?php generate_content_class();?>> | |
<main id="main" <?php generate_main_class(); ?>> | |
<?php do_action('generate_before_main_content'); ?> |
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( 'woocommerce_sale_flash', 'percentage_woocommerce_sale_flash', 10, 3 ); | |
function percentage_woocommerce_sale_flash( $html, $post, $product ) { | |
if ( $html!='' ) { | |
$perc = round( 100 - ( $product->sale_price * 100 / $product->regular_price ) ); | |
if ( $perc>0 ) $html = '<span class="onsale">-'.$perc.'%</span>'; | |
} | |
return $html; | |
} |
NewerOlder