Skip to content

Commit 0370aef

Browse files
Merge pull request #115 from MachoThemes/master
Enhancements round #4
2 parents 4a1de41 + 090dbbe commit 0370aef

File tree

9 files changed

+269
-23
lines changed

9 files changed

+269
-23
lines changed

functions.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ function shapely_setup() {
3737
) );
3838

3939
add_theme_support( 'custom-header', apply_filters( 'shapely_custom_header_args', array(
40-
'default-image' => '',
41-
'default-text-color' => '000000',
42-
'width' => 1900,
43-
'height' => 225,
44-
'flex-width' => true
40+
'default-image' => '',
41+
'default-text-color' => '000000',
42+
'width' => 1900,
43+
'height' => 225,
44+
'flex-width' => true
4545
) ) );
4646

4747
/*
@@ -270,8 +270,6 @@ function shapely_scripts() {
270270
wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.theme.default.css' );
271271

272272
wp_enqueue_script( 'shapely-scripts', get_template_directory_uri() . '/js/shapely-scripts.js', array( 'jquery' ), '20160115', true );
273-
274-
wp_enqueue_style( 'shapely-scss', get_template_directory_uri() . '/assets/css/style.css' );
275273
}
276274

277275
add_action( 'wp_enqueue_scripts', 'shapely_scripts' );
@@ -286,6 +284,11 @@ function shapely_scripts() {
286284
*/
287285
require get_template_directory() . '/inc/extras.php';
288286

287+
/**
288+
* Add custom section
289+
*/
290+
require get_template_directory() . '/inc/shapely-documentation/class-customize.php';
291+
289292
/**
290293
* Customizer additions.
291294
*/

