Reply 92293 to: How to insert a text area in Royal Check Out Page?

Avatar: Webacto
Webacto
Participant
October 7, 2015 at 16:28

Which is exactly the .php files where I have to add the new check-box?

Should be correct this .php code for my esigence?

/*********************************************************************/
/* Add featured post checkbox
/********************************************************************/
add_action( ‘add_meta_boxes’, ‘add_featured_checkbox_function’ );
function add_featured_checkbox_function() {
add_meta_box(‘featured_checkbox_id’,’FEATURED POST ?’, ‘featured_checkbox_callback_function’, ‘post’, ‘normal’, ‘high’);
}
function featured_checkbox_callback_function( $post ) {
global $post;
$isFeatured=get_post_meta( $post->ID, ‘is_featured’, true );
?>

<input type=”checkbox” name=”is_featured” value=”yes” <?php echo (($isFeatured==’yes’) ? ‘checked=”checked”‘: ”);?>/> YES
<?php
}

 
add_action(‘save_post’, ‘save_featured_post’);
function save_featured_post(){
global $post;
update_post_meta( $post_id, ‘is_featured’, $_POST[‘is_featured’]);
}

Thank you in advance for all in that you can support me

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.