Jetpack_RelatedPosts::action_admin_init PHP Method

action_admin_init() public method

Add a checkbox field to Settings > Reading for enabling related posts.
public action_admin_init ( ) : null
return null
    public function action_admin_init()
    {
        // Add the setting field [jetpack_relatedposts] and place it in Settings > Reading
        add_settings_field('jetpack_relatedposts', '<span id="jetpack_relatedposts">' . __('Related posts', 'jetpack') . '</span>', array($this, 'print_setting_html'), 'reading');
        register_setting('reading', 'jetpack_relatedposts', array($this, 'parse_options'));
        add_action('admin_head', array($this, 'print_setting_head'));
        if ('options-reading.php' == $GLOBALS['pagenow']) {
            // Enqueue style for live preview on the reading settings page
            $this->_enqueue_assets(false, true);
        }
    }