Skip to content

Instantly share code, notes, and snippets.

View rotisoft's full-sized avatar

Tamas "RotiSoft" Rottenbacher rotisoft

View GitHub Profile
@rotisoft
rotisoft / php.ini
Last active June 20, 2021 08:24
WordPress honlap alap/ajánlott PHP értékek megadása.
max_execution_time = 180
max_input_time = 300
max_input_vars = 10000
memory_limit = 256M
upload_max_filesize = 128MB
post_max_size = 128M
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
<?php
/*
* Plugin Name: Pont shipping for Woocommerce - Add custom Prefix
* Plugin URI: https://rotisoft.hu/bovitmenyek/
* Description: Szathmari Andor WC-PONT Sprinter rendszernel elotag hozzadasa, hogy SprinterPartnerPortalon egyes webshopok rendelesei elkulonithetoek legyenek.
* Version: 1.0
* Author: Rottenbacher RotiSoft Tamas
* Author URI: https://rotisoft.hu/
*
* Requires at least: 5.7
/**
* Add that code to your theme functions.php file. Choose or modify which file/mime type need and delete the others.
* Replace the file type. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
* Gist by Tamas Rottenbacher
* Source: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/
*/
function approve_mime_types($mime_types){
$mime_types['rar'] = 'application/x-rar-compressed'; // Approve .rar file upload
$mime_types['bmp'] = 'image/bmp'; // Approve .bmp image upload
$mime_types['svg'] = 'image/svg+xml'; // Approve .svg image upload
/**
* Add that code to your theme functions.php file. Choose or modify which file/mime type need and delete the others.
* Replace the file type. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
* Gist by Tamas Rottenbacher
* Source: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/
*/
function disable_mime_types($mime_types){
unset($mime_types['bmp']); // Disable .bmp file upload
unset($mime_types['tiff']); // Disable .tiff file upload
return $mime_types;