Edit File by line
/home/barbar84/www/wp-admin
File: edit-link-form.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Edit links form for inclusion in administration panels.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
// Don't load directly.
[8] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[9] Fix | Delete
die( '-1' );
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
if ( ! empty( $link_id ) ) {
[13] Fix | Delete
/* translators: %s: URL to Links screen. */
[14] Fix | Delete
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
[15] Fix | Delete
$submit_text = __( 'Update Link' );
[16] Fix | Delete
$form_name = 'editlink';
[17] Fix | Delete
$nonce_action = 'update-bookmark_' . $link_id;
[18] Fix | Delete
} else {
[19] Fix | Delete
/* translators: %s: URL to Links screen. */
[20] Fix | Delete
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
[21] Fix | Delete
$submit_text = __( 'Add Link' );
[22] Fix | Delete
$form_name = 'addlink';
[23] Fix | Delete
$nonce_action = 'add-bookmark';
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';
[27] Fix | Delete
[28] Fix | Delete
add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' );
[29] Fix | Delete
add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' );
[30] Fix | Delete
add_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' );
[31] Fix | Delete
add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' );
[32] Fix | Delete
add_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' );
[33] Fix | Delete
[34] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[35] Fix | Delete
do_action( 'add_meta_boxes', 'link', $link );
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Fires when link-specific meta boxes are added.
[39] Fix | Delete
*
[40] Fix | Delete
* @since 3.0.0
[41] Fix | Delete
*
[42] Fix | Delete
* @param object $link Link object.
[43] Fix | Delete
*/
[44] Fix | Delete
do_action( 'add_meta_boxes_link', $link );
[45] Fix | Delete
[46] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[47] Fix | Delete
do_action( 'do_meta_boxes', 'link', 'normal', $link );
[48] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[49] Fix | Delete
do_action( 'do_meta_boxes', 'link', 'advanced', $link );
[50] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[51] Fix | Delete
do_action( 'do_meta_boxes', 'link', 'side', $link );
[52] Fix | Delete
[53] Fix | Delete
add_screen_option(
[54] Fix | Delete
'layout_columns',
[55] Fix | Delete
array(
[56] Fix | Delete
'max' => 2,
[57] Fix | Delete
'default' => 2,
[58] Fix | Delete
)
[59] Fix | Delete
);
[60] Fix | Delete
[61] Fix | Delete
get_current_screen()->add_help_tab(
[62] Fix | Delete
array(
[63] Fix | Delete
'id' => 'overview',
[64] Fix | Delete
'title' => __( 'Overview' ),
[65] Fix | Delete
'content' =>
[66] Fix | Delete
'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link&#8217;s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
[67] Fix | Delete
'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don&#8217;t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
[68] Fix | Delete
'<p>' . __( 'XFN stands for <a href="https://gmpg.org/xfn/">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>',
[69] Fix | Delete
)
[70] Fix | Delete
);
[71] Fix | Delete
[72] Fix | Delete
get_current_screen()->set_help_sidebar(
[73] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[74] Fix | Delete
'<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen">Documentation on Creating Links</a>' ) . '</p>' .
[75] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[76] Fix | Delete
);
[77] Fix | Delete
[78] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[79] Fix | Delete
?>
[80] Fix | Delete
[81] Fix | Delete
<div class="wrap">
[82] Fix | Delete
<h1 class="wp-heading-inline">
[83] Fix | Delete
<?php
[84] Fix | Delete
echo esc_html( $title );
[85] Fix | Delete
?>
[86] Fix | Delete
</h1>
[87] Fix | Delete
[88] Fix | Delete
<a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>
[89] Fix | Delete
[90] Fix | Delete
<hr class="wp-header-end">
[91] Fix | Delete
[92] Fix | Delete
<?php if ( isset( $_GET['added'] ) ) : ?>
[93] Fix | Delete
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div>
[94] Fix | Delete
<?php endif; ?>
[95] Fix | Delete
[96] Fix | Delete
<form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php">
[97] Fix | Delete
<?php
[98] Fix | Delete
if ( ! empty( $link_added ) ) {
[99] Fix | Delete
echo $link_added;
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
wp_nonce_field( $nonce_action );
[103] Fix | Delete
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
[104] Fix | Delete
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
[105] Fix | Delete
?>
[106] Fix | Delete
[107] Fix | Delete
<div id="poststuff">
[108] Fix | Delete
[109] Fix | Delete
<div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>">
[110] Fix | Delete
<div id="post-body-content">
[111] Fix | Delete
<div id="namediv" class="postbox">
[112] Fix | Delete
<h2 class="postbox-header"><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2>
[113] Fix | Delete
<div class="inside">
[114] Fix | Delete
<input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" />
[115] Fix | Delete
<p><?php _e( 'Example: Nifty blogging software' ); ?></p>
[116] Fix | Delete
</div>
[117] Fix | Delete
</div>
[118] Fix | Delete
[119] Fix | Delete
<div id="addressdiv" class="postbox">
[120] Fix | Delete
<h2 class="postbox-header"><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2>
[121] Fix | Delete
<div class="inside">
[122] Fix | Delete
<input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url ); ?>" id="link_url" />
[123] Fix | Delete
<p><?php _e( 'Example: <code>https://wordpress.org/</code> &#8212; don&#8217;t forget the <code>https://</code>' ); ?></p>
[124] Fix | Delete
</div>
[125] Fix | Delete
</div>
[126] Fix | Delete
[127] Fix | Delete
<div id="descriptiondiv" class="postbox">
[128] Fix | Delete
<h2 class="postbox-header"><label for="link_description"><?php _e( 'Description' ); ?></label></h2>
[129] Fix | Delete
<div class="inside">
[130] Fix | Delete
<input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset( $link->link_description ) ? esc_attr( $link->link_description ) : ''; ?>" id="link_description" />
[131] Fix | Delete
<p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.' ); ?></p>
[132] Fix | Delete
</div>
[133] Fix | Delete
</div>
[134] Fix | Delete
</div><!-- /post-body-content -->
[135] Fix | Delete
[136] Fix | Delete
<div id="postbox-container-1" class="postbox-container">
[137] Fix | Delete
<?php
[138] Fix | Delete
[139] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[140] Fix | Delete
do_action( 'submitlink_box' );
[141] Fix | Delete
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
[142] Fix | Delete
[143] Fix | Delete
?>
[144] Fix | Delete
</div>
[145] Fix | Delete
<div id="postbox-container-2" class="postbox-container">
[146] Fix | Delete
<?php
[147] Fix | Delete
[148] Fix | Delete
do_meta_boxes( null, 'normal', $link );
[149] Fix | Delete
[150] Fix | Delete
do_meta_boxes( null, 'advanced', $link );
[151] Fix | Delete
[152] Fix | Delete
?>
[153] Fix | Delete
</div>
[154] Fix | Delete
<?php
[155] Fix | Delete
[156] Fix | Delete
if ( $link_id ) :
[157] Fix | Delete
?>
[158] Fix | Delete
<input type="hidden" name="action" value="save" />
[159] Fix | Delete
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
[160] Fix | Delete
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id; ?>" />
[161] Fix | Delete
<?php else : ?>
[162] Fix | Delete
<input type="hidden" name="action" value="add" />
[163] Fix | Delete
<?php endif; ?>
[164] Fix | Delete
[165] Fix | Delete
</div>
[166] Fix | Delete
</div>
[167] Fix | Delete
[168] Fix | Delete
</form>
[169] Fix | Delete
</div>
[170] Fix | Delete
[171] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function