PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.5.2
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.5.2
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
← All changes | admin/class-convertkit-admin-settings.php +29 -12 2.2.42.5.2 View file →
@@ -129,8 +129,20 @@
129 129 ?>
130 130
131 131 <header>
132 132 <h1><?php esc_html_e( 'ConvertKit', 'convertkit' ); ?></h1>
133 +
134 + <?php
135 + // Output Help link tab, if it exists.
136 + $documentation_url = $this->get_active_section_documentation_url( $active_section );
137 + if ( $documentation_url !== false ) {
138 + printf(
139 + '<a href="%s" class="convertkit-docs" target="_blank">%s</a>',
140 + esc_attr( $documentation_url ),
141 + esc_html__( 'Help', 'convertkit' )
142 + );
143 + }
144 + ?>
133 145 </header>
134 146
135 147 <div class="wrap">
136 148 <?php
@@ -149,12 +161,12 @@
149 161 </form>
150 162
151 163 <p class="description">
152 164 <?php
153 - // Output Documentation link, if it exists.
165 + // Output Help link, if it exists.
154 166 $documentation_url = $this->get_active_section_documentation_url( $active_section );
155 167 if ( $documentation_url !== false ) {
156 - echo sprintf(
168 + printf(
157 169 '%s <a href="%s" target="_blank">%s</a>',
158 170 esc_html__( 'If you need help setting up the plugin please refer to the', 'convertkit' ),
159 171 esc_attr( $documentation_url ),
160 172 esc_html__( 'plugin documentation', 'convertkit' )
@@ -240,18 +252,8 @@
240 252 esc_html( $section->tab_text ),
241 253 $section->is_beta ? $this->get_beta_tab() : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
242 254 );
243 255 }
244 -
245 - // Output Documentation link tab, if it exists.
246 - $documentation_url = $this->get_active_section_documentation_url( $active_section );
247 - if ( $documentation_url !== false ) {
248 - printf(
249 - '<li class="convertkit-docs"><a href="%s" class="convertkit-tab" target="_blank">%s <span class="dashicons dashicons-external"></span></a></li>',
250 - esc_attr( $documentation_url ),
251 - esc_html__( 'Documentation', 'convertkit' )
252 - );
253 - }
254 256 ?>
255 257 </ul>
256 258 <?php
257 259 // WordPress' JS will automatically move any .notice elements to be immediately below .wp-header-end
@@ -292,8 +294,23 @@
292 294 *
293 295 * @since 1.9.6
294 296 */
295 297 public function register_sections() {
298 +
299 + // If no Access Token exists, register a settings section that shows a button
300 + // to start the OAuth authentication flow.
301 + $settings = new ConvertKit_Settings();
302 + if ( ! $settings->has_access_and_refresh_token() ) {
303 + // Just register the OAuth screen.
304 + $sections = array(
305 + 'oauth' => new ConvertKit_Settings_OAuth(),
306 + );
307 +
308 + // Assign them to this class.
309 + $this->sections = $sections;
310 +
311 + return;
312 + }
296 313
297 314 // Register the General and Tools settings sections.
298 315 $sections = array(
299 316 'general' => new ConvertKit_Settings_General(),