Skip to content

Commit 6a73417

Browse files
committed
1.0.2
1 parent 4fcc912 commit 6a73417

File tree

5 files changed

+58
-51
lines changed

5 files changed

+58
-51
lines changed

assets/sass/parts/_typography.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ html {
1313
}
1414

1515
pre, code, kbd, tt, var {
16-
font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;
16+
font-family:
17+
Monaco,
18+
Consolas,
19+
'Andale Mono',
20+
'DejaVu Sans Mono',
21+
monospace;
1722
font-size: .9375rem;
1823
}
1924

changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Playground for Beaver Themer Changelog
22

3+
## 1.0.2
4+
5+
* **Update**: Improving content display
6+
* **Update**: Adding `utm_source` parameter to referral URL
7+
8+
### Files changed:
9+
10+
changelog.md
11+
index.php
12+
style.css
13+
includes/class-setup-plugin.php
14+
15+
316
## 1.0.1
417

518
* **Fix**: CSS font family values

includes/class-setup-plugin.php

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
* @copyright WebMan Design, Oliver Juhas
77
*
88
* @since 1.0.0
9-
* @version 1.0.1
9+
* @version 1.0.2
1010
*/
1111
class PfBT_Setup_Plugin {
1212

1313
/**
1414
* Initialization.
1515
*
1616
* @since 1.0.0
17-
* @version 1.0.1
17+
* @version 1.0.2
1818
*/
1919
public static function init() {
20-
add_action( 'pfbt_content', __CLASS__ . '::notice' );
2120
add_action( 'pfbt_content', __CLASS__ . '::content' );
2221

2322
add_filter( 'fl_theme_builder_part_hooks', __CLASS__ . '::parts' );
@@ -28,7 +27,7 @@ public static function init() {
2827
* Is builder active or enabled?
2928
*
3029
* @since 1.0.1
31-
* @version 1.0.1
30+
* @version 1.0.2
3231
*/
3332
public static function is_builder() {
3433
if (
@@ -38,41 +37,25 @@ public static function is_builder() {
3837
return false;
3938
}
4039

41-
return FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled();
40+
return have_posts() && ( FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled() );
4241
}
4342

4443
/**
45-
* Front-end notice.
46-
*
47-
* This is displayed only when WordPress found posts
48-
* but there is no Beaver Themer layout to display.
44+
* Content.
4945
*
5046
* @since 1.0.0
51-
* @version 1.0.1
47+
* @version 1.0.2
5248
*/
53-
public static function notice() {
49+
public static function content() {
5450
if ( ! class_exists( 'FLThemeBuilder' ) ) {
55-
// Beaver Themer not active?
51+
// Beaver Themer not active? Display notice.
5652
get_template_part( 'templates/parts/content/content', 'beaver-themer' );
57-
} else if ( ! self::is_builder() ) {
58-
// Looks like we have no Themer Layouts...
59-
get_template_part( 'templates/parts/content/content', 'themer-layouts' );
60-
}
61-
}
62-
63-
/**
64-
* Display page builder layout if it exists.
65-
*
66-
* Allows displaying custom page builder layout if it exists,
67-
* such as pages built with Beaver Builder. This will bypass
68-
* the Beaver Themer layout.
69-
*
70-
* @since 1.0.1
71-
* @version 1.0.1
72-
*/
73-
public static function content() {
74-
if ( self::is_builder() ) {
53+
} else if ( self::is_builder() ) {
54+
// Display Beaver Builder page builder layout if it exists.
7555
get_template_part( 'templates/parts/content/content', get_post_type() );
56+
} else {
57+
// Looks like we have no Themer Layouts: display notice.
58+
get_template_part( 'templates/parts/content/content', 'themer-layouts' );
7659
}
7760
}
7861

@@ -116,12 +99,20 @@ public static function parts() {
11699
* Upgrade link URL.
117100
*
118101
* @since 1.0.0
119-
* @version 1.0.0
102+
* @version 1.0.2
120103
*
121104
* @param string $url
122105
*/
123106
public static function url( $url ) {
124-
return esc_url( add_query_arg( 'fla', '67', $url ) );
107+
return esc_url(
108+
add_query_arg(
109+
array(
110+
'fla' => '67',
111+
'utm_source' => 'pfbt',
112+
),
113+
$url
114+
)
115+
);
125116
}
126117

127118
}

index.php

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,24 @@
1313
* @copyright WebMan Design, Oliver Juhas
1414
*
1515
* @since 1.0.0
16-
* @version 1.0.1
16+
* @version 1.0.2
1717
*/
1818

1919
get_header();
2020

21-
if ( have_posts() ) {
22-
/**
23-
* Displays an `index.php` template content if we `have_posts()`.
24-
*
25-
* This usually gets overridden by Beaver Themer layouts.
26-
* If the appropriate Beaver Themer layout does not exist,
27-
* this content is being displayed instead.
28-
*
29-
* `PfBT_Setup_Plugin::notice()` is hooked here.
30-
* `PfBT_Setup_Plugin::content()` is hooked here.
31-
* Not included in Beaver Themer part hooks, no need to.
32-
*
33-
* @since 1.0.0
34-
*/
35-
do_action( 'pfbt_content' );
36-
}
21+
/**
22+
* Displays the content.
23+
*
24+
* This usually gets overridden by Beaver Themer layout.
25+
* If the appropriate Beaver Themer layout does not exist,
26+
* the content hooked onto `pfbt_content` action is being
27+
* displayed instead.
28+
*
29+
* `PfBT_Setup_Plugin::content()` is hooked here.
30+
* Not included in Beaver Themer part hooks, no need to.
31+
*
32+
* @since 1.0.0
33+
*/
34+
do_action( 'pfbt_content' );
3735

3836
get_footer();

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Theme Name: Playground for Beaver Themer
33
Theme URI: https://github.com/webmandesign/playground-for-beaver-themer/
44
Author: WebMan Design
55
Author URI: https://www.webmandesign.eu/
6-
Version: 1.0.1
6+
Version: 1.0.2
77
Text Domain: playground-for-beaver-themer
88
Domain Path: /languages
99
License: GNU General Public License v3

0 commit comments

Comments
 (0)