Calling PHP function with AJAX

I am creating a plugin for wordpress for the backend. I when the admin press a button a js function is being called. In this js function, I am calling an API, and then I want to call a PHP with the result and the order id as a parms. so I have done this: action.php

function openpopup($  order_id) {         ?>       <button id="shipping360_create_delivery" data-id= "<?php echo $  order_id?>"              style="background-color: #2e4453; color:#fff; border-radius: 5px;text-align: center;width:100px;height:auto;font-size:10px; line-height: 1.5em;  border: none;-webkit-appearance: none; outline: none; padding:10px;cursor: pointer;">create</button>     <?php             popup($  order_id);      }   add_action('wp_ajax_update_order', 'update_order');   function update_order() {           $  order_id = isset($  _POST['id']) ? $  _POST['id'] : 0;     $  shipping_number = isset($  _POST['shipping_num']) ? $  _POST['shipping_num'] : "";     $  order = wc_get_order($  order_id);      update_post_meta($  order_id, 'shipping_number', $  shipping_number);     $  order->add_order_note($  shipping_number);     die();   }  

the popup function opens a pop-up with the order details. inside the popup function I have a button with the id "create_order" (this function has a lot of HTML and doesn’t really matter – the point is the button). Now for the app.js file

(function ($  ) {  $  (document).ready(function () {         $  ('#close').click(function () { //this is closing the pop-up             document.body.style = "overflow: scroll";              $  ('#order-model').hide();         });         $  ("#createorder").click(function () { /// this is the call for the main function              createDelivery();         });          $  ("#shipping360_create_delivery").click(function () { // this is opening the pop-up             $  ('#order-model').show();             document.body.style = "overflow: hidden;margin: 0;";          })     }) }(jQuery));     function createDelivery() {     // creates new delivery      const URL = BASE + "/shipping";      const distributor = document.getElementById("distributor").value;     const token = document.getElementById("ordertoken").innerHTML;     const companyid = document.getElementById("ordercompanyid").innerHTML;     const direction = "1";     const type = document.getElementById("ordertype").innerHTML;     const order_id = document.getElementById("ordernumber").innerHTML;      if (distributor == "") {         alert("Please fill all fields")     }      else {         senderinfo = "";//have data -- does not really matte         receiverinfo = ""; // have data -- does not really matter         const Data = {             senderinfo: senderinfo,             receiverinfo: receiverinfo,             type: type,             distributor: distributor,             companyid: companyid,             token: token,             direction: direction         }         const otherPram = {             headers: { "Content-Type": "application/json; charset=UTF-8" },             body: JSON.stringify(Data),             method: 'POST'         };         console.log(URL)         fetch(URL, otherPram)             .then(data => {                 return data.json()             })             .then(res => {                 body = res["body"]; //////////////////-----------------------/////////////////////////////// up to this point everything is working fine                 (function ($  ) {                     $  .ajax({                         type: "POST",                         url: ajaxurl,                         cache: false,                         data: {                             'action': 'update_order',                             'id': order_id,                             'shipping_num': body,                         },                         success: function (response) {                             location.reload();                             alert(response);  // not popping up                         },                         fail: function () {                             alert("helllo");  // I have put this and the one below just for checking  // not popping up                         },                         complete: function () {                             alert("hiii") // when I call my function this is that only on the pops up                         }                     });                 })(jQuery);               }).catch(function (error) {                 alert("Got an error:", error);               });       }  }      

Thanks for the help

How can i make anchor tags clickable when using the function z index

the nav is set absolute to the headerContainer. And in motion it works fine. It needs to drop from behind the headerContainer over the main content of the page. This way the content dissapears and the menu is on top. I have done so by setting my main class to relative and a negative z-index: 2; because the nav is set to negativ -1;

Right now everything works and it looks good. The only problem is that the anchor tags inside my nav are not clickable anymore.

I have been searching for the answer but could not find anything related. Is there anyone who can tell me why this occurs? I have yet to find a good solution for this.

What i want to happen seems so simple.. it needs to drop down from behind or at least create the idea its coming from behind the header..

I have tried setting the height of the nav to 0 and on click set it to 100%. That wil drop the menu as if it comes from behind. but gave me other problems like the anchors would come in later or sooner then the actual nav background.

Here is the code.

let Btn = document.querySelector(".menuBtn"); let menu = document.querySelector("nav"); let icon = document.querySelector(".fa-bars"); Btn.onclick = () => {     menu.classList.toggle("show");     icon.classList.toggle("fa-times"); } 
* {     margin: 0;     padding: 0; } body {     background: #F5F5F5;     color: #1F1F1F;     font-family: 'Open Sans', sans-serif;     font-size: 20px; } a {     text-decoration: none;     color: #1F1F1F; } /* --- HEADER --- */ header {     width: 100%;     height: auto;     background: #FFF; } .headerContainer, .container {     width: 90%;     max-width: 1140px;     margin: auto;     padding: 15px; } .headerContainer {     display: flex;     justify-content: space-between;     align-items: center;     position: relative; } /* --- Logo --- */ .headerBrand a {     font-size: 2rem;     font-weight: 800;     display: flex;     align-items: center; } .headerBrand img {     padding: 0 15px 0 0; } /* --- NAV --- */ header nav {     z-index: -1;     /* display: none; */     padding: 15px;     width: calc(100% - 30px);     position: absolute;     top: -100px;     left: -1px;     background: #ffffff;     transition: top 2s; } header nav.show {     top: 100%; } header nav ul.mainMenu {     list-style: none; } header nav ul li a:hover {     color: red; } .menuBtn {     width: 35px;     height: 35px;     text-align: center;     background: red;     font-size: 25px;     border-radius: 5px;     cursor: pointer;     color: #FFF; } /* --- MAIN --- */ main {     position: relative;     z-index: -2; } 
<link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Open+Sans&family=Poppins&display=swap" rel="stylesheet"> <script src="https://kit.fontawesome.com/a9b20b17fc.js" crossorigin="anonymous"></script>  <!-- header-->         <header>             <div class="headerContainer">                 <!-- Logo or Brandname -->                 <div class="headerBrand">                     <a href=""><img src="https://krijgeronline.nl/assets/img/logo.png" width="auto" height="80px"> Logo text</a>                 </div>                 <!-- END Logo -->                 <!-- Nav -->                 <nav>                     <ul class="mainMenu">                         <li><a href="#">First link</a></li>                         <li><a href="#">Second link</a></li>                         <li><a href="#">Thirth link</a></li>                         <li><a href="#">Fourth link</a></li>                     </ul>                 </nav>                 <div class="menuBtn"><i class="fas fa-bars"></i></div>                 <!-- END Nav -->             </div>         </header>         <!-- END header-->         <!-- Main -->         <main class="container">             <section>                 <h1>This is a header</h1>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>             </section>         </main>         <!-- END Main--> 

Compile function with only some variables

I made the simple example below for explaining the problem. How can I compile only some variables?
For example, in the example only a and b are Integer, c can be any type.

In[218]:= cf = Compile[{{a, _Integer}, {b, _Integer}, c}, a*b + c]; cf[2, 3, d] CompiledFunction::cfsa: Argument d at position 3 should be a machine-size real number. Out[219]= 6 + d 

How can I solve this warning and make this work for any c?
I want "c" to be anything.

How can I find the name of a function and replace with another name in a plugin?

I would like to replace a button name "CV Manager" with "Upload Resume". The button is part of a list of menu buttons in a user dashboard. It function is to direct candidates to upload their resumes and I would like the button to say just that. Can anyone please tell me where in the plugin database I can find that button and replace it by using the "plugin editor" in wordpress? Thank you

Cannot assign to function call when looping through and converting excel files [closed]

With this code:

 xls = pd.ExcelFile('test.xlsx') sn = xls.sheet_names for i,snlist in list(zip(range(1,13),sn)):     'df{}'.format(str(i)) =  pd.read_excel('test.xlsx',sheet_name=snlist, skiprows=range(6))  

I get this error:

‘df{}’.format(str(i)) = pd.read_excel(‘test.xlsx’,sheet_name=snlist, skiprows=range(6)) ^ SyntaxError: cannot assign to function call

df+str(i) also return error

i want to make result as: df1 = pd.read_excel.. list1… df2 = pd.read_excel… list2….

Passing an expression to the Plot Function does not Work

Solving a differential equation I found that its solution was analytic, and I stored it as an expression from the default rule output of the DSolve[] function:

soleq2 = y[x] /. soleq2[[1, 1]]

Which has output:

Sqrt[x] BesselJ[Sqrt[13]/2, x] C[1] + Sqrt[x] BesselY[Sqrt[13]/2, x] C[2]

I then plotted this:

Manipulate[Plot[soleq2, {x, 0, 10}], {C[1], 0, 10}, {C[2], 0, 10}]

but the plot does not show anything, only the sliders for the modulation of C[1] and C[2]. I tried substituting these constants with other letters thinking their format might interfere with the kernel, but to no avail.

Do the different wordings of the Great Weapon Fighting style printed in the PHB cause them to function differently?

I had a question about ‘Great Weapon Fighting’ as it applied to Paladins, which lead me here: Does Great Weapon Fighting apply to Superiority Die rolls? During my research. While the answer cleared up my original question, I have a follow up question.

First, my question: When rolling for Great Weapon Fighting style as a Paladin, does the differentiation detailed below mean I can continue to re-roll all 1’s and 2’s until I get a 3 or higher?

Secondly, the differentiation: I noticed there is a variance between the Great Weapon Fighting entry in the Fighter listing on PHB pg 72 :

When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can re-roll the die and must use the new roll, even if the new roll is a 1 or a 2. The weapon must…

Emphasis on the differentiation from the entry, of the same Great Weapon Fighting style, found in the Paladin listing on PHB pg 84 :

When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can reroll the die and must use the new roll. [missing] The weapon must…

This particular entry is missing the crucial “even if the new roll is a 1 or a 2.” This particular entry says, you may reroll any 1’s or 2’s and must use the new roll period .

This is more than likely a typo, as some do exist in the version of the PHB I have when it first came out. If anyone has any errata/newer versions of the PHB and can see if the full entry exists under Paladin please let me know in comments or in your answer should you submit one.

My (send mail function WordPress) its made for salesstaus, has stop working after an update, maybe some code is outdatet

//send mail to owner if status set to 'Job Dispatched' if($  _POST['new_status'] == 10){     $  owner_email = get_option('purch_log_email');     $  result = $  wpdb->get_results('select wsf1.value as firstname                                      , wsf2.value as lastname                                     , wsf3.value as email                                     from XXXX2_wpsc_purchase_logs  wpl                                         left join XXXX2_wpsc_submited_form_data wsf1 ON wsf1.log_id = wpl.id AND wsf1.form_id = 2                                         left join XXXX2_wpsc_submited_form_data wsf2 ON wsf2.log_id = wpl.id AND wsf2.form_id = 3                                         left join XXXX2_wpsc_submited_form_data wsf3 ON wsf3.log_id = wpl.id AND wsf3.form_id = 9                                     where wpl.id = "'.$  _POST['id'].'"');         $  message    =   '<script type="application/json+trustpilot"> 

{‘ ."\n" ."\n" .’"recipientEmail": ‘.’"’.$ result[0]->email.’"’."," ."\n" ."\n" .’"recipientName": ‘.’"’.$ result[0]->firstname."".$ result[0]->lastname.’"’."," ."\n" ."\n" .’"referenceId": ‘.’"’.$ _POST[‘id’].’"’."," ."\n" ."\n" .’ }

‘;

    $  from       = "mysite.dk <info@mysite.dk>";     $  to         = $  owner_email;     $  subject    = "Trust Pilot"; 

// // $ headers = "From:" . $ from; $ headers = "From: " . $ from . "\r\n"; $ headers.= "Content-Type: text/plain;charset=utf-8\r\n";

    //wp_mail($  owner_email, 'New Dispatched Job', $  message);     

// Trust-Pilot

// mail(‘xxxxx@xxxxxx.trustpilot.dk’, $ subject, $ message, $ headers); mail(‘XXX@adr.dk’, $ subject, $ message, $ headers); }