How to get field value? [closed]

Question

I have this code :

add_action( 'load-post.php', 'tst' );
function tst($post_id)  {

    $post_id = $_GET[ 'post' ];
     $value = get_field('beds');     
     var_dump($value);
     
}

var_dump($value); returns null (instead of 3), What am I doing wrong?

Here is a screenshot of the field bedrooms:
enter image description here

0
Andreea Onica 4 months 0 Answers 10 views 0

Leave an answer