July 17, 2019
This is all you need:
jQuery('.read_only input').attr('readonly','');
More complex example that occurs for logged in users only:
jQuery(window).load(function() { if(jQuery('.logged-in').length>0) { jQuery('.read_only input').attr('readonly',''); } });
Original source (using functions.php).