add_filter( 'the_content', function( $content ) { $words = explode( ' ', $content ); $word_count = count( $words ); …
Restore Bitnami WordPress Filesystem Permissions
sudo chown -R bitnami:daemon TARGET sudo find TARGET -type d -exec chmod 775 {} \; sudo find TARGET -type f -exec chmod 664 {} \; sudo …
Batch file to remove WordPress site in XAMPP
:: PHP, WP-CLI, and MYSQL all need to be path environment variables. :: If you get errors that indicate something is not recognized as an …
Batch file to create WP site in XAMPP
:: This is for spinning up installs for dev work, so don't consider this for :: production applications. It creates everything off a …
Add the Customizer to the Toolbar
add_action( 'admin_bar_menu', function( $wp_adminbar ) { global $wp; $current_url = home_url( add_query_arg( array(), $wp->request ) …
Validate user registration email with Proofy.io API
/** * Validates email in native WP registration using Proofy.io API. * * @param array $errors A WP_Error object …
Initialize Proofy.io API for email validation
add_action( 'init', function() { // Your user ID from Proofy $aid = 12345; // Your API key from Proofy $api_key = …
Add a custom default avatar to WordPress
/** * This can be used to apply a custom default avatar to your WordPress * install. Change the $custom_avatar value below to the …
Get post slug from post ID
$post_id = 7; $slug = get_post_field( 'post_name', $post_id ); …