Hi, sorry that typo, i have tested $_POST it is returning the array correctly. some thing is going wrong in removing the shortcode and updating it. sorry that ajax_layoutcontrol was a typo..it's still not working
– Latheesh V M VillaOct 1 '18 at 22:43

why replace the shortcode? Just make a new one
– rudtekOct 1 '18 at 22:46

Actually there is more stuff going on..There is a sortable list in the back-end and i am passing the list-id to $_POST by ajax and so foreach will change the shortcode accordingly( the template will change order).
– Latheesh V M VillaOct 1 '18 at 22:52