I’m pasting all of it here, but the problem is that it worked before and suddenly it’s all php error, when i try to add new or re-add after I cleaned it all to test.
// Allow SVG
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
global $wp_version;
if ( $wp_version !== '4.7.1' ) {
return $data;
}
$filetype = wp_check_filetype( $filename, $mimes );
return [
'ext' => $filetype['ext'],
'type' => $filetype['type'],
'proper_filename' => $data['proper_filename']
];
}, 10, 4 );
function cc_mime_types( $mimes ){
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );
function fix_svg() {
echo '<style type="text/css">
.attachment-266x266, .thumbnail img {
width: 100% !important;
height: auto !important;
}
</style>';
}
add_action( 'admin_head', 'fix_svg' );
add_filter( 'pms_member_account_tabs', 'pmsc_change_member_account_tabs', 20, 2 );
function pmsc_change_member_account_tabs( $tabs, $args ) {
$tabs['obqvi'] = __( 'Обяви', 'paid-member-subscriptions' );
$tabs['poruchki'] = __( 'Поръчки', 'paid-member-subscriptions' );
return $tabs;}
add_filter( 'pms_account_shortcode_content', 'pmsc_custom_tab_content', 20, 2 );
function pmsc_custom_tab_content( $output, $active_tab ) {
if ( $active_tab == 'obqvi' ) {
$output .= '<h3 class="grids-h">Вашите обяви</h3><a class="grids-a" >Създайте обява</a>';
$output .= '[wpv-view name="ac-template" ids="6554"]';
}
if ( $active_tab == 'poruchki' ) {
$output .= '<h3 class="grids-h">Вашите поръчки</h3>';
$output .= '<div class="row-2">
<div class="column-2">Поръчка №</div>
<div class="column-2">Дата</div>
<div class="column-2">Име</div>
<div class="column-2">Общо в лв.</div>
</div>';
$output .= '[wpv-view name="orders" ids="7980"]';
}
return $output;}
/**
* Filter the upload size limit for non-administrators.
* @param string $size Upload size limit (in bytes).
* @return int (maybe) Filtered size limit.
*/
function filter_site_upload_size_limit( $size ) {
// Set the upload size limit to 1 MB for users lacking the 'manage_options' capability.
if ( ! current_user_can( 'manage_options' ) ) {
// 1 MB.
$size = 1024 * 5000;
}
return $size;
}add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 );
//For limiting file type
add_filter('upload_mimes','restict_mime');
function restict_mime($mimes) {
$mimes = array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
);
return $mimes;
}