|
14 | 14 | die; |
15 | 15 | } |
16 | 16 |
|
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 | | - |
70 | 17 | /** |
71 | 18 | * Customise the taxonomy columns. |
72 | 19 | * |
@@ -107,37 +54,6 @@ function wzkb_tax_id( $value, $name, $id ) { |
107 | 54 | add_filter( 'manage_wzkb_category_custom_column', 'wzkb_tax_id', 10, 3 ); |
108 | 55 | add_filter( 'manage_wzkb_tag_custom_column', 'wzkb_tax_id', 10, 3 ); |
109 | 56 |
|
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 | | - |
141 | 57 | /** |
142 | 58 | * Filters Admin Notices to add a notice when the settings are not saved. |
143 | 59 | * |
|
0 commit comments