register_section_type( 'FS_Customizer_Support_Section' ); parent::__construct( $manager, $id, $args ); } /** * The type of customize section being rendered. * * @since 1.0.0 * @access public * @var string */ public $type = 'freemius-support-section'; /** * @var Freemius */ public $fs = null; /** * Add custom parameters to pass to the JS via JSON. * * @since 1.0.0 */ public function json() { $json = parent::json(); $is_contact_visible = $this->fs->is_page_visible( 'contact' ); $is_support_visible = $this->fs->is_page_visible( 'support' ); $json['theme_title'] = $this->fs->get_plugin_name(); if ( $is_contact_visible && $is_support_visible ) { $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' ); } if ( $is_contact_visible ) { $json['contact'] = array( 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ), 'url' => $this->fs->contact_url(), ); } if ( $is_support_visible ) { $json['support'] = array( 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ), 'url' => $this->fs->get_support_forum_url() ); } return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.0 */ protected function render_template() { ?>
  • {{ data.theme_title }} <# if ( data.contact && data.support ) { #>
    <# } #> <# if ( data.contact ) { #> {{ data.contact.label }} <# } #> <# if ( data.support ) { #> {{ data.support.label }} <# } #> <# if ( data.contact && data.support ) { #>
    <# } #>