inc/admin/welcome-screen/css/welcome_customizer.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
border-radius: 10px;
1313
z-index: 26;
1414
}
15+
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
jQuery(document).ready(function () {
2-
var shapely_aboutpage = shapelyWelcomeScreenCustomizerObject.aboutpage;
3-
var shapely_nr_actions_required = shapelyWelcomeScreenCustomizerObject.nr_actions_required;
4-
5-
/* Number of required actions */
6-
if ((typeof shapely_aboutpage !== 'undefined') && (typeof shapely_nr_actions_required !== 'undefined') && (shapely_nr_actions_required != '0')) {
7-
jQuery('#accordion-section-themes .accordion-section-title').append('<a href="' + shapely_aboutpage + '"><span class="shapely-actions-count">' + shapely_nr_actions_required + '</span></a>');
8-
}
9-
2+
var shapely_aboutpage = shapelyWelcomeScreenCustomizerObject.aboutpage;
3+
var shapely_nr_actions_required = shapelyWelcomeScreenCustomizerObject.nr_actions_required;
104

5+
/* Number of required actions */
6+
if ( (typeof shapely_aboutpage !== 'undefined') && (typeof shapely_nr_actions_required !== 'undefined') && (shapely_nr_actions_required != '0') ) {
7+
jQuery('#accordion-section-themes .accordion-section-title').append('<a href="' + shapely_aboutpage + '"><span class="shapely-actions-count">' + shapely_nr_actions_required + '</span></a>');
8+
}
119
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function shapely_dismiss_required_action_callback() {
124124

125125
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
126126

127-
echo $action_id; /* this is needed and it's the id of the dismissable required action */
127+
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
128128

129129
if ( ! empty( $action_id ) ):
130130

@@ -331,7 +331,7 @@ public function shapely_welcome_screen() {
331331

332332
<div class="wrap about-wrap epsilon-wrap">
333333

334-
<h1><?php echo __( 'Welcome to Shapely! - Version ', 'shapely' ) . $shapely['Version']; ?></h1>
334+
<h1><?php echo esc_html__( 'Welcome to Shapely! - Version ', 'shapely' ) . $shapely['Version']; ?></h1>
335335

336336
<div
337337
class="about-text"><?php echo esc_html__( 'Shapely is now installed and ready to use! Get ready to build something beautiful. We hope you enjoy it! We want to make sure you have the best experience using shapely and that is why we gathered here all the necessary information for you. We hope you will enjoy using shapely, as much as we enjoy creating great products.', 'shapely' ); ?></div>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
3+
/**
4+
* Singleton class for handling the theme's customizer integration.
5+
*
6+
* @since 1.0.0
7+
* @access public
8+
*/
9+
final class Shapely_Documentation_Customize {
10+
/**
11+
* Returns the instance.
12+
*
13+
* @since 1.0.0
14+
* @access public
15+
* @return object
16+
*/
17+
public static function get_instance() {
18+
static $instance = NULL;
19+
if ( is_null( $instance ) ) {
20+
$instance = new self;
21+
$instance->setup_actions();
22+
}
23+
24+
return $instance;
25+
}
26+
27+
/**
28+
* Constructor method.
29+
*
30+
* @since 1.0.0
31+
* @access private
32+
* @return void
33+
*/
34+
private function __construct() {
35+
}
36+
37+
/**
38+
* Sets up initial actions.
39+
*
40+
* @since 1.0.0
41+
* @access private
42+
* @return void
43+
*/
44+
private function setup_actions() {
45+
// Register panels, sections, settings, controls, and partials.
46+
add_action( 'customize_register', array( $this, 'sections' ) );
47+
// Register scripts and styles for the controls.
48+
add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
49+
}
50+
51+
/**
52+
* Sets up the customizer sections.
53+
*
54+
* @since 1.0.0
55+
* @access public
56+
*
57+
* @param object $manager
58+
*
59+
* @return void
60+
*/
61+
public function sections( $manager ) {
62+
// Load custom sections.
63+
require_once( trailingslashit( get_template_directory() ) . 'inc/shapely-documentation/class-shapely-documentation-customizer.php' );
64+
// Register custom section types.
65+
$manager->register_section_type( 'Shapely_Documentation_Customize_Section' );
66+
// Register sections.
67+
$manager->add_section(
68+
new Shapely_Documentation_Customize_Section(
69+
$manager,
70+
'shapely_documentation',
71+
array(
72+
'title' => esc_html__( 'Shapely', 'shapely' ),
73+
'pro_text' => esc_html__( 'Documentation', 'shapely' ),
74+
'pro_url' => 'https://colorlib.com/wp/support/shapely/',
75+
'priority' => 0,
76+
)
77+
)
78+
);
79+
}
80+
81+
/**
82+
* Loads theme customizer CSS.
83+
*
84+
* @since 1.0.0
85+
* @access public
86+
* @return void
87+
*/
88+
public function enqueue_control_scripts() {
89+
wp_enqueue_script( 'shapely-documentation-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/shapely-documentation/customize-controls.js', array( 'customize-controls' ) );
90+
wp_enqueue_style( 'shapely-documentation-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/shapely-documentation/customize-controls.css' );
91+
}
92+
}
93+
94+
Shapely_Documentation_Customize::get_instance();
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
/**
4+
* Pro customizer section.
5+
*
6+
* @since 1.0.0
7+
* @access public
8+
*/
9+
class Shapely_Documentation_Customize_Section extends WP_Customize_Section {
10+
/**
11+
* The type of customize section being rendered.
12+
*
13+
* @since 1.0.0
14+
* @access public
15+
* @var string
16+
*/
17+
public $type = 'shapely-documentation';
18+
/**
19+
* Custom button text to output.
20+
*
21+
* @since 1.0.0
22+
* @access public
23+
* @var string
24+
*/
25+
public $pro_text = 'Shapely';
26+
/**
27+
* Custom pro button URL.
28+
*
29+
* @since 1.0.0
30+
* @access public
31+
* @var string
32+
*/
33+
public $pro_url = 'https://colorlib.com';
34+
35+
/**
36+
* Add custom parameters to pass to the JS via JSON.
37+
*
38+
* @since 1.0.0
39+
* @access public
40+
* @return void
41+
*/
42+
public function json() {
43+
$json = parent::json();
44+
$json['pro_text'] = $this->pro_text;
45+
$json['pro_url'] = esc_url( $this->pro_url );
46+
47+
return $json;
48+
}
49+
50+
/**
51+
* Outputs the Underscore.js template.
52+
*
53+
* @since 1.0.0
54+
* @access public
55+
* @return void
56+
*/
57+
protected function render_template() { ?>
58+
<li id="accordion-section-{{ data.id }}"
59+
class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
60+
61+
<h3 class="accordion-section-title">
62+
{{ data.title }}
63+
64+
<# if ( data.pro_text && data.pro_url ) { #>
65+
<a href="{{ data.pro_url }}" class="button button-secondary alignright" target="_blank">{{
66+
data.pro_text }}</a>
67+
<# } #>
68+
</h3>
69+
</li>
70+
<?php }
71+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#customize-controls .control-section-shapely-documentation .accordion-section-title:hover,
2+
#customize-controls .control-section-shapely-documentation .accordion-section-title:focus {
3+
background-color: #fff;
4+
}
5+
6+
.control-section-shapely-documentation .accordion-section-title .button {
7+
margin-top: -4px;
8+
font-weight: 400;
9+
margin-left: 8px;
10+
}
11+
12+
.rtl .control-section-shapely-documentation .accordion-section-title .button {
13+
margin-left: 0;
14+
margin-right: 8px;
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function (api) {
2+
api.sectionConstructor[ 'shapely-documentation' ] = api.Section.extend({
3+
4+
// No events for this type of section.
5+
attachEvents: function () {
6+
},
7+
8+
// Always make the section active.
9+
isContextuallyActive: function () {
10+
return true;
11+
}
12+
});
13+
14+
})(wp.customize);

style.css

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,11 +2055,6 @@ input[type="submit"]:focus {
20552055
line-height: 32px;
20562056
}
20572057

2058-
.footer-widget .widget-title {
2059-
border-bottom: 1px solid #555;
2060-
color: #fff;
2061-
}
2062-
20632058
.widget hr {
20642059
margin-bottom: 12px;
20652060
}
@@ -3202,6 +3197,31 @@ footer.bg-dark a {
32023197
z-index: 2;
32033198
}
32043199

3200+
/*
3201+
* Elements
3202+
*/
3203+
blockquote {
3204+
background: transparent;
3205+
border-top: 1px solid #ebebeb;
3206+
border-bottom: 1px solid #ebebeb;
3207+
border-left: none;
3208+
position: relative; }
3209+
blockquote:after {
3210+
content: '';
3211+
height: 1px;
3212+
width: 150px;
3213+
display: block;
3214+
position: absolute;
3215+
bottom: 0;
3216+
left: 50%;
3217+
background: #001c28;
3218+
-webkit-transform: translateX(-50%);
3219+
-khtml-transform: translateX(-50%);
3220+
-moz-transform: translateX(-50%);
3221+
-ms-transform: translateX(-50%);
3222+
-o-transform: translateX(-50%);
3223+
transform: translateX(-50%); }
3224+
32053225
/*
32063226
* Widgets
32073227
*/
@@ -3488,6 +3508,36 @@ footer.bg-dark a {
34883508
color: transparent !important;
34893509
right: 0; }
34903510

3511+
#colophon .site-info {
3512+
margin-top: 15px; }
3513+
#colophon .widget {
3514+
display: inline-block;
3515+
width: 100%; }
3516+
#colophon .widget ul {
3517+
padding-left: 0;
3518+
margin-left: 0; }
3519+
#colophon .widget ul li {
3520+
margin-right: 0; }
3521+
#colophon .widget .widget-title {
3522+
color: #fff;
3523+
border-bottom: none; }
3524+
#colophon .widget.widget_calendar #wp-calendar > caption {
3525+
color: #fff; }
3526+
#colophon .widget.widget_calendar #wp-calendar td:not(.pad):not(#next):not(#prev)#today, #colophon .widget.widget_calendar #wp-calendar thead {
3527+
color: #fff; }
3528+
#colophon .widget.widget_calendar #wp-calendar th, #colophon .widget.widget_calendar #wp-calendar td {
3529+
color: #fff; }
3530+
#colophon .widget.widget_calendar #wp-calendar #prev:before, #colophon .widget.widget_calendar #wp-calendar #next:before {
3531+
color: #fff; }
3532+
#colophon .widget.widget_rss ul li .rsswidget {
3533+
color: #fff; }
3534+
#colophon .widget.widget_rss ul li .rsswidget:hover, #colophon .widget.widget_rss ul li .rsswidget:focus {
3535+
color: #5234f9; }
3536+
#colophon .widget.widget_rss .widget-title a {
3537+
color: #fff; }
3538+
#colophon .widget.widget_rss .widget-title a:hover, #colophon .widget.widget_rss .widget-title a:focus {
3539+
color: #5234f9; }
3540+
34913541
/*
34923542
* Content
34933543
*/
@@ -3765,4 +3815,4 @@ footer.bg-dark a {
37653815
color: #001c28; }
37663816

37673817
.pt0 {
3768-
padding-top: 30px; }
3818+
padding-top: 30px; }

0 commit comments

Comments
 (0)