Changeset 13473 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 02/27/2010 11:06:56 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-ajax.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r13409 r13473 477 477 _wp_ajax_delete_comment_response( $comment->comment_ID ); 478 478 die( '0' ); 479 break; 480 case 'add-menu-link': 481 if ( !current_user_can( 'manage_links' ) ) 482 die('-1'); 483 484 $link_url = isset($_POST['link_url']) ? $_POST['link_url'] : false; 485 $link_name = isset($_POST['link_name']) ? $_POST['link_name'] : false; 486 487 if ( !$link_url || !$link_name ) 488 die('-1'); 489 490 $post = array( 'post_type' => 'nav_menu_item', 'post_title' => $link_name, 'ping_status' => false, 'post_excerpt' => '', 'post_content' => '' ); 491 $db_id = wp_insert_post( $post ); 492 493 update_post_meta( $db_id, 'menu_type', 'custom' ); 494 update_post_meta( $db_id, 'object_id', '' ); 495 update_post_meta( $db_id, 'menu_new_window', 0 ); 496 update_post_meta( $db_id, 'menu_link', esc_url_raw( $link_url ) ); 497 498 echo $db_id; 479 499 break; 480 500 case 'add-link-category' : // On the Fly
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)