Problem with add_action

I have a function that i need to run every time a subscription status changes to active, This is my code: add_action( ‘woocommerce_subscription_status_active’, array( __CLASS__,’add_subscription_course_access’ ) ); public static function add_subscription_course_access( $order ) { $products = $order->get_items(); $customer_id = $order->get_customer_id(); $courses_id = get_field(‘user-programs’, ‘user_’. $customer_id); $courses_id = str_replace(“[“,””,$courses_id); $courses_id = str_replace(“]”,””,$courses_id); $courses_id = explode(“,”,$courses_id); foreach…

Details

rsync to copy all files in current folder into subfolder in same dir and exclude “.” files and folders

On mac ❯ rsync –help rsync version 2.6.9 protocol version 29 I have a folder with a bunch of files and subfolders and “.” files and “.” folders. I want to copy all the files and folders to one of the subfolders named “subfolder” and exclude any “.” folders from that copy. Everything I’ve seen…

Details

sed substitution challenge with special characters

I’m trying to use sed to convert TB to GB. The fields with TB are either single-digit (2T, 8T) or multiple digits (2.001T, 1.501T.) I thought I had my substitution working, but I’ve got an error and I can’t seem to figure it out. Sample of file: ftwepsiprdsql02,ftwepsiprdsql02_F,2.001T,1.680T ftwepsiprdsql02,ftwepsiprdsql02_G,801G,176.786G ftwepsiprdsql02,ftwepsiprdsql02_H,501G,6.565G ftwepsiprdsql02,ftwepsiprdsql02_I,1.001T,539.504G ftwepsiprdsql02,ftwepsiprdsql02_J,501G,478.211G ftwepsiprdsql02,ftwepsiprdsql02_X,1.501T,68.021G rxi0738_foc_cl1,rxi0738_foc_cl1_lun248,8T,4.450T rxi0738_foc_cl1,rxi0738_foc_cl1_lun250,8T,5.857T…

Details

Unable to disable kernel module

I’m trying to disable kernel module for my motherboard’s bluetooth chip: btintel. I’ve added a blacklist entry to /etc/modprobe.d/blacklist-btintel.conf (I also tried blacklist.conf, this didn’t make a difference): blacklist btintel I have also symlinked this file to /usr/lib/modprobe.d/ because of this possible issue. Furthermore, I’ve edited /etc/sysconfig/grub, to include the module in both rd.driver.blacklist as…

Details