I have a class with a couple of static functions. One of my functions build a variable and I want to use that variable in another static function.
How can I call that variable?
class MyClass{
public static function show_preprice_value_column( $column, $post_id ) {
if ( $column == 'product_preprice' ) {
$product_preprice = get_post_meta( $post_id, 'product_preprice', true );
if ( intval( $product_preprice ) > 0 ) {
echo $product_preprice;
}
}
}
public static function show_off_value_column( $column, $post_id ) {
if ( $column == 'product_off' ) {
var_dump((int)self::show_preprice_value_column());
}
}
}