1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<?php
namespace SIW\Compatibility;
class Plugins {
public static function init() {
$self = new self();
add_filter( 'wpmtst_post_type', [ $self, 'set_wpmtst_post_type_slug' ] );
add_action( 'init', [ $self, 'remove_extra_image_size'] );
add_filter( 'limit_login_whitelist_ip', [ $self, 'process_whitelisted_ips'], PHP_INT_MAX, 2 );
}
public function set_wpmtst_post_type_slug( array $args ) {
$args['rewrite']['slug'] = 'ervaring';
return $args;
}
public function remove_extra_image_size() {
remove_image_size( 'widget-thumbnail' );
}
public function process_whitelisted_ips( bool $allow, string $ip ) {
$ip_whitelist = siw_get_option( 'ip_whitelist' );
if ( is_array( $ip_whitelist ) && in_array( $ip, $ip_whitelist ) ) {
$allow = true;
}
return $allow;
}
}