All Questions
10,433 questions
0
votes
0
answers
50
views
Escaping strings using mysqli without passing a connection parameter in PHP to function [duplicate]
I am updating some legacy PHP code that makes use of mysql_escape_string to escape strings. The web host has not included the PDO module in their latest upgrade (I have spent hours in pointless chat ...
2
votes
1
answer
57
views
Passing arguments to a php function to manipulate the results returned on a wordpress site using functions and shortcode
I have a php function which displays a leader board of all players and stats from my database, which is working as intended. I now however want to amend the function so that i can pass data to it to ...
1
vote
1
answer
108
views
How to use PHP to calculate the cost of an order?
I am trying to create a canteen order calculator without using MySQL (project spec, not in my control). The idea is that a user enters some values into the HTML table and then receives the calculated ...
-1
votes
1
answer
58
views
Can't display the [products] shortcode on a page [closed]
I'm trying to display the shortcode [products] on a new page I created. The products don't display, (but the shortcode itself doesn't show as text (as it would if it didn't render, meaning the ...
0
votes
1
answer
43
views
Add Sort Order option to Users column data in WooCommerce [duplicate]
I am trying to figure out a way to add custom sorting - asc / desc to the following code which I have added to functions.php to a WooCommerce store.
The code adds a column with the total placed orders ...
0
votes
2
answers
45
views
public function getProfiles($account_id)
OK I have a system that generates subscriptions from customers related to
Service,.
Account (email) belonging to that service.
Profile related to the account.
All this is associated to a client, but ...
0
votes
1
answer
72
views
Accent in Cell FPDF function causes mis-alignment of content
If have this FPDF code:
$pdf->Cell(65 ,3, "Helene",1, 1, 'R');
$pdf->Ln(2);
$pdf->Cell(65 ,3, "Hélène",1, 1, 'R');
This gives two different results:
Why accents ...
1
vote
1
answer
100
views
wp redirect users only when logging in (1 time) if on homepage
I have the following code to redirect users which are logged in and on the homepage:
function add_login_check()
{
if ( is_user_logged_in() && is_page(7) ) {
?>
<script>...
1
vote
0
answers
60
views
Why is my generateToken() function not working?
I have created a social media page for my coursework. I have a login page and a home page. Once logged in the user is redirected to the home page, which all works fine. As soon as I add in my ...
1
vote
2
answers
76
views
Different results for function() and fn(). PHP
I have a problem.
$this->allIds->each(function ($id) {
$this->checked[$id] = $this->checkedAll;
});
And this:
$this->allIds->each(fn($id) => $this->checked[$id] = $this-&...
0
votes
1
answer
72
views
Ovewriting wc_create_new_customer WooCommerce function to allow subscrtiption purchases from guests
In WooCommerce, I need to allow people to checkout without having to register for an account when they buy subscriptions. In Accounts & Privacy in WooCommerce admin section, I have only one option:...
0
votes
0
answers
21
views
Setting a PHP Cookie within an AJAX Call [duplicate]
This is not a duplicate question: how can set cookie with Ajax/jQuery?
Either way the cookie does change, but the output of the following, doesn't change without a refresh.
<?php echo "Value ...
0
votes
1
answer
109
views
Any alternative to static functions that does not share data with objects? [PHP 8.3]
Lets say I have this class with an static function:
<?php
class Myclass {
public static $example = 0;
public static function Example() {
echo self::$example;
}
public ...
-1
votes
2
answers
135
views
Woocommerce ho to change action for backorder button? [closed]
How to make the Formcraft contact form be called when clicking the pre-order button? (only pre-order products) Thank you!
Unfortunately I did not find any information in the wordpress CODEX on how I ...
1
vote
0
answers
80
views
WP all import duplicate product id's and schedule sale on week
I have an import using WP ALL-IMPORT where the xml looks like this.
<ROW artnum="53241" klant="-1" week="35" dag="0" jaar="2024" klantgroep="0&...