| 1 |
<?php |
| 2 |
add_action('admin_menu', 'wp_insert_add_menu'); |
| 3 |
|
| 4 |
function wp_insert_add_menu() { |
| 5 |
$handle = 'wp-insert'; |
| 6 |
add_menu_page(__('Wp-Insert','wp-insert'), __('Wp-Insert','wp-insert'), 'manage_options', $handle, 'wp_insert_add_adspage'); |
| 7 |
|
| 8 |
$subMenuItems = array( |
| 9 |
'AdsInContent' => array( |
| 10 |
'Title' => 'Manage Ads<br/>(Posts and Sidebars)', |
| 11 |
'Handle' => 'wp-insert', |
| 12 |
'Function' => 'wp_insert_add_adspage' |
| 13 |
), |
| 14 |
'AdsTemplate' => array( |
| 15 |
'Title' => 'Manage Ads<br/>(Template Tags)', |
| 16 |
'Handle' => 'ads-template-tags', |
| 17 |
'Function' => 'wp_insert_add_advanced_page' |
| 18 |
), |
| 19 |
'PrivacyPolicy' => array( |
| 20 |
'Title' => 'Manage Privacy Policy', |
| 21 |
'Handle' => 'manage-privacy-policy', |
| 22 |
'Function' => 'wp_insert_privacy_policy_page' |
| 23 |
), |
| 24 |
'TandC' => array( |
| 25 |
'Title' => 'Manage T & C', |
| 26 |
'Handle' => 'manage-terms-and-conditions', |
| 27 |
'Function' => 'wp_insert_terms_conditions_page' |
| 28 |
), |
| 29 |
'Pages' => array( |
| 30 |
'Title' => 'Manage Pages', |
| 31 |
'Handle' => 'manage-pages', |
| 32 |
'Function' => 'wp_insert_pages_page' |
| 33 |
), |
| 34 |
'SyntaxHighlighting' => array( |
| 35 |
'Title' => 'Syntax Highlighting', |
| 36 |
'Handle' => 'manage-syntax-highlighting', |
| 37 |
'Function' => 'wp_insert_syntax_highlighter_page' |
| 38 |
), |
| 39 |
'Feed' => array( |
| 40 |
'Title' => 'Manage Feed', |
| 41 |
'Handle' => 'manage-feed', |
| 42 |
'Function' => 'smart_add_feedspage' |
| 43 |
), |
| 44 |
'TrackingCodes' => array( |
| 45 |
'Title' => 'Tracking Codes', |
| 46 |
'Handle' => 'manage-tracking-codes', |
| 47 |
'Function' => 'smart_add_analytics' |
| 48 |
), |
| 49 |
'WYSIWYGEditor' => array( |
| 50 |
'Title' => 'WYSIWYG Editor', |
| 51 |
'Handle' => 'manage-wysiwyg-editing', |
| 52 |
'Function' => 'smart_add_wysiwyg_pages' |
| 53 |
), |
| 54 |
'miscellaneous' => array( |
| 55 |
'Title' => 'Miscellaneous', |
| 56 |
'Handle' => 'miscellaneous_options', |
| 57 |
'Function' => 'wp_insert_miscellaneous_pages' |
| 58 |
), |
| 59 |
); |
| 60 |
|
| 61 |
foreach($subMenuItems as $subMenuItem) { |
| 62 |
add_submenu_page($handle, $subMenuItem['Title'], $subMenuItem['Title'], 'manage_options', $subMenuItem['Handle'], $subMenuItem['Function']); |
| 63 |
} |
| 64 |
|
| 65 |
//ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes |
| 66 |
wp_enqueue_script('common'); |
| 67 |
wp_enqueue_script('wp-lists'); |
| 68 |
wp_enqueue_script('postbox'); |
| 69 |
//$columns[$screen] = 2; |
| 70 |
} |
| 71 |
?> |