WordPress radio metabox code example open

WordPress radio metabox code example

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators

$allow_download = get_post_meta( $post->ID, 'lil-allow-download', true );
$checked1 = checked( $allow_download, 1 );
$checked2 = checked( $allow_download, 0 );
<p>
		<label for="lil-allow-download">' . esc_html__( 'Allow download', 'lil-music' ) . '</label>
		<input type="radio" name="lil-allow-download" id="lil-allow-download" value="1" ' . $checked1 . '>Yes
		<input type="radio" name="lil-allow-download" id="lil-allow-download" value="0" ' . $checked2. '>No
</p>

0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation