Skip to content

Commit 0915d13

Browse files
author
Cosmin
committed
1 parent 340149f commit 0915d13

File tree

5 files changed

+60
-21
lines changed

5 files changed

+60
-21
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#79 - added epsilon toggles for widgets
1919
#95 - changed import demo content to required action
2020
#103 - removed margin bottom from the widgets only in the main content
21+
#16 - added the first option
2122

2223
### 1.0.7
2324
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>

inc/admin/welcome-screen/welcome-screen.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ public function check_for_icon( $arr ) {
266266
}
267267

268268
public function create_action_link( $state, $slug ) {
269+
$slug2 = $slug;
270+
if ( $slug === 'wordpress-seo' ) {
271+
$slug2 = 'wp-seo';
272+
}
269273
switch ( $state ) {
270274
case 'install':
271275
return wp_nonce_url(
@@ -282,19 +286,19 @@ public function create_action_link( $state, $slug ) {
282286
case 'deactivate':
283287
return add_query_arg( array(
284288
'action' => 'deactivate',
285-
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
289+
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
286290
'plugin_status' => 'all',
287291
'paged' => '1',
288-
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
292+
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug2 . '.php' ),
289293
), network_admin_url( 'plugins.php' ) );
290294
break;
291295
case 'activate':
292296
return add_query_arg( array(
293297
'action' => 'activate',
294-
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
298+
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
295299
'plugin_status' => 'all',
296300
'paged' => '1',
297-
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
301+
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug2 . '.php' ),
298302
), network_admin_url( 'plugins.php' ) );
299303
break;
300304
}

inc/customizer.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,30 @@ function shapely_customizer( $wp_customize ) {
130130
) );
131131
}
132132

133+
$wp_customize->add_setting( 'hide_post_title', array(
134+
'default' => 1,
135+
'sanitize_callback' => 'shapely_sanitize_checkbox',
136+
) );
137+
138+
if(class_exists('Epsilon_Control_Toggle')){
139+
$wp_customize->add_control( new Epsilon_Control_Toggle(
140+
$wp_customize,
141+
'hide_post_title',
142+
array(
143+
'type' => 'mte-toggle',
144+
'label' => esc_html__( 'Title in blog post', 'shapely' ),
145+
'section' => 'wpseo_breadcrumbs_customizer_section',
146+
)
147+
)
148+
);
149+
} else {
150+
$wp_customize->add_control( 'hide_post_title', array(
151+
'label' => esc_html__( 'Title in blog post', 'shapely' ),
152+
'section' => 'wpseo_breadcrumbs_customizer_section',
153+
'type' => 'checkbox',
154+
) );
155+
}
156+
133157
$wp_customize->add_setting( 'blog_name', array(
134158
'default' => '',
135159
'sanitize_callback' => 'shapely_sanitize_strip_slashes',

inc/extras.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ function shapely_get_header_logo() {
481481

482482
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php
483483
if ( $logo[0] != '' ) { ?>
484-
<img src="<?php echo esc_url($logo[0]); ?>" class="logo" alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
484+
<img src="<?php echo esc_url( $logo[0] ); ?>" class="logo"
485+
alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
485486
} else { ?>
486487
<span class="site-title"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></span><?php
487488
} ?>
@@ -533,29 +534,34 @@ function shapely_top_callout() {
533534
<div class="row">
534535
<?php
535536
$breadcrumbs_enabled = false;
537+
$title_in_post = false;
536538
if ( function_exists( 'yoast_breadcrumb' ) ) {
537539
$options = get_option( 'wpseo_internallinks' );
538540
$breadcrumbs_enabled = ( $options['breadcrumbs-enable'] === true );
541+
$title_in_post = get_theme_mod( 'hide_post_title', false );
539542
}
540543
?>
541-
<div class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
542-
<h3 class="page-title">
543-
<?php
544-
if ( is_home() ) {
545-
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
546-
} else if ( is_search() ) {
547-
_e( 'Search', 'shapely' );
548-
} else if ( is_archive() ) {
549-
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
550-
} else {
551-
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
552-
} ?>
553-
</h3>
554-
</div>
544+
<?php if ( $title_in_post ): ?>
545+
<div
546+
class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
547+
<h3 class="page-title">
548+
<?php
549+
if ( is_home() ) {
550+
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
551+
} else if ( is_search() ) {
552+
_e( 'Search', 'shapely' );
553+
} else if ( is_archive() ) {
554+
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
555+
} else {
556+
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
557+
} ?>
558+
</h3>
559+
</div>
560+
<?php endif; ?>
555561
<?php if ( function_exists( 'yoast_breadcrumb' ) ) { ?>
556562
<?php
557563
if ( $breadcrumbs_enabled ) { ?>
558-
<div class="col-md-6 col-sm-6 col-xs-12 text-right">
564+
<div class="<?php echo $title_in_post ? 'col-md-6 col-sm-6' : ''; ?> col-xs-12 text-right">
559565
<?php yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' ); ?>
560566
</div>
561567
<?php } ?>
@@ -612,7 +618,7 @@ function shapely_get_attachment_image() {
612618
$src = wp_get_attachment_image_src( $id, 'full', false );
613619

614620
if ( ! empty( $src[0] ) ) {
615-
echo esc_url($src[0]);
621+
echo esc_url( $src[0] );
616622
}
617623

618624
die();

style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,4 +3171,8 @@ footer.bg-dark a {
31713171

31723172
.customize-partial-edit-shortcut button, .widget .customize-partial-edit-shortcut button {
31733173
left: 0 !important;
3174+
}
3175+
3176+
#secondary .customize-partial-edit-shortcut button, #secondary .widget .customize-partial-edit-shortcut button {
3177+
left: -30px !important;
31743178
}

0 commit comments

Comments
 (0)