UTF-32be error WordPress

This means the file is encoded in UTF-32, an encoding that PHP doesn’t support. Open the file in a text editor that does support it, and convert it to UTF-8 without BOM. You should also check the other files in that plugin and contact the author to make them aware of the problem.

Disable globally “Crop thumbnail to exact dimensions (normally thumbnails are proportional)” with Multisite

To disable cropping, insert this below code in disable-automatic-image-crop.php file in your mu-plugins folder: <?php /* Plugin Name: Disable Automatic Image Crop Author: WordPress Community Description: https://gist.github.com/czenzel/0f5888cbbfa4a857e56361dd3bc19b39 */ add_action( ‘init’, ‘czc_disable_extra_image_sizes’ ); add_filter( ‘image_resize_dimensions’, ‘czc_disable_crop’, 10, 6 ); function czc_disable_crop( $enable, $orig_w, $orig_h, $dest_w, $dest_h, $crop ) { // Instantly disable this filter after the … Read more

How to display the featured post on the category page?

The problem is not in code to Displaying Feature post in category page. the problem is to add feature post meta into post. First, checked() by default echo, so you have to pass false attribute to prevent echo. function add_featured_meta_box($post){ $featured = get_post_meta($post->ID, ‘_featured-post’, true); echo “<label for=”_featured-post”>”.__(‘Feature this post?’, ‘foobar’).”</label>”; echo “<input type=”checkbox” name=”_featured-post” … Read more

Proper way to handle admin-ajax calls

The PHP part of your code looks more or less OK. (There are some security concerns and you shouldn’t echo an array of objects, but you’ll get it when you see it). But your code doesn’t work because of an error in your JS. You should send “action” as data and not as a setting… … Read more

Custom API plugin to execute 3rd party API to retrieve data

If you need to pass username and password for Basic Auth you need to send that in headers e.g. $headers = array(‘Authorization’ => ‘Basic ‘ . base64_encode( YOUR_USERNAME . ‘:’ . YOUR_PASSWORD ); $response = wp_remote_post( $url, array( ‘method’ => ‘POST’, ‘timeout’ => 45, ‘headers’ => $headers ) ); If you need to pass username … Read more

Problem with add_action

Yo don’t properly call the callback function. If you want to code on oriented object programmation, you have to create your class, and construct function with add_action… Here more informations about it : https://wordpress.stackexchange.com/a/48094/9716 or you do something like this (its no POO but its working as well). add_action( ‘woocommerce_subscription_status_active’, ‘add_subscription_course_access’ ) ); function add_subscription_course_access( … Read more