Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed Apr 27, 2019
1 parent 4fcc912 commit 6a73417
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 51 deletions.
7 changes: 6 additions & 1 deletion assets/sass/parts/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ html {
}

pre, code, kbd, tt, var {
font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;
font-family:
Monaco,
Consolas,
'Andale Mono',
'DejaVu Sans Mono',
monospace;
font-size: .9375rem;
}

Expand Down
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Playground for Beaver Themer Changelog

## 1.0.2

* **Update**: Improving content display
* **Update**: Adding `utm_source` parameter to referral URL

### Files changed:

changelog.md
index.php
style.css
includes/class-setup-plugin.php


## 1.0.1

* **Fix**: CSS font family values
Expand Down
55 changes: 23 additions & 32 deletions includes/class-setup-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 1.0.0
* @version 1.0.1
* @version 1.0.2
*/
class PfBT_Setup_Plugin {

/**
* Initialization.
*
* @since 1.0.0
* @version 1.0.1
* @version 1.0.2
*/
public static function init() {
add_action( 'pfbt_content', __CLASS__ . '::notice' );
add_action( 'pfbt_content', __CLASS__ . '::content' );

add_filter( 'fl_theme_builder_part_hooks', __CLASS__ . '::parts' );
Expand All @@ -28,7 +27,7 @@ public static function init() {
* Is builder active or enabled?
*
* @since 1.0.1
* @version 1.0.1
* @version 1.0.2
*/
public static function is_builder() {
if (
Expand All @@ -38,41 +37,25 @@ public static function is_builder() {
return false;
}

return FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled();
return have_posts() && ( FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled() );
}

/**
* Front-end notice.
*
* This is displayed only when WordPress found posts
* but there is no Beaver Themer layout to display.
* Content.
*
* @since 1.0.0
* @version 1.0.1
* @version 1.0.2
*/
public static function notice() {
public static function content() {
if ( ! class_exists( 'FLThemeBuilder' ) ) {
// Beaver Themer not active?
// Beaver Themer not active? Display notice.
get_template_part( 'templates/parts/content/content', 'beaver-themer' );
} else if ( ! self::is_builder() ) {
// Looks like we have no Themer Layouts...
get_template_part( 'templates/parts/content/content', 'themer-layouts' );
}
}

/**
* Display page builder layout if it exists.
*
* Allows displaying custom page builder layout if it exists,
* such as pages built with Beaver Builder. This will bypass
* the Beaver Themer layout.
*
* @since 1.0.1
* @version 1.0.1
*/
public static function content() {
if ( self::is_builder() ) {
} else if ( self::is_builder() ) {
// Display Beaver Builder page builder layout if it exists.
get_template_part( 'templates/parts/content/content', get_post_type() );
} else {
// Looks like we have no Themer Layouts: display notice.
get_template_part( 'templates/parts/content/content', 'themer-layouts' );
}
}

Expand Down Expand Up @@ -116,12 +99,20 @@ public static function parts() {
* Upgrade link URL.
*
* @since 1.0.0
* @version 1.0.0
* @version 1.0.2
*
* @param string $url
*/
public static function url( $url ) {
return esc_url( add_query_arg( 'fla', '67', $url ) );
return esc_url(
add_query_arg(
array(
'fla' => '67',
'utm_source' => 'pfbt',
),
$url
)
);
}

}
Expand Down
32 changes: 15 additions & 17 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,24 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 1.0.0
* @version 1.0.1
* @version 1.0.2
*/

get_header();

if ( have_posts() ) {
/**
* Displays an `index.php` template content if we `have_posts()`.
*
* This usually gets overridden by Beaver Themer layouts.
* If the appropriate Beaver Themer layout does not exist,
* this content is being displayed instead.
*
* `PfBT_Setup_Plugin::notice()` is hooked here.
* `PfBT_Setup_Plugin::content()` is hooked here.
* Not included in Beaver Themer part hooks, no need to.
*
* @since 1.0.0
*/
do_action( 'pfbt_content' );
}
/**
* Displays the content.
*
* This usually gets overridden by Beaver Themer layout.
* If the appropriate Beaver Themer layout does not exist,
* the content hooked onto `pfbt_content` action is being
* displayed instead.
*
* `PfBT_Setup_Plugin::content()` is hooked here.
* Not included in Beaver Themer part hooks, no need to.
*
* @since 1.0.0
*/
do_action( 'pfbt_content' );

get_footer();
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: Playground for Beaver Themer
Theme URI: https://github.com/webmandesign/playground-for-beaver-themer/
Author: WebMan Design
Author URI: https://www.webmandesign.eu/
Version: 1.0.1
Version: 1.0.2
Text Domain: playground-for-beaver-themer
Domain Path: /languages
License: GNU General Public License v3
Expand Down

0 comments on commit 6a73417

Please sign in to comment.