Commit 4ff42a7d authored by Petr Balga's avatar Petr Balga

topup category id getting by id

parent f66445e9
......@@ -88,7 +88,7 @@ function add_transaction($amount, $payment, $action, $category, $title){
if($amount > 0){
$amount = preg_replace("/[^0-9.]/", "", $amount);
$user_id = get_current_user_id();
print_r($category);
//print_r($category);
$post = array(
'post_author' => $user_id,
'post_content' => 'Transaction of $' . $amount . ' was made via ' . $payment . '.',
......
......@@ -46,8 +46,9 @@
if (isset($_POST['submit'])) {
$payment = $_POST['payment'];
$amount = preg_replace("/[^0-9.]/", "", $_POST['usd']);
$category = get_category_by_slug('topup')->term_id;
if($amount > 0) {
add_transaction($amount, $payment, 'topup', 6, 'Top-Up');
add_transaction($amount, $payment, 'topup', $category, 'Top-Up');
}
}
?>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment