Skip to content

Commit 9ce3fee

Browse files
author
Robciuc Ioan
committed
Merge pull request #81 from MachoThemes/development
Development
2 parents 2d9942b + 48d7291 commit 9ce3fee

File tree

8 files changed

+1323
-52
lines changed

8 files changed

+1323
-52
lines changed

functions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ function decode_setup() {
122122
*
123123
* @global int $content_width
124124
*/
125+
125126
function decode_content_width() {
126-
$GLOBALS['content_width'] = apply_filters( 'decode_content_width', 792 );
127+
$width = get_theme_mod( 'content_width', 792 );
128+
129+
$GLOBALS['content_width'] = apply_filters( 'decode_content_width', $width );
127130
}
128131
add_action( 'after_setup_theme', 'decode_content_width', 0 );
129132

humans.txt

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
/* Author */
2-
Name: Scott Smith
3-
Email: mail@ScottHSmith.com
4-
URI: http://ScottHSmith.com
5-
Twitter: @ScottSmith95
2+
Name: Macho Themes
3+
Email: office@machothemes.com
4+
URI: http://www.machothemes.com
5+
Twitter: @machothemes
66

77
/* Translation Credits */
8-
Chinese Translation: Daihui Gu
9-
Email: yhzhtk@gmail.com
10-
URL: http://yhzhtk.info/
11-
12-
Czech Translation: Christian Kopec
13-
Email: chkopec@yahoo.com
14-
Twitter: @chkopec
15-
16-
Dutch Translation: Tom van den Kieboom
17-
Email: tvdkieboom@sharp-edge.nl
18-
URL: http://www.sharp-edge.nl
19-
20-
French Translation: Stéphane Bataillon
21-
Email: sbataillon@yahoo.fr
22-
URI: http://www.stephanebataillon.com
23-
Twitter: @sbataillon
24-
25-
German Translation: Christoph Purschke
26-
Email: christoph@purschke.info
27-
URL: http://purschke.info
28-
Twitter: @cpu_inside
29-
30-
Polish Translation: Mateusz Wozniak
31-
Email: m.wozniak@gmx.net
32-
URL: multilingua.pl
33-
Twitter: @MateuszJWozniak
34-
Updated by: Michał Maciejewski
35-
Email: admin@echidna-computers.pl
36-
37-
Russian Translation: Michael Yesutin
38-
Email: michael@yesutin.com
39-
URL: http://about.me/yesutin
40-
Twitter: @yesutin
41-
42-
Spanish Translation: Xabier Obanos
43-
Email: xobanos@gmail.com
44-
45-
Persian Translation: Benyamin Salimi
46-
Email: benyamin.salimi@gmail.com
47-
URL: http://cyanogen.ir
48-
Twitter: @benyaminsalimi
49-
8+
Chinese Translation: Daihui Gu
9+
Email: yhzhtk@gmail.com
10+
URL: http://yhzhtk.info/
11+
12+
Czech Translation: Christian Kopec
13+
Email: chkopec@yahoo.com
14+
Twitter: @chkopec
15+
16+
Dutch Translation: Tom van den Kieboom
17+
Email: tvdkieboom@sharp-edge.nl
18+
URL: http://www.sharp-edge.nl
19+
20+
French Translation: Stéphane Bataillon
21+
Email: sbataillon@yahoo.fr
22+
URI: http://www.stephanebataillon.com
23+
Twitter: @sbataillon
24+
25+
German Translation: Christoph Purschke
26+
Email: christoph@purschke.info
27+
URL: http://purschke.info
28+
Twitter: @cpu_inside
29+
30+
Polish Translation: Mateusz Wozniak
31+
Email: m.wozniak@gmx.net
32+
URL: multilingua.pl
33+
Twitter: @MateuszJWozniak
34+
Updated by: Michał Maciejewski
35+
Email: admin@echidna-computers.pl
36+
37+
Russian Translation: Michael Yesutin
38+
Email: michael@yesutin.com
39+
URL: http://about.me/yesutin
40+
Twitter: @yesutin
41+
42+
Spanish Translation: Xabier Obanos
43+
Email: xobanos@gmail.com
44+
45+
Persian Translation: Benyamin Salimi
46+
Email: benyamin.salimi@gmail.com
47+
URL: http://cyanogen.ir
48+
Twitter: @benyaminsalimi

inc/customizer.php

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77

88
function decode_add_customize_controls( $wp_customize ) {
9-
/* Adds Textarea Control (Required until WP 4.4) */
9+
/**
10+
* Adds Textarea Control (Required until WP 4.4)
11+
*/
1012
class Decode_Customize_Textarea_Control extends WP_Customize_Control {
1113
public $type = 'textarea';
1214

@@ -20,10 +22,64 @@ public function render_content() {
2022
}
2123
}
2224

23-
/* Adds a favicon image uploader control that only allows .ico and .png files to be uploaded */
25+
/**
26+
* Adds a favicon image uploader control that only allows .ico and .png files to be uploaded.
27+
*/
2428
class Decode_Customize_Favicon_Image_Control extends WP_Customize_Image_Control {
2529
public $extensions = array( 'png', 'ico', 'image/x-icon' );
2630
}
31+
32+
/**
33+
* Slider Control
34+
*/
35+
class Decode_Customize_Slider_Control extends WP_Customize_Control {
36+
37+
public $type = 'slider';
38+
39+
public function enqueue() {
40+
wp_enqueue_script( 'jquery-ui' );
41+
wp_enqueue_script( 'jquery-ui-slider' );
42+
wp_enqueue_style( 'decode-customize-slider-controle', get_template_directory_uri() . '/inc/customizer/assets/css/slider-control/slider-control.css' );
43+
}
44+
45+
public function render_content() { ?>
46+
<label>
47+
48+
<span class="customize-control-title">
49+
<?php echo esc_attr( $this->label ); ?>
50+
<?php if ( ! empty( $this->description ) ) : ?>
51+
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
52+
<?php endif; ?>
53+
</span>
54+
55+
<input type="text" class="rl-slider" id="input_<?php echo $this->id; ?>" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?>/>
56+
57+
</label>
58+
59+
<div id="slider_<?php echo $this->id; ?>" class="ss-slider"></div>
60+
<script>
61+
jQuery(document).ready(function($) {
62+
$( '[id="slider_<?php echo $this->id; ?>"]' ).slider({
63+
value : <?php echo esc_attr( $this->value() ); ?>,
64+
min : <?php echo $this->choices['min']; ?>,
65+
max : <?php echo $this->choices['max']; ?>,
66+
step : <?php echo $this->choices['step']; ?>,
67+
slide : function( event, ui ) { $( '[id="input_<?php echo $this->id; ?>"]' ).val(ui.value).keyup(); }
68+
});
69+
$( '[id="input_<?php echo $this->id; ?>"]' ).val( $( '[id="slider_<?php echo $this->id; ?>"]' ).slider( "value" ) );
70+
71+
$( '[id="input_<?php echo $this->id; ?>"]' ).change(function() {
72+
$( '[id="slider_<?php echo $this->id; ?>"]' ).slider({
73+
value : $( this ).val()
74+
});
75+
});
76+
77+
});
78+
</script>
79+
<?php
80+
81+
}
82+
}
2783
}
2884
add_action( 'customize_register', 'decode_add_customize_controls' );
2985

@@ -1306,6 +1362,11 @@ public static function decode_customize_register( $wp_customize ) {
13061362
'sanitize_callback' => 'decode_sanitize_boolean',
13071363
) );
13081364

