Skip to content

Commit

Permalink
Merge pull request #7 from c0sm1n87/master
Browse files Browse the repository at this point in the history
see commits
  • Loading branch information
Cosmin committed Dec 12, 2016
2 parents 41bbfcd + 0915d13 commit 4bd1fd3
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 52 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#30 - archive page did not implement layout styles
#45 - added border-bottom checkbox toggle for widget
#79 - added epsilon toggles for widgets
#95 - changed import demo content to required action
#103 - removed margin bottom from the widgets only in the main content
#16 - added the first option

### 1.0.7
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>
Expand Down
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function shapely_setup() {

add_image_size( 'shapely-featured', 848, 566, true );

add_theme_support( 'customize-selective-refresh-widgets' );
// Welcome screen
if ( is_admin() ) {
global $shapely_required_actions, $shapely_recommended_plugins;
Expand Down Expand Up @@ -136,9 +137,8 @@ function shapely_setup() {
array(
"id" => 'shapely-req-import-content',
"title" => esc_html__( 'Import content', 'shapely' ),
"description" => esc_html__( 'Head over to the Demo Content tab (available only if you installed Shapely Companion plugin) and import sample content data.', 'shapely' ),
"help" => '<a href="' . self_admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ) . '">' . __( 'Demo Content', 'shapely' ) . '</a>',
"check" => Shapely_Notify_System::shapely_has_content(),
"external" => ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php',
"check" => Shapely_Notify_System::shapely_check_import_req(),
),

);
Expand Down
19 changes: 18 additions & 1 deletion inc/admin/welcome-screen/css/welcome.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,21 @@

.about-wrap .three-col .plugin_box.col {
width: 29.81%;
}
}

.shapely-media-control img {
width: 100%;
}

#demo_content .spinner {
float: none;
}

#demo_content .updated-message,
#demo_content .spinner {
display: none;
}

