I have this class
class TableInvoices extends WP_List_Table {
function prepare_items() {
$sumOwed = 'Anything';
$sumTotal = 'Something';
}
}
How can I echo $sumTotal outside the class ?
Thanks
EDIT:
@Eisa Adil solutions worked very well, also this worked:
class TableInvoices extends WP_List_Table {
public $sumOwed;
public $sumTotal;
function prepare_items() {
$sumOwed = 'Anything';
$sumTotal = 'Something';
$this->sumOwed = $sumOwed;
$this->sumTotal = $sumTotal;
}
}
$sum = new TableInvoices();
$sum->prepare_items();
echo $sum->sumOwed . '<br>';
echo $sum->sumTotal;