I have created a new plugin setting in an existing plugin that needs to be checked by default when users update to the new version because a lot of the original features are now activated by this checkbox.
This is the setting from my settings page:
<td> <?php printf( '<input id="bodhi_svgs_settings[advanced_mode]" name="bodhi_svgs_settings[advanced_mode]" type="checkbox" %2$s />', 'bodhi_svgs_settings_advanced_mode', checked( isset( $bodhi_svgs_options['advanced_mode'] ), true, false ) ); ?> <?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' You don\'t need to enable this to simply use SVG files as images. Enabling this will trigger advanced options and SVG functionality such as inline rendering.', 'svg-support' ); ?></small> </td>
I've looked at a number of solutions and can't seem to get it to work properly. I tried
checked( isset( $bodhi_svgs_options['advanced_mode'] ), true ) but that outputs checked="checked" to the page. I can't figure out how to do it without rewriting the entire options to work a different way.