Need help grabbing value of checkbox in a paragraph embedded in content type.

Hi Drupal Community. Newbie here,

I’m currently stuck on this one problem that I’ve been scratching my head on for the past 2 days. Basically, I have a paragraph bundle called Banner, which is supposed to imitate a jumbotron on bootstrap. The paragraph is embedded into my blog content type.

Inside the paragraph bundle is a field I’ve created called 'field_center_the_heading', which is a checkbox such that, when it is checked, it will center the 'field_banner_heading' that is also located in the paragraph bundle.

I figured that I would throw a hook_init() to assist me altering the banner heading on page load, and include a css style tag when drupal recognizes a checked checkbox.

The issue I have now is figuring out how to get the value of the 'center_the_heading' field, I’ve tried finding numerous functions or methods, and none of them seem to make sense. Any advice or suggestions on how to approach this situation?

Thanks in advance

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed