2003-12-23 16:47:03 -05:00
|
|
|
<?php
|
2008-08-14 02:30:38 -04:00
|
|
|
/**
|
2011-04-28 11:24:49 -04:00
|
|
|
* Add Link Administration Screen.
|
2008-08-14 02:30:38 -04:00
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Administration
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Load WordPress Administration Bootstrap */
|
2020-02-06 01:33:11 -05:00
|
|
|
require_once __DIR__ . '/admin.php';
|
2003-12-23 16:47:03 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( ! current_user_can( 'manage_links' ) ) {
|
|
|
|
wp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );
|
|
|
|
}
|
2009-08-01 22:23:54 -04:00
|
|
|
|
2021-07-22 09:53:00 -04:00
|
|
|
// Used in the HTML title tag.
|
2017-11-30 18:11:00 -05:00
|
|
|
$title = __( 'Add New Link' );
|
2008-09-25 15:33:53 -04:00
|
|
|
$parent_file = 'link-manager.php';
|
2005-01-06 04:46:52 -05:00
|
|
|
|
2024-05-01 14:01:12 -04:00
|
|
|
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
|
|
|
|
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
|
|
|
|
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
|
2004-04-28 01:34:50 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
wp_enqueue_script( 'link' );
|
|
|
|
wp_enqueue_script( 'xfn' );
|
2008-01-31 15:04:54 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( wp_is_mobile() ) {
|
2012-04-10 22:20:51 -04:00
|
|
|
wp_enqueue_script( 'jquery-touch-punch' );
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
2012-04-10 22:20:51 -04:00
|
|
|
|
2008-02-25 01:30:38 -05:00
|
|
|
$link = get_default_link_to_edit();
|
2020-02-06 01:33:11 -05:00
|
|
|
require ABSPATH . 'wp-admin/edit-link-form.php';
|
2003-12-23 16:47:03 -05:00
|
|
|
|
2020-02-06 01:33:11 -05:00
|
|
|
require_once ABSPATH . 'wp-admin/admin-footer.php';
|