Remove image sizes in WordPress
/** * Function to Remove image size. * @param [string] $size */ function remove_image_size_by_size($size) { $dimension = explode('x', $size); global
/** * Function to Remove image size. * @param [string] $size */ function remove_image_size_by_size($size) { $dimension = explode('x', $size); global
Delete posts based on search # Spaces needs replace with + (plus sign) # Eg: hello+world wp post delete $(wp
/** * Fix weird output encoding. */ function run_command($command) { $string = shell_exec($command); $string = mb_convert_encoding($string, 'UTF-8', 'UTF-16LE'); return $string;
Create touch.cmd with the following content and it to ENV Path. @echo off setlocal enableextensions disabledelayedexpansion (for %%a in (%*)
Disable ipv6 Create /etc/sysctl.d/60-ipv6-disable.conf with the following contents: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 Run service procps
/** * Send push based on last active time (Intelligent Delivery). */ add_filter( 'onesignal_send_notification', function( $fields ) { $fields['delayed_option'] =
/** * Logged in for 1 year. */ add_filter( 'auth_cookie_expiration', function() { return YEAR_IN_SECONDS; });
To learn more about the issue: https://github.com/wp-media/wp-rocket/issues/1936 Fix: // Fires before an existing post is updated in the database. add_action(
add_filter('as3cf_get_attachment_url', function($url) { // Regex matches both http and https. $url = 'https://cdn.statically.io/img/' . preg_replace('#^https?://#', '', $url); return $url; });
Login as root then enter command nano /etc/network/interfaces If have something like this on that file iface enp1s0f0 inet static
Disable Greylisting Disabling Greylisting helps to receive emails without any delay. touch /etc/postgrey/whitelist_clients.local nano /etc/postgrey/whitelist_clients.local Add contents: # Don't greylist
Fix files/folder permissions https://www.turek.dev/post/fix-wsl-file-permissions/ Add some useful aliases cd && touch .bash_aliases add below lines to .bash_aliases # Open Windows
/** * Get system ipv4 addresses. * Works on Linux only. * @return [array] */ function getSystemIPs() { $ips =
If you look at the CURLOPT_INTERFACE manual you will find that setting it to NULL to will tell cURL to
Login as root then enter following commands. cd /etc/nginx-rc git clone https://github.com/satellitewp/rocket-nginx.git cd rocket-nginx cp rocket-nginx.ini.disabled rocket-nginx.ini php rocket-parser.php As