Is there a hook that I can use when a fatal error occurs?

Look into the WP_Fatal_Error_Handler class. I see a couple of filters in its display_default_error_template() method that might be helpful for you: wp_php_error_args wp_php_error_message The entire class is a drop-in, so if you need to you can replace it entirely with your own version, but I think one of those filters—probably wp_php_error_args—might be what you’re looking … Read more

WordPress @include( ‘template-config.php’ );

Something in your theme is not written properly. I can’t tell you what it is exactly as I don’t know what your code is. Seeing as that code is supposed to be php, and is being shown on your page, I am going to assume that there is no <?php ?> tags around it, and … Read more

Add text below WooCommerce short description if metabox value is true

Following the suggestion by @1inmillion, I put the second filter inside the first IF statement, which works nicely. This is the combined code: // 1. Add text below short description function bja_product_unavailable_text( $content ) { $content .= ‘<div class=”bja_product_unavailable”>This product is unavailable</div>’; return $content; } // 2. Remove add to cart button if product is … Read more

Adding caption to all images inside an article

I’m not 100% sure if I understand your question 100%, but WordPress, by default, displays the caption if it’s filled on the image. Then it displays it just below the image once the image is inserted. Here is an example where I just filled it out on one image 👇

I want to allow certain file types on dokan upload files

You can try allowing mimes yourself, like this : add_filter(‘upload_mimes’, ‘custom_upload_mimes’); function custom_upload_mimes($existing_mimes) { $existing_mimes[‘rbxlx’] = ‘text/xml’; $existing_mimes[‘rbxlm’] = ‘text/xml’; $existing_mimes[‘rbxl’] = ‘text/xml’; return $existing_mimes; } If this doesn’t help, you need to look outside WP – it’s possible the server itself won’t allow those uploads. Can you access the .htaccess ? If so, you … Read more

PHP Add products to cart with WooCommerce Addons

The WooCommerce Cart add_to_cart function takes a parameter for cart_item_data. To make this work, you simply need to pass the addon data to add_to_cart. Something like this: $addons = array( array( “name” => “Size”, “value” => “2.5×7”, “price” => 0, “field_name” => “5186-0”, “field_type” => “multiple_choice”, “id” => “1683555538”, “price_type” => “flat_fee” ), array( “name” … Read more