You need the $post_id
passed in to the function you are calling from the hook. Try making your function declaration like this:
function slider_data( $post_id )
You need the $post_id
passed in to the function you are calling from the hook. Try making your function declaration like this:
function slider_data( $post_id )