1<?php
2/**
3 * Add Link Administration Screen.
4 *
5 * @package WordPress
6 * @subpackage Administration
7 */
8
9/** Load WordPress Administration Bootstrap */
10require_once __DIR__ . '/admin.php';
11
12if ( ! current_user_can( 'manage_links' ) ) {
13 wp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );
14}
15
16// Used in the HTML title tag.
17$title = __( 'Add Link' );
18$parent_file = 'link-manager.php';
19
20$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
21$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
22$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
23
24wp_enqueue_script( 'link' );
25wp_enqueue_script( 'xfn' );
26
27if ( wp_is_mobile() ) {
28 wp_enqueue_script( 'jquery-touch-punch' );
29}
30
31$link = get_default_link_to_edit();
32require ABSPATH . 'wp-admin/edit-link-form.php';
33
34require_once ABSPATH . 'wp-admin/admin-footer.php';
35