PluginProbe ʕ •ᴥ•ʔ
Auto Post Cleaner / 3.10.2
Auto Post Cleaner v3.10.2
3.12.0 3.13.1 3.2.4 3.2.5 3.3.0 3.3.10 3.3.11 3.3.8 3.4.2 3.5.3 3.6.0 3.7.0 3.7.1 3.7.2 3.7.3 3.7.5 3.7.6 3.8.0 3.9.0 3.9.4 3.9.6 3.9.7 trunk 3.0.0 3.1.0 3.10.1 3.10.2 3.11.4
delete-old-posts-programmatically / freemius / includes / customizer / class-fs-customizer-support-section.php
delete-old-posts-programmatically / freemius / includes / customizer Last commit date
class-fs-customizer-support-section.php 5 years ago class-fs-customizer-upsell-control.php 11 months ago index.php 5 years ago
class-fs-customizer-support-section.php
102 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.2.2.7
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * Class Zerif_Customizer_Theme_Info_Main
15 *
16 * @since 1.0.0
17 * @access public
18 */
19 class FS_Customizer_Support_Section extends WP_Customize_Section {
20
21 function __construct( $manager, $id, $args = array() ) {
22 $manager->register_section_type( 'FS_Customizer_Support_Section' );
23
24 parent::__construct( $manager, $id, $args );
25 }
26
27 /**
28 * The type of customize section being rendered.
29 *
30 * @since 1.0.0
31 * @access public
32 * @var string
33 */
34 public $type = 'freemius-support-section';
35
36 /**
37 * @var Freemius
38 */
39 public $fs = null;
40
41 /**
42 * Add custom parameters to pass to the JS via JSON.
43 *
44 * @since 1.0.0
45 */
46 public function json() {
47 $json = parent::json();
48
49 $is_contact_visible = $this->fs->is_page_visible( 'contact' );
50 $is_support_visible = $this->fs->is_page_visible( 'support' );
51
52 $json['theme_title'] = $this->fs->get_plugin_name();
53
54 if ( $is_contact_visible && $is_support_visible ) {
55 $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
56 }
57
58 if ( $is_contact_visible ) {
59 $json['contact'] = array(
60 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
61 'url' => $this->fs->contact_url(),
62 );
63 }
64
65 if ( $is_support_visible ) {
66 $json['support'] = array(
67 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
68 'url' => $this->fs->get_support_forum_url()
69 );
70 }
71
72 return $json;
73 }
74
75 /**
76 * Outputs the Underscore.js template.
77 *
78 * @since 1.0.0
79 */
80 protected function render_template() {
81 ?>
82 <li id="fs_customizer_support"
83 class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
84 <h3 class="accordion-section-title">
85 <span>{{ data.theme_title }}</span>
86 <# if ( data.contact && data.support ) { #>
87 <div class="button-group">
88 <# } #>
89 <# if ( data.contact ) { #>
90 <a class="button" href="{{ data.contact.url }}" target="_blank" rel="noopener noreferrer">{{ data.contact.label }} </a>
91 <# } #>
92 <# if ( data.support ) { #>
93 <a class="button" href="{{ data.support.url }}" target="_blank" rel="noopener noreferrer">{{ data.support.label }} </a>
94 <# } #>
95 <# if ( data.contact && data.support ) { #>
96 </div>
97 <# } #>
98 </h3>
99 </li>
100 <?php
101 }
102 }