Disable resizing of gif when uploaded

image_make_intermediate_size was not the hook I was looking for, but intermediate_image_sizes_advanced. Here is a working code: function disable_upload_sizes( $sizes, $metadata ) { // Get filetype data. $filetype = wp_check_filetype($metadata[‘file’]); // Check if is gif. if($filetype[‘type’] == ‘image/gif’) { // Unset sizes if file is gif. $sizes = array(); } // Return sizes you want to … Read more

apply_filters() slices away needed arguments

Two inherent problems with your script as posted. I’m not certain this will solve your problem, but it’s too big to address in the comments. First, you need to use add_action(), not add_filter(). That by itself is not a huge deal because add_action() is just a wrapper for add_filter(), but you should still use the … Read more

How can I send data to admin-ajax via JS Fetch?

Is it proper way to pass the data in the form like I did? If you mean the body part (of your fetch() call), then yes, it is okay. However, You must send a query named action as part of the request (e.g. via the URL like example.com/wp-admin/admin-ajax.php?action=test), so that WordPress knows what AJAX action … Read more

Customizing WordPress the_title with add_filter

The issue is that you are mixing up the $title variables. $title is the parameter passed to the new_title function, but then you use it as an array: $title[‘custom_version’]. Try this: add_filter(‘the_title’, ‘new_title’, 10, 2); function new_title($title, $id) { if(‘custom_version’ == get_post_type($id)) $title=”Application has been updated to v”.$title; return $title; } I’d also highly recommend … Read more

Display WooCommerce newest product reviews on top [closed]

I couldn’t find this documented anywhere, but the solution is pretty simple. In single_product_review.php, the arguments passed to wp_list_comments are filtered: wp_list_comments( apply_filters( ‘woocommerce_product_review_list_args’, array( ‘callback’ => ‘woocommerce_comments’ ) ) ); by adding reverse_top_level to the arguments, the order is reversed. Add the following code to your theme’s functions.php: // show newest product reviews on … Read more

How to hook wp_list_pages?

A quick Google Search came up with this Source Try the following: function wp_list_pages_filter($output) { // modify $output here, it’s a string of <li>’s by the looks of source return $output; } add_filter(‘wp_list_pages’, ‘wp_list_pages_filter’);

How to disable all WordPress emails modularly and programatically?

Option 1: Remove the ‘to’ argument from wp_mail function in WordPress, it will keep your system running without sending any default WordPress emails. add_filter(‘wp_mail’,’disabling_emails’, 10,1); function disabling_emails( $args ){ unset ( $args[‘to’] ); return $args; } The wp_mail is a wrapper for the phpmailer class and it will not send any emails if there is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)