Skip to content

Commit 313eef0

Browse files
committed
Upgraded to Settings_API
Fixes #52
1 parent b78e282 commit 313eef0

23 files changed

+2847
-1682
lines changed

includes/admin/admin.php

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -14,59 +14,6 @@
1414
die;
1515
}
1616

17-
18-
/**
19-
* Creates the admin submenu pages under the Downloads menu and assigns their
20-
* links to global variables
21-
*
22-
* @since 1.2.0
23-
*
24-
* @global $wzkb_settings_page
25-
* @return void
26-
*/
27-
function wzkb_add_admin_pages_links() {
28-
global $wzkb_settings_page;
29-
30-
$wzkb_settings_page = add_submenu_page( 'edit.php?post_type=wz_knowledgebase', __( 'Knowledge Base Settings', 'knowledgebase' ), __( 'Settings', 'knowledgebase' ), 'manage_options', 'wzkb-settings', 'wzkb_options_page' );
31-
32-
// Load the settings contextual help.
33-
add_action( "load-$wzkb_settings_page", 'wzkb_settings_help' );
34-
}
35-
add_action( 'admin_menu', 'wzkb_add_admin_pages_links' );
36-
37-
38-
/**
39-
* Enqueue Admin JS
40-
*
41-
* @since 2.0.0
42-
*
43-
* @param string $hook The current admin page.
44-
*/
45-
function wzkb_load_admin_scripts( $hook ) {
46-
47-
global $wzkb_settings_page;
48-
49-
wp_register_script( 'wzkb-admin-js', WZKB_PLUGIN_URL . 'includes/admin/js/admin-scripts.min.js', array( 'jquery', 'jquery-ui-tabs' ), '1.0', true );
50-
51-
if ( $hook === $wzkb_settings_page ) {
52-
53-
wp_enqueue_script( 'wzkb-admin-js' );
54-
55-
wp_enqueue_code_editor(
56-
array(
57-
'type' => 'text/html',
58-
'codemirror' => array(
59-
'indentUnit' => 2,
60-
'tabSize' => 2,
61-
),
62-
)
63-
);
64-
65-
}
66-
}
67-
add_action( 'admin_enqueue_scripts', 'wzkb_load_admin_scripts' );
68-
69-
7017
/**
7118
* Customise the taxonomy columns.
7219
*
@@ -107,37 +54,6 @@ function wzkb_tax_id( $value, $name, $id ) {
10754
add_filter( 'manage_wzkb_category_custom_column', 'wzkb_tax_id', 10, 3 );
10855
add_filter( 'manage_wzkb_tag_custom_column', 'wzkb_tax_id', 10, 3 );
10956

110-
111-
/**
112-
* Add rating links to the admin dashboard
113-
*
114-
* @since 1.2.0
115-
*
116-
* @param string $footer_text The existing footer text.
117-
* @return string Updated Footer text
118-
*/
119-
function wzkb_admin_footer( $footer_text ) {
120-
121-
if ( get_current_screen()->post_type === 'wz_knowledgebase' ) {
122-
123-
$text = sprintf(
124-
/* translators: 1: Knowledge Base website, 2: Plugin reviews link. */
125-
__( 'Thank you for using <a href="%1$s" target="_blank">WebberZone Knowledge Base</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a>', 'knowledgebase' ),
126-
'https://webberzone.com/knowledgebase',
127-
'https://wordpress.org/support/plugin/knowledgebase/reviews/#new-post'
128-
);
129-
130-
return str_replace( '</span>', '', $footer_text ) . ' | ' . $text . '</span>';
131-
132-
} else {
133-
134-
return $footer_text;
135-
136-
}
137-
}
138-
add_filter( 'admin_footer_text', 'wzkb_admin_footer' );
139-
140-
14157
/**
14258
* Filters Admin Notices to add a notice when the settings are not saved.
14359
*

includes/admin/default-settings.php

Lines changed: 0 additions & 280 deletions
This file was deleted.

0 commit comments

Comments
 (0)