-
core
WordPress 5.2.3
https://www.wp-plugin-api.com/version/wordpress-5-2-3/ https://www.wordfence.com/blog/2019/09/the-wordpress-5-2-3-security-release-unpacked/ -
theme_page_templates
Disable page’s “page templates” in page attributes
function hoge_remove_page_templates( $templates ) { // use unset() if you want to remove specific template // unset( $templates[‘page-templates/contributors.php’] ); // return $templates; // or just return empty array to remove the entire page templates input return array(); } add_filter( ‘theme_page_templates’, ‘hoge_remove_page_templates’ ); -
core
WordPress 5.2.2
https://www.wp-plugin-api.com/version/wordpress-5-2-2/ -
admin_init
Disable Comments
https://gist.github.com/mattclements/eab5ef656b2f946c4bfb -
Edit oembedded contents
Change excerpt length function wpa_oembed_excerpt_length() { return 20; } add_filter( ‘rest_oembed_output_excerpt_length’, ‘wpa_oembed_excerpt_length’, 9 ); Change oembedded content style function wpa_oembed_output() { ?> <style> .wp-embed { font-family: serif !important; } </style> <?php } add_action( ‘rest_oembed_output’, ‘wpa_oembed_output’, 11 ); -
core
WordPress 5.2.1 hooks
https://www.wp-plugin-api.com/version/wordpress-5-2-1/ -
core
WordPress 5.2 hooks
https://www.wp-plugin-api.com/version/wordpress-5-2/ -
wpcf7_init
Add customized fields in Contact Form 7
Add a field in Contact Form 7. In the form, insert [favorite_posts post_titles] In the email content, use [post_titles] In functions.php, add_action( ‘wpcf7_init’, ‘custom_add_form_tag_form_seminars’ ); function custom_add_form_tag_form_seminars() { wpcf7_add_form_tag( ‘favorite_posts’, ‘your_form_shortcode’, array(‘name-attr’ => true) ); // “form_seminars” is the type of the form-tag } function your_form_shortcode( $tag ) { if (!is_object($tag)) return ”; $name = $tag->{‘name’}; if (empty($name)) return ”; ob_start(); $args = array(‘post_type’ => ‘post’, ‘numberposts’ => -1 ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?> <table class=”table table-bordered”> <?php while ( $the_query->have_posts() ) { $the_query->the_post(); ?> <tr> <td style=”width:40px;”> <input type=”checkbox” id=”hoge_<?php the_ID(); ?>” name=”<?php echo $name; ?>[]” class=”wpcf7-form-control” value=”<?php echo esc_attr( get_the_title() […] -
pre_get_posts
Show Custom Post Types in archive page
Change ‘your-custom-post-type’ to your desired custom post type. You should use $query->is_main_query() to only show these in your archive page (if you don’t, your custom post type posts may show up in your sidebar widget, etc.). function hoge_show_cpt_archives( $query ) { if( is_tag() && $query->is_main_query() ) { $query->set( ‘post_type’, array( ‘post’, ‘your-custom-post-type’ )); return $query; } } add_filter( ‘pre_get_posts’, ‘hoge_show_cpt_archives’ ); -
woocommerce_email_headers
WooCommerce BCC emails to specific email address
function add_bcc_all_emails( $headers, $object ) { $headers = array( $headers, ‘Bcc: Me <my@mail.net>’ .”\r\n”, ); return $headers; } add_filter( ‘woocommerce_email_headers’, ‘add_bcc_all_emails’, 10, 2 ); https://stackoverflow.com/questions/52924180/woocommerce-bcc-all-mails