Edit File by line
/home/barbar84/public_h.../wp-admin
File: link-manager.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Link Management Administration Screen.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/** Load WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
if ( ! current_user_can( 'manage_links' ) ) {
[10] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Links_List_Table' );
[14] Fix | Delete
[15] Fix | Delete
// Handle bulk deletes.
[16] Fix | Delete
$doaction = $wp_list_table->current_action();
[17] Fix | Delete
[18] Fix | Delete
if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
[19] Fix | Delete
check_admin_referer( 'bulk-bookmarks' );
[20] Fix | Delete
[21] Fix | Delete
$redirect_to = admin_url( 'link-manager.php' );
[22] Fix | Delete
$bulklinks = (array) $_REQUEST['linkcheck'];
[23] Fix | Delete
[24] Fix | Delete
if ( 'delete' === $doaction ) {
[25] Fix | Delete
foreach ( $bulklinks as $link_id ) {
[26] Fix | Delete
$link_id = (int) $link_id;
[27] Fix | Delete
[28] Fix | Delete
wp_delete_link( $link_id );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
$redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to );
[32] Fix | Delete
} else {
[33] Fix | Delete
$screen = get_current_screen()->id;
[34] Fix | Delete
[35] Fix | Delete
/** This action is documented in wp-admin/edit.php */
[36] Fix | Delete
$redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[37] Fix | Delete
}
[38] Fix | Delete
wp_redirect( $redirect_to );
[39] Fix | Delete
exit;
[40] Fix | Delete
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
[41] Fix | Delete
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
[42] Fix | Delete
exit;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
$wp_list_table->prepare_items();
[46] Fix | Delete
[47] Fix | Delete
$title = __( 'Links' );
[48] Fix | Delete
$this_file = 'link-manager.php';
[49] Fix | Delete
$parent_file = $this_file;
[50] Fix | Delete
[51] Fix | Delete
get_current_screen()->add_help_tab(
[52] Fix | Delete
array(
[53] Fix | Delete
'id' => 'overview',
[54] Fix | Delete
'title' => __( 'Overview' ),
[55] Fix | Delete
'content' =>
[56] Fix | Delete
'<p>' . sprintf(
[57] Fix | Delete
/* translators: %s: URL to Widgets screen. */
[58] Fix | Delete
__( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ),
[59] Fix | Delete
'widgets.php'
[60] Fix | Delete
) . '</p>' .
[61] Fix | Delete
'<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' .
[62] Fix | Delete
'<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>',
[63] Fix | Delete
)
[64] Fix | Delete
);
[65] Fix | Delete
get_current_screen()->add_help_tab(
[66] Fix | Delete
array(
[67] Fix | Delete
'id' => 'deleting-links',
[68] Fix | Delete
'title' => __( 'Deleting Links' ),
[69] Fix | Delete
'content' =>
[70] Fix | Delete
'<p>' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '</p>',
[71] Fix | Delete
)
[72] Fix | Delete
);
[73] Fix | Delete
[74] Fix | Delete
get_current_screen()->set_help_sidebar(
[75] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[76] Fix | Delete
'<p>' . __( '<a href="https://codex.wordpress.org/Links_Screen">Documentation on Managing Links</a>' ) . '</p>' .
[77] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[78] Fix | Delete
);
[79] Fix | Delete
[80] Fix | Delete
get_current_screen()->set_screen_reader_content(
[81] Fix | Delete
array(
[82] Fix | Delete
'heading_list' => __( 'Links list' ),
[83] Fix | Delete
)
[84] Fix | Delete
);
[85] Fix | Delete
[86] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[87] Fix | Delete
[88] Fix | Delete
if ( ! current_user_can( 'manage_links' ) ) {
[89] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
?>
[93] Fix | Delete
[94] Fix | Delete
<div class="wrap nosubsub">
[95] Fix | Delete
<h1 class="wp-heading-inline">
[96] Fix | Delete
<?php
[97] Fix | Delete
echo esc_html( $title );
[98] Fix | Delete
?>
[99] Fix | Delete
</h1>
[100] Fix | Delete
[101] Fix | Delete
<a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>
[102] Fix | Delete
[103] Fix | Delete
<?php
[104] Fix | Delete
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
[105] Fix | Delete
echo '<span class="subtitle">';
[106] Fix | Delete
printf(
[107] Fix | Delete
/* translators: %s: Search query. */
[108] Fix | Delete
__( 'Search results for: %s' ),
[109] Fix | Delete
'<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>'
[110] Fix | Delete
);
[111] Fix | Delete
echo '</span>';
[112] Fix | Delete
}
[113] Fix | Delete
?>
[114] Fix | Delete
[115] Fix | Delete
<hr class="wp-header-end">
[116] Fix | Delete
[117] Fix | Delete
<?php
[118] Fix | Delete
if ( isset( $_REQUEST['deleted'] ) ) {
[119] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>';
[120] Fix | Delete
$deleted = (int) $_REQUEST['deleted'];
[121] Fix | Delete
/* translators: %s: Number of links. */
[122] Fix | Delete
printf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted );
[123] Fix | Delete
echo '</p></div>';
[124] Fix | Delete
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
[125] Fix | Delete
}
[126] Fix | Delete
?>
[127] Fix | Delete
[128] Fix | Delete
<form id="posts-filter" method="get">
[129] Fix | Delete
[130] Fix | Delete
<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>
[131] Fix | Delete
[132] Fix | Delete
<?php $wp_list_table->display(); ?>
[133] Fix | Delete
[134] Fix | Delete
<div id="ajax-response"></div>
[135] Fix | Delete
</form>
[136] Fix | Delete
[137] Fix | Delete
</div>
[138] Fix | Delete
[139] Fix | Delete
<?php
[140] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[141] Fix | Delete
[142] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function