-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenesis-theme-options-customizer.php
112 lines (97 loc) · 2.6 KB
/
genesis-theme-options-customizer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* Genesis Theme Options
*
* @package Genesis_Theme_Options
* @author Brad Potter
* @license GPL-2.0+
* @link http://www.bradpotter.com/plugins/genesis-theme-options
* @copyright Copyright (c) 2015, Brad Potter
*/
/**
* Genesis Theme Options Customizer Class
*
* @since 0.9.0
*/
class Genesis_Theme_Options_Customizer extends Genesis_Customizer_Base {
/**
* Settings field.
*/
public $settings_field = 'genesis-settings';
/**
* Register
*/
public function register( $wp_customize ) {
$this->postoptions( $wp_customize );
}
private function postoptions( $wp_customize ) {
$wp_customize->add_section(
'genesis_post_options',
array(
'title' => __( 'Post Options', 'genesis-theme-options' ),
'description' => __( 'These options will affect any default blog listings page, including archive, author, blog, category, search, and tag pages.', 'genesis' ),
)
);
$wp_customize->add_setting(
$this->get_field_name( 'gto_post_amount' ),
array(
'default' => $this->get_field_name( 'gto_post_amount' ),
'type' => 'option',
)
);
$wp_customize->add_control(
'genesis_gto_post_amount',
array(
'label' => __( 'Posts Per Page', 'genesis-theme-options' ),
'section' => 'genesis_post_options',
'settings' => $this->get_field_name( 'gto_post_amount' ),
'type' => 'text',
)
);
$wp_customize->add_setting(
$this->get_field_name( 'gto_post_orderby' ),
array(
'default' => $this->get_field_name( 'gto_post_orderby' ),
'type' => 'option',
)
);
$wp_customize->add_control(
'genesis_gto_post_orderby',
array(
'label' => __( 'Order Posts By', 'genesis-theme-options' ),
'section' => 'genesis_post_options',
'settings' => $this->get_field_name( 'gto_post_orderby' ),
'type' => 'text',
)
);
$wp_customize->add_setting(
$this->get_field_name( 'gto_post_order' ),
array(
'default' => $this->get_field_name( 'gto_post_order' ),
'type' => 'option',
)
);
$wp_customize->add_control(
'genesis_gto_post_order',
array(
'label' => __( 'Post Order', 'genesis-theme-options' ),
'section' => 'genesis_post_options',
'settings' => $this->get_field_name( 'gto_post_order' ),
'type' => 'select',
'choices' => array(
'DESC' => __( 'Descending', 'genesis' ),
'ASC' => __( 'Ascending', 'genesis' ),
)
)
);
}
}
add_action( 'init', 'genesis_gto_customizer_init' );
/**
* Initialize Genesis Theme Options Customizer
*
* @since 0.9.0
*/
function genesis_gto_customizer_init() {
new Genesis_Theme_Options_Customizer;
}