Wouldn’t it be easier to have a global slider option instead of setting this for every post? You could use a repeater field to add new post_id’s to your slider and make this field visible within the option page. The only thing to code would be a populate_field filter to provide all avaible posts for the slider settings.