#demo_content .spinner.is-active {
display: inline-block;
}
23 changes: 15 additions & 8 deletions inc/admin/welcome-screen/notify-system-checks.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,32 @@ public static function shapely_is_not_static_page() {
* @return bool
*/
public static function shapely_has_content() {
$option = get_option( "shapely_show_required_actions" );
if ( $option['shapely-req-import-content'] ) {
$option = get_option( "shapely_imported_demo", false );
if ( $option ) {
return true;
};

return false;
}

/**
* @return bool
* @return bool|mixed
*/
public static function shapely_check_wordpress_importer() {
if ( file_exists( ABSPATH . 'wp-content/plugins/wordpress-importer/wordpress-importer.php' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
public static function shapely_check_import_req() {
$needs = array(
'has_content' => self::shapely_has_content(),
'has_plugin' => self::shapely_has_plugin( 'shapely-companion' )
);

return is_plugin_active( 'wordpress-importer/wordpress-importer.php' );
if ( $needs['has_content'] ) {
return true;
}

return false;
if ( $needs['has_plugin'] ) {
return false;
}

return true;
}

/**
Expand Down
17 changes: 12 additions & 5 deletions inc/admin/welcome-screen/sections/actions-required.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@
<div class="shapely-action-required-box">
<?php if ( ! $hidden ): ?>
<span data-action="dismiss" class="dashicons dashicons-visibility shapely-required-action-button"
id="<?php echo $shapely_required_action_value['id']; ?>"></span>
id="<?php echo esc_attr( $shapely_required_action_value['id'] ); ?>"></span>
<?php else: ?>
<span data-action="add" class="dashicons dashicons-hidden shapely-required-action-button" id="<?php echo $shapely_required_action_value['id']; ?>"></span>
<span data-action="add" class="dashicons dashicons-hidden shapely-required-action-button"
id="<?php echo esc_attr( $shapely_required_action_value['id'] ); ?>"></span>
<?php endif; ?>
<h3><?php if ( ! empty( $shapely_required_action_value['title'] ) ): echo $shapely_required_action_value['title']; endif; ?></h3>
<h3><?php if ( ! empty( $shapely_required_action_value['title'] ) ): echo esc_html( $shapely_required_action_value['title'] ); endif; ?></h3>
<p>
<?php if ( ! empty( $shapely_required_action_value['description'] ) ): echo $shapely_required_action_value['description']; endif; ?>
<?php if ( ! empty( $shapely_required_action_value['help'] ) ): echo '<br/>' . $shapely_required_action_value['help']; endif; ?>
<?php if ( ! empty( $shapely_required_action_value['description'] ) ): echo esc_html( $shapely_required_action_value['description'] ); endif; ?>
<?php if ( ! empty( $shapely_required_action_value['help'] ) ): echo '<br/>' . wp_kses_post( $shapely_required_action_value['help'] ); endif; ?>
</p>
<?php
if ( ! empty( $shapely_required_action_value['external'] ) && file_exists( $shapely_required_action_value['external'] ) ) {
require_once $shapely_required_action_value['external'];
}
?>
<?php
if ( ! empty( $shapely_required_action_value['plugin_slug'] ) ) {
$active = $this->check_active( $shapely_required_action_value['plugin_slug'] );
$url = $this->create_action_link( $active['needs'], $shapely_required_action_value['plugin_slug'] );
Expand Down Expand Up @@ -73,6 +79,7 @@ class="<?php echo $class; ?>"
endforeach;
endif;


if ( $hooray ):
echo '<span class="hooray">' . __( 'Hooray! There are no required actions for you right now.', 'shapely' ) . '</span>';
endif;
Expand Down
23 changes: 8 additions & 15 deletions inc/admin/welcome-screen/welcome-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ public function check_for_icon( $arr ) {
}

public function create_action_link( $state, $slug ) {
$slug2 = $slug;
if ( $slug === 'wordpress-seo' ) {
$slug2 = 'wp-seo';
}
switch ( $state ) {
case 'install':
return wp_nonce_url(
Expand All @@ -282,19 +286,19 @@ public function create_action_link( $state, $slug ) {
case 'deactivate':
return add_query_arg( array(
'action' => 'deactivate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug2 . '.php' ),
), network_admin_url( 'plugins.php' ) );
break;
case 'activate':
return add_query_arg( array(
'action' => 'activate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug2 . '.php' ),
), network_admin_url( 'plugins.php' ) );
break;
}
Expand Down Expand Up @@ -334,11 +338,6 @@ class="nav-tab <?php echo $active_tab == 'recommended_actions' ? 'nav-tab-active
<?php echo $action_count > 0 ? '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : '' ?></a>
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=recommended_plugins' ); ?>"
class="nav-tab <?php echo $active_tab == 'recommended_plugins' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Plugins', 'shapely' ); ?></a>
<?php $shapely_companion = $this->check_active( 'shapely-companion' ); ?>
<?php if ( $shapely_companion['needs'] === 'deactivate' ): ?>
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ); ?>"
class="nav-tab <?php echo $active_tab == 'demo_content' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Demo Content', 'shapely' ); ?></a>
<?php endif; ?>
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=support' ); ?>"
class="nav-tab <?php echo $active_tab == 'support' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Support', 'shapely' ); ?></a>
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=changelog' ); ?>"
Expand All @@ -362,12 +361,6 @@ class="nav-tab <?php echo $active_tab == 'changelog' ? 'nav-tab-active' : ''; ?>
case 'changelog':
require_once get_template_directory() . '/inc/admin/welcome-screen/sections/changelog.php';
break;
case 'demo_content':
$shapely_companion = $this->check_active( 'shapely-companion' );
if ( $shapely_companion['needs'] === 'deactivate' ) {
require_once ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php';
}
break;
default:
require_once get_template_directory() . '/inc/admin/welcome-screen/sections/getting-started.php';
break;
Expand Down
24 changes: 24 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,30 @@ function shapely_customizer( $wp_customize ) {
) );
}

$wp_customize->add_setting( 'hide_post_title', array(
'default' => 1,
'sanitize_callback' => 'shapely_sanitize_checkbox',
) );

if(class_exists('Epsilon_Control_Toggle')){
$wp_customize->add_control( new Epsilon_Control_Toggle(
$wp_customize,
'hide_post_title',
array(
'type' => 'mte-toggle',
'label' => esc_html__( 'Title in blog post', 'shapely' ),
'section' => 'wpseo_breadcrumbs_customizer_section',
)
)
);
} else {
$wp_customize->add_control( 'hide_post_title', array(
'label' => esc_html__( 'Title in blog post', 'shapely' ),
'section' => 'wpseo_breadcrumbs_customizer_section',
'type' => 'checkbox',
) );
}

$wp_customize->add_setting( 'blog_name', array(
'default' => '',
'sanitize_callback' => 'shapely_sanitize_strip_slashes',
Expand Down
40 changes: 23 additions & 17 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ function shapely_get_header_logo() {

<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php
if ( $logo[0] != '' ) { ?>
<img src="<?php echo esc_url($logo[0]); ?>" class="logo" alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
<img src="<?php echo esc_url( $logo[0] ); ?>" class="logo"
alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
} else { ?>
<span class="site-title"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></span><?php
} ?>
Expand Down Expand Up @@ -533,29 +534,34 @@ function shapely_top_callout() {
<div class="row">
<?php
$breadcrumbs_enabled = false;
$title_in_post = false;
if ( function_exists( 'yoast_breadcrumb' ) ) {
$options = get_option( 'wpseo_internallinks' );
$breadcrumbs_enabled = ( $options['breadcrumbs-enable'] === true );
$title_in_post = get_theme_mod( 'hide_post_title', false );
}
?>
<div class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
<h3 class="page-title">
<?php
if ( is_home() ) {
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
} else if ( is_search() ) {
_e( 'Search', 'shapely' );
} else if ( is_archive() ) {
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
} else {
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
} ?>
</h3>
</div>
<?php if ( $title_in_post ): ?>
<div
class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
<h3 class="page-title">
<?php
if ( is_home() ) {
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
} else if ( is_search() ) {
_e( 'Search', 'shapely' );
} else if ( is_archive() ) {
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
} else {
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
} ?>
</h3>
</div>
<?php endif; ?>
<?php if ( function_exists( 'yoast_breadcrumb' ) ) { ?>
<?php
if ( $breadcrumbs_enabled ) { ?>
<div class="col-md-6 col-sm-6 col-xs-12 text-right">
<div class="<?php echo $title_in_post ? 'col-md-6 col-sm-6' : ''; ?> col-xs-12 text-right">
<?php yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' ); ?>
</div>
<?php } ?>
Expand Down Expand Up @@ -612,7 +618,7 @@ function shapely_get_attachment_image() {
$src = wp_get_attachment_image_src( $id, 'full', false );

if ( ! empty( $src[0] ) ) {
echo esc_url($src[0]);
echo esc_url( $src[0] );
}

die();
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*========= About Theme =========*/

Theme Name: Shapely
Theme URI: http://colorlib.com/wp/shapely/
Theme URI: https://colorlib.com/wp/shapely/
Version: 1.0.5
Tested up to: WP 4.6

Author: Aigars Silkalns
Author URI: http://colorlib.com/wp/
Author URI: https://colorlib.com/wp/
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl.html
-------------------------------------------------------
Expand Down
14 changes: 13 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://colorlib.com/wp/themes/shapely
Author: colorlib
Author URI: https://colorlib.com/
Description: Shapely is a powerful and versatile one page WordPress theme with pixel perfect design and outstanding functionality. It is by far the most advanced free WordPress theme available today with loads of unmatched customization options. This theme comes with several homepage widgets that can be used to add portfolio, testimonials, parallax sections, your product or service information, call for action and much more. Shapely supports most free and premium WordPress plugins such as WooCommerce, Jetpack, Gravity Forms, Contact Form 7, Yoast SEO, Google Analytics by Yoast and much more. This theme is the best suited for business, landing page, portfolio, ecommerce, store, local business, personal websites but can be tweaked to be used as blog, magazine or any other awesome website while highlighting its unique one page setup. This is going to be the last WordPress theme you will ever want to use because it is so much better than anything you have seen. Needless to say that this theme is SEO friendly thanks to its well optimized strucutre. Shapely theme is mobile friendly and fully responsive making it your best multipurpose partnert for any project and website.
Version: 1.0.7
Version: 1.7.0
License: GNU General Public License v3
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shapely
Expand Down Expand Up @@ -2050,6 +2050,10 @@ input[type="submit"]:focus {
}

.widget {
margin-bottom: 0;
}

#secondary .widget {
margin-bottom: 48px;
}

Expand Down Expand Up @@ -3163,4 +3167,12 @@ footer.bg-dark a {
.header-image-bg .page-title {
position: relative;
z-index: 2;
}

.customize-partial-edit-shortcut button, .widget .customize-partial-edit-shortcut button {
left: 0 !important;
}

#secondary .customize-partial-edit-shortcut button, #secondary .widget .customize-partial-edit-shortcut button {
left: -30px !important;
}

0 comments on commit 4bd1fd3

Please sign in to comment.