I need to do some actions only on newly published posts that requires post metadata. I’ve tried many different hooks, but they all also trigger for other “events” like updating post, or if they …
Tag: php
Trying to sort by price but not working in WordPress
I have a function that group the products and I want to sort in ascending order by the price. I even tried to use “sort() function but display any output. I have several options with Array_multisort(),…
Problem in code with jquery, php and html
$(document).ready(function () { $(“button”).click(function(){ $(“button”).parent().append(‘ <?php $sql3 = "…
Laravel get ID of newly created resource
So basically I am doing this: Laptop::create([ ‘user_id’ => 1, ‘name’ => $request->name, ‘brand’ => $request->brand, ‘SN’ => $request->SN, ‘price’ => $…
Replacing a JSON array in MySQL in PHP
I am trying to replace data in a JSON array inside a JSON array in my MySQL Database. The array looks like this: {“slug”: “SLUG”,”price”: “{“44″:12,”_default”:12}”, “test”: “TEST”} Now I would like …
Laravel request url with parameter problem with GET Method
I have a route in api.php which look like this: Route::get(‘auth/logout/{token}’,’UserController.php’; I tested this API endpoint using Postman with these configurations: Method: GET Params: key = …
Multiple selection options for html and php
I’m hoping someone can assist me. I’m trying to allow a multiple selection on a webpage via PHP, but whilst the list is showing, I cannot get the HTML to call the multiple option. PHP: <?php …
How should I setup Mailhog to work with Docksal?
I have follow official documentation on https://docs.docksal.io/tools/mailhog/ But can not get mails on mailhog. In logs (fin logs -f cli) I have: WARNING: [pool www] child 49 said into stderr: “sh:…
Laravel equivalent of ->fetch?
I am working on a website that uses PHP and SQL to connect to the database, I’m trying to replace all the SQL with Laravel Query Builder commands. I am running into a problem with the following code:…
How to insert a value to a column where another column is equal to specific word?
I am currently working on an enrollment website for our research project. How to assign the section of a student where the course is “Computer Programming” limited to 50 per section? I currently have …