Checking if checkbox is checked
-
I’ve added a custom check-box which displays all the time in wordpress post editor on the side, like following:
<label for="pp_is_feat_meta"> <input type="checkbox" name="pp_is_feat_meta" id="pp_is_feat_meta" value="" /> Is the post featured?</label>
problem 1: When i check the checkbox, click the Update button in post editor, it gets unchecked again after the page loads. How do i keep it checked?
problem 2: How to check if the checkbox is checked in a particular page (like index.php). For example, in index.php, for all the posts check the following and echo if checked :
if(checkbox is checked) { echo "This post's title is BLABLA and checkbox is checked"; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Checking if checkbox is checked’ is closed to new replies.