/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
#CodeDescriptions
1<?php
2/**
3 * WordPress Administration for Navigation Menus
4 * Interface functions
5 *
6 * @version 2.0.0
7 *
8 * @package WordPress
9 * @subpackage Administration
10 */
11
12/** Load WordPress Administration Bootstrap */
13require_once( 'admin.php' );
14
15// Load all the nav menu interface functions
16require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
17
18if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' ) )
19 wp_die( __( 'Your theme does not support navigation menus or widgets.' ) );
20
21// Permissions Check
22if ( ! current_user_can('edit_theme_options') )
23 wp_die( __( 'Cheatin’ uh?' ) );
24
25// Nav Menu CSS
26wp_admin_css( 'nav-menu' );
27
28// jQuery
29wp_enqueue_script( 'jquery' );
30wp_enqueue_script( 'jquery-ui-draggable' );
31wp_enqueue_script( 'jquery-ui-droppable' );
32wp_enqueue_script( 'jquery-ui-sortable' );
33
34// Nav Menu functions
35wp_enqueue_script( 'nav-menu' );
36
37// Metaboxes
38wp_enqueue_script( 'common' );
39wp_enqueue_script( 'wp-lists' );
40wp_enqueue_script( 'postbox' );
41
42// Container for any messages displayed to the user
43$messages = array();
44
45// Container that stores the name of the active menu
46$nav_menu_selected_title = '';
47
48// The menu id of the current menu being edited
49$nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
50
51// Allowed actions: add, update, delete
52$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';
53
54switch ( $action ) {
55 case 'add-menu-item':
56 check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' );
57 if ( isset( $_REQUEST['nav-menu-locations'] ) )
58 set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) );
59 elseif ( isset( $_REQUEST['menu-item'] ) )
60 wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] );
61 break;
62 case 'move-down-menu-item' :
63 // moving down a menu item is the same as moving up the next in order
64 check_admin_referer( 'move-menu_item' );
65 $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;
66 if ( is_nav_menu_item( $menu_item_id ) ) {
67 $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );
68 if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {
69 $menu_id = (int) $menus[0];
70 $ordered_menu_items = wp_get_nav_menu_items( $menu_id );
71 $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
72
73 // setup the data we need in one pass through the array of menu items
74 $dbids_to_orders = array();
75 $orders_to_dbids = array();
76 foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) {
77 if ( isset( $ordered_menu_item_object->ID ) ) {
78 if ( isset( $ordered_menu_item_object->menu_order ) ) {
79 $dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
80 $orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
81 }
82 }
83 }
84
85 // get next in order
86 if (
87 isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1] )
88 ) {
89 $next_item_id = $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1];
90 $next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );
91
92 // if not siblings of same parent, bubble menu item up but keep order
93 if (
94 ! empty( $menu_item_data['menu_item_parent'] ) &&
95 (
96 empty( $next_item_data['menu_item_parent'] ) ||
97 $next_item_data['menu_item_parent'] != $menu_item_data['menu_item_parent']
98 )
99 ) {
100
101 $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
102
103 $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
104
105 if ( ! is_wp_error( $parent_object ) ) {
106 $parent_data = (array) $parent_object;
107 $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
108 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
109
110 }
111
112 // make menu item a child of its next sibling
113 } else {
114 $next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;
115 $menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;
116
117 $menu_item_data['menu_item_parent'] = $next_item_data['ID'];
118 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
119
120 wp_update_post($menu_item_data);
121 wp_update_post($next_item_data);
122 }
123
124
125 // the item is last but still has a parent, so bubble up
126 } elseif (
127 ! empty( $menu_item_data['menu_item_parent'] ) &&
128 in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
129 ) {
130 $menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true);
131 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
132 }
133 }
134 }
135
136 break;
137 case 'move-up-menu-item' :
138 check_admin_referer( 'move-menu_item' );
139 $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;
140 if ( is_nav_menu_item( $menu_item_id ) ) {
141 $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );
142 if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {
143 $menu_id = (int) $menus[0];
144 $ordered_menu_items = wp_get_nav_menu_items( $menu_id );
145 $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
146
147 // setup the data we need in one pass through the array of menu items
148 $dbids_to_orders = array();
149 $orders_to_dbids = array();
150 foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) {
151 if ( isset( $ordered_menu_item_object->ID ) ) {
152 if ( isset( $ordered_menu_item_object->menu_order ) ) {
153 $dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
154 $orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
155 }
156 }
157 }
158
159
160 // if this menu item is not first
161 if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) {
162
163 // if this menu item is a child of the previous
164 if (
165 ! empty( $menu_item_data['menu_item_parent'] ) &&
166 in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
167 isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) &&
168 ( $menu_item_data['menu_item_parent'] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] )
169 ) {
170 $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
171 $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
172
173 if ( ! is_wp_error( $parent_object ) ) {
174 $parent_data = (array) $parent_object;
175
176 // if there is something before the parent and parent a child of it, make menu item a child also of it
177 if (
178 ! empty( $dbids_to_orders[$parent_db_id] ) &&
179 ! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) &&
180 ! empty( $parent_data['menu_item_parent'] )
181 ) {
182 $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
183
184 // else if there is something before parent and parent not a child of it, make menu item a child of that something's parent
185 } elseif (
186 ! empty( $dbids_to_orders[$parent_db_id] ) &&
187 ! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] )
188 ) {
189 $_possible_parent_id = (int) get_post_meta( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1], '_menu_item_menu_item_parent', true);
190 if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ) ) )
191 $menu_item_data['menu_item_parent'] = $_possible_parent_id;
192 else
193 $menu_item_data['menu_item_parent'] = 0;
194
195 // else there isn't something before the parent
196 } else {
197 $menu_item_data['menu_item_parent'] = 0;
198 }
199
200 // set former parent's [menu_order] to that of menu-item's
201 $parent_data['menu_order'] = $parent_data['menu_order'] + 1;
202
203 // set menu-item's [menu_order] to that of former parent
204 $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1;
205
206 // save changes
207 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
208 wp_update_post($menu_item_data);
209 wp_update_post($parent_data);
210 }
211
212 // else this menu item is not a child of the previous
213 } elseif (
214 empty( $menu_item_data['menu_order'] ) ||
215 empty( $menu_item_data['menu_item_parent'] ) ||
216 ! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
217 empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ||
218 $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent']
219 ) {
220 // just make it a child of the previous; keep the order
221 $menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1];
222 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
223 wp_update_post($menu_item_data);
224 }
225 }
226 }
227 }
228 break;
229
230 case 'delete-menu-item':
231 $menu_item_id = (int) $_REQUEST['menu-item'];
232
233 check_admin_referer( 'delete-menu_item_' . $menu_item_id );
234
235
236 if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) )
237 $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>';
238 break;
239 case 'delete':
240 check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id );
241
242 if ( is_nav_menu( $nav_menu_selected_id ) ) {
243 $deleted_nav_menu = wp_get_nav_menu_object( $nav_menu_selected_id );
244 $delete_nav_menu = wp_delete_nav_menu( $nav_menu_selected_id );
245
246 if ( is_wp_error($delete_nav_menu) ) {
247 $messages[] = '<div id="message" class="error"><p>' . $delete_nav_menu->get_error_message() . '</p></div>';
248 } else {
249 // Remove this menu from any locations.
250 $locations = get_theme_mod( 'nav_menu_locations' );
251 foreach ( (array) $locations as $location => $menu_id ) {
252 if ( $menu_id == $nav_menu_selected_id )
253 $locations[ $location ] = 0;
254 }
255 set_theme_mod( 'nav_menu_locations', $locations );
256 $messages[] = '<div id="message" class="updated"><p>' . __('The menu has been successfully deleted.') . '</p></div>';
257 // Select the next available menu
258 $nav_menu_selected_id = 0;
259 $_nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
260 foreach( $_nav_menus as $index => $_nav_menu ) {
261 if ( strcmp( $_nav_menu->name, $deleted_nav_menu->name ) >= 0
262 || $index == count( $_nav_menus ) - 1 ) {
263 $nav_menu_selected_id = $_nav_menu->term_id;
264 break;
265 }
266 }
267 }
268 unset( $delete_nav_menu, $deleted_nav_menu, $_nav_menus );
269 } else {
270 // Reset the selected menu
271 $nav_menu_selected_id = 0;
272 unset( $_REQUEST['menu'] );
273 }
274 break;
275
276 case 'update':
277 check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );
278
279 // Update menu theme locations
280 if ( isset( $_POST['menu-locations'] ) )
281 set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
282
283 // Add Menu
284 if ( 0 == $nav_menu_selected_id ) {
285 $new_menu_title = trim( esc_html( $_POST['menu-name'] ) );
286
287 if ( $new_menu_title ) {
288 $_nav_menu_selected_id = wp_update_nav_menu_object( 0, array('menu-name' => $new_menu_title) );
289
290 if ( is_wp_error( $_nav_menu_selected_id ) ) {
291 $messages[] = '<div id="message" class="error"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
292 } else {
293 $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
294 $nav_menu_selected_id = $_nav_menu_selected_id;
295 $nav_menu_selected_title = $_menu_object->name;
296 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been successfully created.'), $nav_menu_selected_title ) . '</p></div>';
297 }
298 } else {
299 $messages[] = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>';
300 }
301
302 // update existing menu
303 } else {
304
305 $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
306
307 $menu_title = trim( esc_html( $_POST['menu-name'] ) );
308 if ( ! $menu_title ) {
309 $messages[] = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>';
310 $menu_title = $_menu_object->name;
311 }
312
313 if ( ! is_wp_error( $_menu_object ) ) {
314 $_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' => $menu_title ) );
315 if ( is_wp_error( $_nav_menu_selected_id ) ) {
316 $_menu_object = $_nav_menu_selected_id;
317 $messages[] = '<div id="message" class="error"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
318 } else {
319 $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
320 $nav_menu_selected_title = $_menu_object->name;
321 }
322 }
323
324 // Update menu items
325
326 if ( ! is_wp_error( $_menu_object ) ) {
327 $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish') );
328 $menu_items = array();
329 // Index menu items by db ID
330 foreach( $unsorted_menu_items as $_item )
331 $menu_items[$_item->db_id] = $_item;
332
333 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );
334 wp_defer_term_counting(true);
335 // Loop through all the menu items' POST variables
336 if ( ! empty( $_POST['menu-item-db-id'] ) ) {
337 foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
338
339 // Menu item title can't be blank
340 if ( empty( $_POST['menu-item-title'][$_key] ) )
341 continue;
342
343 $args = array();
344 foreach ( $post_fields as $field )
345 $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : '';
346
347 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
348
349 if ( is_wp_error( $menu_item_db_id ) )
350 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
351 elseif ( isset( $menu_items[$menu_item_db_id] ) )
352 unset( $menu_items[$menu_item_db_id] );
353 }
354 }
355
356 // Remove menu items from the menu that weren't in $_POST
357 if ( ! empty( $menu_items ) ) {
358 foreach ( array_keys( $menu_items ) as $menu_item_id ) {
359 if ( is_nav_menu_item( $menu_item_id ) ) {
360 wp_delete_post( $menu_item_id );
361 }
362 }
363 }
364
365 // Store 'auto-add' pages.
366 $auto_add = ! empty( $_POST['auto-add-pages'] );
367 $nav_menu_option = (array) get_option( 'nav_menu_options' );
368 if ( ! isset( $nav_menu_option['auto_add'] ) )
369 $nav_menu_option['auto_add'] = array();
370 if ( $auto_add ) {
371 if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) )
372 $nav_menu_option['auto_add'][] = $nav_menu_selected_id;
373 } else {
374 if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) )
375 unset( $nav_menu_option['auto_add'][$key] );
376 }
377 // Remove nonexistent/deleted menus
378 $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
379 update_option( 'nav_menu_options', $nav_menu_option );
380
381 wp_defer_term_counting(false);
382
383 do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
384
385 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been updated.'), $nav_menu_selected_title ) . '</p></div>';
386 unset( $menu_items, $unsorted_menu_items );
387 }
388 }
389 break;
390}
391
392// Get all nav menus
393$nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
394
395// Get recently edited nav menu
396$recently_edited = (int) get_user_option( 'nav_menu_recently_edited' );
397
398// If there was no recently edited menu, and $nav_menu_selected_id is a nav menu, update recently edited menu.
399if ( !$recently_edited && is_nav_menu( $nav_menu_selected_id ) ) {
400 $recently_edited = $nav_menu_selected_id;
401
402// Else if $nav_menu_selected_id is not a menu and not requesting that we create a new menu, but $recently_edited is a menu, grab that one.
403} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && is_nav_menu( $recently_edited ) ) {
404 $nav_menu_selected_id = $recently_edited;
405
406// Else try to grab the first menu from the menus list
407} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && ! empty($nav_menus) ) {
408 $nav_menu_selected_id = $nav_menus[0]->term_id;
409}
410
411// Update the user's setting
412if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selected_id ) )
413 update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id );
414
415// If there's a menu, get its name.
416if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
417 $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
418 $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : '';
419}
420
421// Generate truncated menu names
422foreach( (array) $nav_menus as $key => $_nav_menu ) {
423 $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) );
424 if ( $_nav_menu->truncated_name != $_nav_menu->name )
425 $_nav_menu->truncated_name .= '…';
426
427 $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name;
428}
429
430// Ensure the user will be able to scroll horizontally
431// by adding a class for the max menu depth.
432global $_wp_nav_menu_max_depth;
433$_wp_nav_menu_max_depth = 0;
434
435// Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth
436if ( is_nav_menu( $nav_menu_selected_id ) )
437 $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
438
439function wp_nav_menu_max_depth() {
440 global $_wp_nav_menu_max_depth;
441 return "menu-max-depth-$_wp_nav_menu_max_depth";
442}
443
444add_action('admin_body_class','wp_nav_menu_max_depth');
445
446wp_nav_menu_setup();
447wp_initial_nav_menu_meta_boxes();
448
449if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
450 $messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '</p></div>';
451
452$help = '<p>' . __('This feature is new in version 3.0; to use a custom menu in place of your theme’s default menus, support for this feature must be registered in the theme’s functions.php file. If your theme does not support the custom menus feature yet (the new default theme, Twenty Ten, does), you can learn about adding support yourself by following the below link.') . '</p>';
453$help .= '<p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>';
454$help .= '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. You’ll see when the position of the drop target shifts over to create the nested placement. Don’t forget to click Save when you’re finished.') . '</p>';
455$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
456$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_SubPanel" target="_blank">Menus Documentation</a>') . '</p>';
457$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
458
459add_contextual_help($current_screen, $help);
460
461// Get the admin header
462require_once( 'admin-header.php' );
463?>
464<div class="wrap">
465 <?php screen_icon(); ?>
466 <h2><?php esc_html_e('Menus'); ?></h2>
467 <?php
468 foreach( $messages as $message ) :
469 echo $message . "\n";//Cross Site Scripting
470 endforeach;
471 ?>
472 <div id="nav-menus-frame">
473 <div id="menu-settings-column" class="metabox-holder<?php if ( !$nav_menu_selected_id ) { echo ' metabox-holder-disabled'; } ?>">
474
475 <form id="nav-menu-meta" action="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-menu-meta" method="post" enctype="multipart/form-data">
476 <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
477 <input type="hidden" name="action" value="add-menu-item" />
478 <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
479 <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
480 </form>
481
482 </div><!-- /#menu-settings-column -->
483 <div id="menu-management-liquid">
484 <div id="menu-management">
485 <div id="select-nav-menu-container" class="hide-if-js">
486 <form id="select-nav-menu" action="">
487 <strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu:' ); ?></label></strong>
488 <select class="select-nav-menu" name="menu">
489 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?>
490 <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>>
491 <?php echo esc_html( $_nav_menu->truncated_name ); ?>
492 </option>
493 <?php endforeach; ?>
494 <option value="0"><?php esc_html_e('Add New Menu'); ?></option>
495 </select>
496 <input type="hidden" name="action" value="edit" />
497 <input class="button-secondary" name="select_menu" type="submit" value="<?php esc_attr_e('Select'); ?>" />
498 </form>
499 </div>
500 <div class="nav-tabs-wrapper">
501 <div class="nav-tabs">
502 <?php
503 foreach( (array) $nav_menus as $_nav_menu ) :
504 if ( $nav_menu_selected_id == $_nav_menu->term_id ) : ?><span class="nav-tab nav-tab-active">
505 <?php echo esc_html( $_nav_menu->truncated_name ); ?>
506 </span><?php else : ?><a href="<?php
507 echo esc_url(add_query_arg(
508 array(
509 'action' => 'edit',
510 'menu' => $_nav_menu->term_id,
511 ),
512 admin_url( 'nav-menus.php' )
513 ));
514 ?>" class="nav-tab hide-if-no-js">
515 <?php echo esc_html( $_nav_menu->truncated_name ); ?>
516 </a><?php endif;
517 endforeach;
518 if ( 0 == $nav_menu_selected_id ) : ?><span class="nav-tab menu-add-new nav-tab-active">
519 <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?>
520 </span><?php else : ?><a href="<?php
521 echo esc_url(add_query_arg(
522 array(
523 'action' => 'edit',
524 'menu' => 0,
525 ),
526 admin_url( 'nav-menus.php' )
527 ));
528 ?>" class="nav-tab menu-add-new">
529 <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?>
530 </a><?php endif; ?>
531 </div>
532 </div>
533 <div class="menu-edit">
534 <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
535 <div id="nav-menu-header">
536 <div id="submitpost" class="submitbox">
537 <div class="major-publishing-actions">
538 <label class="menu-name-label howto open-label" for="menu-name">
539 <span><?php _e('Menu Name'); ?></span>
540 <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
541 </label>
542 <?php if ( !empty( $nav_menu_selected_id ) ) :
543 if ( ! isset( $auto_add ) ) {
544 $auto_add = get_option( 'nav_menu_options' );
545 if ( ! isset( $auto_add['auto_add'] ) )
546 $auto_add = false;
547 elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) )
548 $auto_add = true;
549 else
550 $auto_add = false;
551 }
552 ?>
553 <div class="auto-add-pages">
554 <label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
555 </div>
556 <?php endif; ?>
557 <br class="clear" />
558 <div class="publishing-action">
559 <input class="button-primary menu-save" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" />
560 </div><!-- END .publishing-action -->
561
562 <?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
563 <div class="delete-action">
564 <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( admin_url('nav-menus.php?action=delete&menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ) ); ?>"><?php _e('Delete Menu'); ?></a>
565 </div><!-- END .delete-action -->
566 <?php endif; ?>
567 </div><!-- END .major-publishing-actions -->
568 </div><!-- END #submitpost .submitbox -->
569 <?php
570 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
571 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
572 wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );
573 ?>
574 <input type="hidden" name="action" value="update" />
575 <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
576 </div><!-- END #nav-menu-header -->
577 <div id="post-body">
578 <div id="post-body-content">
579 <?php
580 if ( isset( $edit_markup ) ) {
581 if ( ! is_wp_error( $edit_markup ) )
582 echo $edit_markup;//Cross Site Scripting
583 } else if ( empty( $nav_menu_selected_id ) ) {
584 echo '<div class="post-body-plain">';
585 echo '<p>' . __('To create a custom menu, give it a name above and click Create Menu. Then choose items like pages, categories or custom links from the left column to add to this menu.') . '</p>';
586 echo '<p>' . __('After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.') . '</p>';
587 echo '<p>' . __('When you have finished building your custom menu, make sure you click the Save Menu button.') . '</p>';
588 echo '</div>';
589 }
590 ?>
591 </div><!-- /#post-body-content -->
592 </div><!-- /#post-body -->
593 </form><!-- /#update-nav-menu -->
594 </div><!-- /.menu-edit -->
595 </div><!-- /#menu-management -->
596 </div><!-- /#menu-management-liquid -->
597 </div><!-- /#nav-menus-frame -->
598</div><!-- /.wrap-->
599
600
601<?php include( 'admin-footer.php' ); ?>
602
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php