Repository navigation
Expand file tree
/
Copy pathsettings.php
More file actions
71 lines (58 loc) · 1.4 KB
/
Copy pathsettings.php
File metadata and controls
71 lines (58 loc) · 1.4 KB
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
<?php
/**
* Group the Sections box: Meta for page titles, and Sections for
* archives and singles. The class keeps its archive name, which is the
* group id its tabs register into.
*
* @since 1.0
*/
class md_archive extends md_api {
/**
* Register the shared Sections settings group.
*
* @since 1.0
*/
public function register() {
$this->name = __( 'Sections', 'md-sections' );
return array(
'admin_page' => array(
'name' => $this->name,
'group' => 'page_settings',
'position' => 7
),
'term' => array(
'name' => $this->name,
'position' => 20
)
);
}
/**
* Render the Sections group on post type settings pages.
*
* @since 1.0
*/
public function admin_page() {
$this->group( 'admin_page' );
}
/**
* Render the Sections group on taxonomy term screens.
*
* @since 1.0
*/
public function term() {
$this->group( 'term_meta' );
}
/**
* Render the shared group wrapper for an admin context.
*
* @since 1.0
*/
private function group( $context ) {
echo '<div class="md-widget md-toggle mb-single">'.
'<h3 class="md-widget-title"><span>' . esc_html( $this->name ) . '<span class="md-widget-description">' . esc_html__( 'Query Loops, filters, titles and archive details', 'md-sections' ) . '</span></span></h3>'.
'<div class="md-widget-item">';
$this->fields->settings_group( $context );
echo '</div></div>';
}
}
new md_archive;