-
core
WordPress 5.6.1
https://www.wp-plugin-api.com/version/wordpress-5-6-1/ https://wordpress.org/news/2021/02/wordpress-5-6-1-maintenance-release/ -
wp_new_user_notification_email
Customize new user notification email
add_filter( ‘wp_new_user_notification_email’, ‘custom_wp_new_user_notification_email’, 10, 3 ); function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname ) { $key = get_password_reset_key( $user ); $message = sprintf(__(‘Welcome to the Community,’)) . “\r\n\r\n”; $message .= ‘To set your password, visit the following address:’ . “\r\n\r\n”; $message .= network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user->user_login), ‘login’) . “\r\n\r\n”; $message .= “After this you can enjoy our website!” . “\r\n\r\n”; $message .= “Kind regards,” . “\r\n”; $message .= “Support Office Team” . “\r\n”; $wp_new_user_notification_email[‘message’] = $message; $wp_new_user_notification_email[‘headers’] = ‘From: MyName<example@domain.ext>’; // this just changes the sender name and email to whatever you want (instead of the default WordPress <wordpress@domain.ext> return $wp_new_user_notification_email; } https://wordpress.stackexchange.com/questions/306642/customize-wp-new-user-notification-email -
woocommerce_is_purchasable
How to Hide ‘Add to Cart’ Button in WooCommerce
add_filter( ‘woocommerce_is_purchasable’, ‘__return_false’); Source: https://wisdmlabs.com/blog/the-right-way-to-hide-add-to-cart-button-in-woocommerce/ -
woocommerce_register_post_type_product
How to change WooCommerce Products post type name
add_filter( ‘woocommerce_register_post_type_product’, ‘so_26712459_post_type’ ); function so_26712459_post_type( $args ){ $labels = array( ‘name’ => __( ‘Tours’, ‘your-custom-plugin’ ), ‘singular_name’ => __( ‘Tour’, ‘your-custom-plugin’ ), ‘menu_name’ => _x( ‘Tours’, ‘Admin menu name’, ‘your-custom-plugin’ ), ‘add_new’ => __( ‘Add Tour’, ‘your-custom-plugin’ ), ‘add_new_item’ => __( ‘Add New Tour’, ‘your-custom-plugin’ ), ‘edit’ => __( ‘Edit’, ‘your-custom-plugin’ ), ‘edit_item’ => __( ‘Edit Tour’, ‘your-custom-plugin’ ), ‘new_item’ => __( ‘New Tour’, ‘your-custom-plugin’ ), ‘view’ => __( ‘View Tour’, ‘your-custom-plugin’ ), ‘view_item’ => __( ‘View Tour’, ‘your-custom-plugin’ ), ‘search_items’ => __( ‘Search Tours’, ‘your-custom-plugin’ ), ‘not_found’ => __( ‘No Tours found’, ‘your-custom-plugin’ ), ‘not_found_in_trash’ => __( ‘No Tours found in trash’, ‘your-custom-plugin’ ), ‘parent’ => __( ‘Parent […] -
gettext
Override translations
Override “Add to Cart” etc for virtual products in WooCommerce <?php add_filter( ‘gettext’, ‘studio_gettext’, 10, 3); function studio_gettext( $translation, $text, $domain ) { if ( ‘woocommerce’ === $domain ) { global $product; if ( ‘%s in stock’ === $text && $product->is_virtual() ){ $translation = ‘Available %s persons’; } if ( ‘Add to cart’ === $text && $product->is_virtual() ){ $translation = ‘Sign up’; } } return $translation; } ?> -
wpcf7_form_elements
Contact Form 7 change text of select include_blank
/** * Customize the default option selected on CF7 */</span> <span class=”hljs-function”><span class=”hljs-keyword”>function</span> <span class=”hljs-title”>my_wpcf7_form_elements</span>(<span class=”hljs-params”>$html</span>) </span>{ $text = <span class=”hljs-string”>’—'</span>; $html = str_replace(<span class=”hljs-string”>’—‘</span>, $text , $html); <span class=”hljs-keyword”>return</span> $html; } add_filter(<span class=”hljs-string”>’wpcf7_form_elements'</span>, <span class=”hljs-string”>’my_wpcf7_form_elements'</span>); Source: https://stackoverflow.com/questions/26902160/contact-form-7-default-option-print-as-selected-value-in-mail -
core
WordPress 5.2.2, 5.2.3
(You shouldn’t use 5.2.2) https://www.wp-plugin-api.com/version/wordpress-5-5-2/ https://www.wp-plugin-api.com/version/wordpress-5-5-3/ -
pre_site_transient_update_core
Disable WordPress update notification
// hide update notifications function remove_core_updates(){ global $wp_version;return(object) array(‘last_checked’=> time(),’version_checked’=> $wp_version,); } add_filter(‘pre_site_transient_update_core’,’remove_core_updates’); //hide updates for WordPress itself add_filter(‘pre_site_transient_update_plugins’,’remove_core_updates’); //hide updates for all plugins add_filter(‘pre_site_transient_update_themes’,’remove_core_updates’); //hide updates for all themes Reference: https://thomas.vanhoutte.be/miniblog/wordpress-hide-update/ -
woocommerce_quantity_input_args
Making the Quantity Field a Dropdown in WooCommerce
https://aceplugins.com/making-the-quantity-field-a-dropdown-in-woocommerce/ -
Allow shortcodes in widgets
add_filter( ‘widget_text’, ‘do_shortcode’ );