1365+
$wp_customize->add_setting( 'content_width', array(
1366+
'default' => 792,
1367+
'sanitize_callback' => 'absint'
1368+
) );
1369+
13091370
$wp_customize->add_setting( 'site_colophon', array(
13101371
'default' => '',
13111372
'sanitize_callback' => 'decode_sanitize_html',
@@ -1428,6 +1489,19 @@ public static function decode_customize_register( $wp_customize ) {
14281489
'type' => 'checkbox',
14291490
'priority' => 16,
14301491
) );
1492+
1493+
$wp_customize->add_control(
1494+
new Decode_Customize_Slider_Control(
1495+
$wp_customize, 'content_width', array(
1496+
'label' => esc_html__( 'Content Width', 'decode' ),
1497+
'choices' => array(
1498+
'min' => 640,
1499+
'max' => 792,
1500+
'step' => 1
1501+
),
1502+
'section' => 'decode_content_options',
1503+
'priority' => 17,
1504+
) ) );
14311505

14321506
$wp_customize->add_control(
14331507
new Decode_Customize_Textarea_Control(
@@ -1436,7 +1510,7 @@ public static function decode_customize_register( $wp_customize ) {
14361510
'section' => 'decode_content_options',
14371511
'settings' => 'site_colophon',
14381512
'type' => 'textarea',
1439-
'priority' => 16,
1513+
'priority' => 18,
14401514
) ) );
14411515

14421516

inc/customizer/assets/css/slider-control/slider-control.css

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/bn_BD.mo

15.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)