How do change the value of a session before form submission

I created a custom module that allows users to enter their information, and during the form submission, I set a session with the name that they type in the form: $session = \Drupal::request()->getSession(); $session->set(‘contact_first_name’, $form_state->getValue(‘first_name’)); Next, I set the name as a variable to be used on another page that I created as a thank…

How to remove function from a hook?

Here is my hook “single_template” var dump : object(WP_Hook)#10617 (5) { [“callbacks”]=> array(2) { [10]=> array(2) { [“000000001add804b00000000057cd55eregisterSingleTemplate”]=> array(2) { [“function”]=> array(2) { [0]=> object(MikadoCore\CPT\Portfolio\PortfolioRegister)#12052 (2) { [“base”:”MikadoCore\CPT\Portfolio\PortfolioRegister”:private]=> string(14) “portfolio-item” [“taxBase”]=> string(18) “portfolio-category” } [1]=> string(22) “registerSingleTemplate” } [“accepted_args”]=> int(1) } [“000000001add809e00000000057cd55eregisterSingleTemplate”]=> array(2) { [“function”]=> array(2) { [0]=> object(MikadoHotel\CPT\HotelRoom\HotelRoomRegister)#12225 (2) { [“base”:”MikadoHotel\CPT\HotelRoom\HotelRoomRegister”:private]=> string(10) “hotel-room” [“taxBase”:”MikadoHotel\CPT\HotelRoom\HotelRoomRegister”:private]=>…

My WordPress activation hook isn’t working

I just can’t see why my activation hook isn’t working. /* ****Debug function ****/ function console_log( $data ){ echo ‘<script>’; echo ‘console.log(‘. json_encode( $data ) .’)’; echo ‘</script>’; } console_log (“Hello from main”); /* ***Set up activation and deactivation functions** *** Activate sets up the WP tables “picm”** *** Deactivate removes the WP tables “picm”…