Hello.
How do I make the checkboxe enabled by default in this plugin https://www.sitepoint.com/building-your-own-social-sharing-plugin-for-wordpress/
<input type="checkbox" name="social-share-facebook" value="1" <?php checked(1, get_option('social-share-facebook'), true); ?> />
It looks like the checked()
function determines whether the box is checked or not, based in the value of the 'social-share-facebook'
option.
If you wanted it to always default to being checked, you would replace the function with the checked
keyword.
But I believe it was set up this way to work with the users chosen options.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.