//adding meta box to each post type for auto notifications add_action(‘admin_init’,‘add_custom_fields’); function add_custom_fields( ) { $screens = get_post_types(); foreach ( $screens as $screen ) { add_meta_box( ‘pnr-auto-push-notifications’, ‘Push Notification Reloaded’, ‘pnr_auto_push_notifications’, $screen, ‘side’, ‘high’, ); } } function pnr_auto_push_notifications($post){ $notification_status = get_post_meta( $post->ID, ‘pnr-auto-push-notifications’,true); ?> <input type=“checkbox” name=“auto_push_notifications” id=“auto_push_notifications” <?php if($notification_status == ‘on’) echo ‘checked’?> …
add post meta box and save it to db Read More »