changeset 194 | 32102edaa81b |
parent 136 | bde1974c263b |
child 204 | 09a1c134465b |
193:2f6f6f7551ca | 194:32102edaa81b |
---|---|
13 require_once ('admin.php'); |
13 require_once ('admin.php'); |
14 |
14 |
15 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); |
15 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); |
16 |
16 |
17 if ( ! current_user_can('manage_links') ) |
17 if ( ! current_user_can('manage_links') ) |
18 wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); |
18 wp_die( __('You do not have sufficient permissions to edit the links for this site.') ); |
19 |
19 |
20 if ( !empty($_POST['deletebookmarks']) ) |
20 if ( !empty($_POST['deletebookmarks']) ) |
21 $action = 'deletebookmarks'; |
21 $action = 'deletebookmarks'; |
22 if ( !empty($_POST['move']) ) |
22 if ( !empty($_POST['move']) ) |
23 $action = 'move'; |
23 $action = 'move'; |
24 if ( !empty($_POST['linkcheck']) ) |
24 if ( !empty($_POST['linkcheck']) ) |
25 $linkcheck = $_POST['linkcheck']; |
25 $linkcheck = $_POST['linkcheck']; |
26 |
26 |
27 $this_file = 'link-manager.php'; |
27 $this_file = admin_url('link-manager.php'); |
28 |
28 |
29 switch ($action) { |
29 switch ($action) { |
30 case 'deletebookmarks' : |
30 case 'deletebookmarks' : |
31 check_admin_referer('bulk-bookmarks'); |
31 check_admin_referer('bulk-bookmarks'); |
32 |
32 |
65 break; |
65 break; |
66 |
66 |
67 case 'add' : |
67 case 'add' : |
68 check_admin_referer('add-bookmark'); |
68 check_admin_referer('add-bookmark'); |
69 |
69 |
70 add_link(); |
70 $redir = wp_get_referer(); |
71 if ( add_link() ) |
|
72 $redir = add_query_arg( 'added', 'true', $redir ); |
|
71 |
73 |
72 wp_redirect( wp_get_referer() . '?added=true' ); |
74 wp_redirect( $redir ); |
73 exit; |
75 exit; |
74 break; |
76 break; |
75 |
77 |
76 case 'save' : |
78 case 'save' : |
77 $link_id = (int) $_POST['link_id']; |
79 $link_id = (int) $_POST['link_id']; |
95 |
97 |
96 case 'edit' : |
98 case 'edit' : |
97 wp_enqueue_script('link'); |
99 wp_enqueue_script('link'); |
98 wp_enqueue_script('xfn'); |
100 wp_enqueue_script('xfn'); |
99 |
101 |
102 if ( wp_is_mobile() ) |
|
103 wp_enqueue_script( 'jquery-touch-punch' ); |
|
104 |
|
100 $parent_file = 'link-manager.php'; |
105 $parent_file = 'link-manager.php'; |
101 $submenu_file = 'link-manager.php'; |
106 $submenu_file = 'link-manager.php'; |
102 $title = __('Edit Link'); |
107 $title = __('Edit Link'); |
103 |
108 |
104 $link_id = (int) $_GET['link_id']; |
109 $link_id = (int) $_GET['link_id']; |
111 break; |
116 break; |
112 |
117 |
113 default : |
118 default : |
114 break; |
119 break; |
115 } |
120 } |
116 ?> |