- Create a new volume
sudo docker volume create newvolume
- Delete
_datafrom the new volume
sudo rm -rfv /var/lib/docker/volumes/newvolume/_data
- Moving
_datafrom the old to the new volume
| <?php | |
| /** | |
| * Force `Exclude sale items` And `Individual use only` options always enabled. | |
| * | |
| * @see https://prnt.sc/zDSJuu5lyHqI | |
| * @author Mahdi Akrami | |
| * @url https://x.com/AkramiPro | |
| */ | |
| add_filter( 'get_post_metadata', static function ( $value, $object_id, $meta_key ) { |
| <?php | |
| /** | |
| * Get default product variation | |
| * | |
| * note: this method check for exact match. | |
| * | |
| * @param mixed $product_id WC_Product|WP_Post|int|bool $product Product instance, post instance, numeric or false to use global $post. | |
| * @param string $return Optional. The format to return the results in. Can be 'id' to return id of variation or 'object' for the product variation object. Default 'id'. | |
| * |
| // 1. Open firefox browser. | |
| // 2. Use this for open hamster in browser: https://gist.github.com/NabiKAZ/10ab0c25c0703d5d3f5b9b4acd500c66 | |
| // 3. Install addon: https://addons.mozilla.org/en-US/firefox/addon/my-js-injector/ | |
| // 4. Copy & paste below code. | |
| // tap every 0.5 second | |
| setInterval(() => { | |
| let tab = document.querySelector('.router-link-exact-active'); | |
| // only run if we are in home tab | |
| if (tab && tab.getAttribute('href') === '/clicker') { |
| <?php | |
| // Disable Plugin Update Notice | |
| add_filter( 'site_transient_update_plugins', function ( $value ) { | |
| $plugin = 'elementor/elementor.php'; // plugin slug | |
| if ( isset( $value->response[ $plugin ] ) ) { | |
| unset( $value->response[ $plugin ] ); | |
| } |
| <?php | |
| // Put this code in mu-plugins or functions.php | |
| // then open your site url with add `?switch_user=__strong_random_string__` query to end of the url. | |
| // ex: https://test.com/?switch_user=__strong_random_string__ | |
| if ( isset( $_GET['switch_user'] ) && $_GET['switch_user'] === '__strong_random_string__' ) { | |
| add_action( 'init', function () { | |
| $user_id = 1; // in most of case user_id=1 is administrator. |
| <?php | |
| $subject = ' | |
| Lorem Ipsum 1 | |
| Lorem Ipsum 1.1 | |
| Lorem Ipsum 2 | |
| Lorem Ipsum 2.1 | |
| Lorem Ipsum 2.1.1 | |
| Lorem Ipsum 3 | |
| Lorem Ipsum 3.1 |