Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-admin/includes
File: template.php
function wp_import_upload_form( $action ) {
[1000] Fix | Delete
[1001] Fix | Delete
/**
[1002] Fix | Delete
* Filters the maximum allowed upload size for import files.
[1003] Fix | Delete
*
[1004] Fix | Delete
* @since 2.3.0
[1005] Fix | Delete
*
[1006] Fix | Delete
* @see wp_max_upload_size()
[1007] Fix | Delete
*
[1008] Fix | Delete
* @param int $max_upload_size Allowed upload size. Default 1 MB.
[1009] Fix | Delete
*/
[1010] Fix | Delete
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
[1011] Fix | Delete
$size = size_format( $bytes );
[1012] Fix | Delete
$upload_dir = wp_upload_dir();
[1013] Fix | Delete
if ( ! empty( $upload_dir['error'] ) ) :
[1014] Fix | Delete
$upload_directory_error = '<p>' . __( 'Before you can upload your import file, you will need to fix the following error:' ) . '</p>';
[1015] Fix | Delete
$upload_directory_error .= '<p><strong>' . $upload_dir['error'] . '</strong></p>';
[1016] Fix | Delete
wp_admin_notice(
[1017] Fix | Delete
$upload_directory_error,
[1018] Fix | Delete
array(
[1019] Fix | Delete
'additional_classes' => array( 'error' ),
[1020] Fix | Delete
'paragraph_wrap' => false,
[1021] Fix | Delete
)
[1022] Fix | Delete
);
[1023] Fix | Delete
else :
[1024] Fix | Delete
?>
[1025] Fix | Delete
<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
[1026] Fix | Delete
<p>
[1027] Fix | Delete
<?php
[1028] Fix | Delete
printf(
[1029] Fix | Delete
'<label for="upload">%s</label> (%s)',
[1030] Fix | Delete
__( 'Choose a file from your computer:' ),
[1031] Fix | Delete
/* translators: %s: Maximum allowed file size. */
[1032] Fix | Delete
sprintf( __( 'Maximum size: %s' ), $size )
[1033] Fix | Delete
);
[1034] Fix | Delete
?>
[1035] Fix | Delete
<input type="file" id="upload" name="import" size="25" />
[1036] Fix | Delete
<input type="hidden" name="action" value="save" />
[1037] Fix | Delete
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
[1038] Fix | Delete
</p>
[1039] Fix | Delete
<?php submit_button( __( 'Upload file and import' ), 'primary' ); ?>
[1040] Fix | Delete
</form>
[1041] Fix | Delete
<?php
[1042] Fix | Delete
endif;
[1043] Fix | Delete
}
[1044] Fix | Delete
[1045] Fix | Delete
/**
[1046] Fix | Delete
* Adds a meta box to one or more screens.
[1047] Fix | Delete
*
[1048] Fix | Delete
* @since 2.5.0
[1049] Fix | Delete
* @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
[1050] Fix | Delete
*
[1051] Fix | Delete
* @global array $wp_meta_boxes Global meta box state.
[1052] Fix | Delete
*
[1053] Fix | Delete
* @param string $id Meta box ID (used in the 'id' attribute for the meta box).
[1054] Fix | Delete
* @param string $title Title of the meta box.
[1055] Fix | Delete
* @param callable $callback Function that fills the box with the desired content.
[1056] Fix | Delete
* The function should echo its output.
[1057] Fix | Delete
* @param string|array|WP_Screen $screen Optional. The screen or screens on which to show the box
[1058] Fix | Delete
* (such as a post type, 'link', or 'comment'). Accepts a single
[1059] Fix | Delete
* screen ID, WP_Screen object, or array of screen IDs. Default
[1060] Fix | Delete
* is the current screen. If you have used add_menu_page() or
[1061] Fix | Delete
* add_submenu_page() to create a new screen (and hence screen_id),
[1062] Fix | Delete
* make sure your menu slug conforms to the limits of sanitize_key()
[1063] Fix | Delete
* otherwise the 'screen' menu may not correctly render on your page.
[1064] Fix | Delete
* @param string $context Optional. The context within the screen where the box
[1065] Fix | Delete
* should display. Available contexts vary from screen to
[1066] Fix | Delete
* screen. Post edit screen contexts include 'normal', 'side',
[1067] Fix | Delete
* and 'advanced'. Comments screen contexts include 'normal'
[1068] Fix | Delete
* and 'side'. Menus meta boxes (accordion sections) all use
[1069] Fix | Delete
* the 'side' context. Global default is 'advanced'.
[1070] Fix | Delete
* @param string $priority Optional. The priority within the context where the box should show.
[1071] Fix | Delete
* Accepts 'high', 'core', 'default', or 'low'. Default 'default'.
[1072] Fix | Delete
* @param array $callback_args Optional. Data that should be set as the $args property
[1073] Fix | Delete
* of the box array (which is the second parameter passed
[1074] Fix | Delete
* to your callback). Default null.
[1075] Fix | Delete
*/
[1076] Fix | Delete
function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
[1077] Fix | Delete
global $wp_meta_boxes;
[1078] Fix | Delete
[1079] Fix | Delete
if ( empty( $screen ) ) {
[1080] Fix | Delete
$screen = get_current_screen();
[1081] Fix | Delete
} elseif ( is_string( $screen ) ) {
[1082] Fix | Delete
$screen = convert_to_screen( $screen );
[1083] Fix | Delete
} elseif ( is_array( $screen ) ) {
[1084] Fix | Delete
foreach ( $screen as $single_screen ) {
[1085] Fix | Delete
add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args );
[1086] Fix | Delete
}
[1087] Fix | Delete
}
[1088] Fix | Delete
[1089] Fix | Delete
if ( ! isset( $screen->id ) ) {
[1090] Fix | Delete
return;
[1091] Fix | Delete
}
[1092] Fix | Delete
[1093] Fix | Delete
$page = $screen->id;
[1094] Fix | Delete
[1095] Fix | Delete
if ( ! isset( $wp_meta_boxes ) ) {
[1096] Fix | Delete
$wp_meta_boxes = array();
[1097] Fix | Delete
}
[1098] Fix | Delete
if ( ! isset( $wp_meta_boxes[ $page ] ) ) {
[1099] Fix | Delete
$wp_meta_boxes[ $page ] = array();
[1100] Fix | Delete
}
[1101] Fix | Delete
if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
[1102] Fix | Delete
$wp_meta_boxes[ $page ][ $context ] = array();
[1103] Fix | Delete
}
[1104] Fix | Delete
[1105] Fix | Delete
foreach ( array_keys( $wp_meta_boxes[ $page ] ) as $a_context ) {
[1106] Fix | Delete
foreach ( array( 'high', 'core', 'default', 'low' ) as $a_priority ) {
[1107] Fix | Delete
if ( ! isset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) ) {
[1108] Fix | Delete
continue;
[1109] Fix | Delete
}
[1110] Fix | Delete
[1111] Fix | Delete
// If a core box was previously removed, don't add.
[1112] Fix | Delete
if ( ( 'core' === $priority || 'sorted' === $priority )
[1113] Fix | Delete
&& false === $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]
[1114] Fix | Delete
) {
[1115] Fix | Delete
return;
[1116] Fix | Delete
}
[1117] Fix | Delete
[1118] Fix | Delete
// If a core box was previously added by a plugin, don't add.
[1119] Fix | Delete
if ( 'core' === $priority ) {
[1120] Fix | Delete
/*
[1121] Fix | Delete
* If the box was added with default priority, give it core priority
[1122] Fix | Delete
* to maintain sort order.
[1123] Fix | Delete
*/
[1124] Fix | Delete
if ( 'default' === $a_priority ) {
[1125] Fix | Delete
$wp_meta_boxes[ $page ][ $a_context ]['core'][ $id ] = $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ];
[1126] Fix | Delete
unset( $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ] );
[1127] Fix | Delete
}
[1128] Fix | Delete
return;
[1129] Fix | Delete
}
[1130] Fix | Delete
[1131] Fix | Delete
// If no priority given and ID already present, use existing priority.
[1132] Fix | Delete
if ( empty( $priority ) ) {
[1133] Fix | Delete
$priority = $a_priority;
[1134] Fix | Delete
/*
[1135] Fix | Delete
* Else, if we're adding to the sorted priority, we don't know the title
[1136] Fix | Delete
* or callback. Grab them from the previously added context/priority.
[1137] Fix | Delete
*/
[1138] Fix | Delete
} elseif ( 'sorted' === $priority ) {
[1139] Fix | Delete
$title = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['title'];
[1140] Fix | Delete
$callback = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['callback'];
[1141] Fix | Delete
$callback_args = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['args'];
[1142] Fix | Delete
}
[1143] Fix | Delete
[1144] Fix | Delete
// An ID can be in only one priority and one context.
[1145] Fix | Delete
if ( $priority !== $a_priority || $context !== $a_context ) {
[1146] Fix | Delete
unset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] );
[1147] Fix | Delete
}
[1148] Fix | Delete
}
[1149] Fix | Delete
}
[1150] Fix | Delete
[1151] Fix | Delete
if ( empty( $priority ) ) {
[1152] Fix | Delete
$priority = 'low';
[1153] Fix | Delete
}
[1154] Fix | Delete
[1155] Fix | Delete
if ( ! isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
[1156] Fix | Delete
$wp_meta_boxes[ $page ][ $context ][ $priority ] = array();
[1157] Fix | Delete
}
[1158] Fix | Delete
[1159] Fix | Delete
$wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = array(
[1160] Fix | Delete
'id' => $id,
[1161] Fix | Delete
'title' => $title,
[1162] Fix | Delete
'callback' => $callback,
[1163] Fix | Delete
'args' => $callback_args,
[1164] Fix | Delete
);
[1165] Fix | Delete
}
[1166] Fix | Delete
[1167] Fix | Delete
[1168] Fix | Delete
/**
[1169] Fix | Delete
* Renders a "fake" meta box with an information message,
[1170] Fix | Delete
* shown on the block editor, when an incompatible meta box is found.
[1171] Fix | Delete
*
[1172] Fix | Delete
* @since 5.0.0
[1173] Fix | Delete
*
[1174] Fix | Delete
* @param mixed $data_object The data object being rendered on this screen.
[1175] Fix | Delete
* @param array $box {
[1176] Fix | Delete
* Custom formats meta box arguments.
[1177] Fix | Delete
*
[1178] Fix | Delete
* @type string $id Meta box 'id' attribute.
[1179] Fix | Delete
* @type string $title Meta box title.
[1180] Fix | Delete
* @type callable $old_callback The original callback for this meta box.
[1181] Fix | Delete
* @type array $args Extra meta box arguments.
[1182] Fix | Delete
* }
[1183] Fix | Delete
*/
[1184] Fix | Delete
function do_block_editor_incompatible_meta_box( $data_object, $box ) {
[1185] Fix | Delete
$plugin = _get_plugin_from_callback( $box['old_callback'] );
[1186] Fix | Delete
$plugins = get_plugins();
[1187] Fix | Delete
echo '<p>';
[1188] Fix | Delete
if ( $plugin ) {
[1189] Fix | Delete
/* translators: %s: The name of the plugin that generated this meta box. */
[1190] Fix | Delete
printf( __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ), "<strong>{$plugin['Name']}</strong>" );
[1191] Fix | Delete
} else {
[1192] Fix | Delete
_e( 'This meta box is not compatible with the block editor.' );
[1193] Fix | Delete
}
[1194] Fix | Delete
echo '</p>';
[1195] Fix | Delete
[1196] Fix | Delete
if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {
[1197] Fix | Delete
if ( current_user_can( 'install_plugins' ) ) {
[1198] Fix | Delete
$install_url = wp_nonce_url(
[1199] Fix | Delete
self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ),
[1200] Fix | Delete
'save_wporg_username_' . get_current_user_id()
[1201] Fix | Delete
);
[1202] Fix | Delete
[1203] Fix | Delete
echo '<p>';
[1204] Fix | Delete
/* translators: %s: A link to install the Classic Editor plugin. */
[1205] Fix | Delete
printf( __( 'Please install the <a href="%s">Classic Editor plugin</a> to use this meta box.' ), esc_url( $install_url ) );
[1206] Fix | Delete
echo '</p>';
[1207] Fix | Delete
}
[1208] Fix | Delete
} elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {
[1209] Fix | Delete
if ( current_user_can( 'activate_plugins' ) ) {
[1210] Fix | Delete
$activate_url = wp_nonce_url(
[1211] Fix | Delete
self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php' ),
[1212] Fix | Delete
'activate-plugin_classic-editor/classic-editor.php'
[1213] Fix | Delete
);
[1214] Fix | Delete
[1215] Fix | Delete
echo '<p>';
[1216] Fix | Delete
/* translators: %s: A link to activate the Classic Editor plugin. */
[1217] Fix | Delete
printf( __( 'Please activate the <a href="%s">Classic Editor plugin</a> to use this meta box.' ), esc_url( $activate_url ) );
[1218] Fix | Delete
echo '</p>';
[1219] Fix | Delete
}
[1220] Fix | Delete
} elseif ( $data_object instanceof WP_Post ) {
[1221] Fix | Delete
$edit_url = add_query_arg(
[1222] Fix | Delete
array(
[1223] Fix | Delete
'classic-editor' => '',
[1224] Fix | Delete
'classic-editor__forget' => '',
[1225] Fix | Delete
),
[1226] Fix | Delete
get_edit_post_link( $data_object )
[1227] Fix | Delete
);
[1228] Fix | Delete
echo '<p>';
[1229] Fix | Delete
/* translators: %s: A link to use the Classic Editor plugin. */
[1230] Fix | Delete
printf( __( 'Please open the <a href="%s">classic editor</a> to use this meta box.' ), esc_url( $edit_url ) );
[1231] Fix | Delete
echo '</p>';
[1232] Fix | Delete
}
[1233] Fix | Delete
}
[1234] Fix | Delete
[1235] Fix | Delete
/**
[1236] Fix | Delete
* Internal helper function to find the plugin from a meta box callback.
[1237] Fix | Delete
*
[1238] Fix | Delete
* @since 5.0.0
[1239] Fix | Delete
*
[1240] Fix | Delete
* @access private
[1241] Fix | Delete
*
[1242] Fix | Delete
* @param callable $callback The callback function to check.
[1243] Fix | Delete
* @return array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin.
[1244] Fix | Delete
*/
[1245] Fix | Delete
function _get_plugin_from_callback( $callback ) {
[1246] Fix | Delete
try {
[1247] Fix | Delete
if ( is_array( $callback ) ) {
[1248] Fix | Delete
$reflection = new ReflectionMethod( $callback[0], $callback[1] );
[1249] Fix | Delete
} elseif ( is_string( $callback ) && str_contains( $callback, '::' ) ) {
[1250] Fix | Delete
$reflection = new ReflectionMethod( $callback );
[1251] Fix | Delete
} else {
[1252] Fix | Delete
$reflection = new ReflectionFunction( $callback );
[1253] Fix | Delete
}
[1254] Fix | Delete
} catch ( ReflectionException $exception ) {
[1255] Fix | Delete
// We could not properly reflect on the callable, so we abort here.
[1256] Fix | Delete
return null;
[1257] Fix | Delete
}
[1258] Fix | Delete
[1259] Fix | Delete
// Don't show an error if it's an internal PHP function.
[1260] Fix | Delete
if ( ! $reflection->isInternal() ) {
[1261] Fix | Delete
[1262] Fix | Delete
// Only show errors if the meta box was registered by a plugin.
[1263] Fix | Delete
$filename = wp_normalize_path( $reflection->getFileName() );
[1264] Fix | Delete
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
[1265] Fix | Delete
[1266] Fix | Delete
if ( str_starts_with( $filename, $plugin_dir ) ) {
[1267] Fix | Delete
$filename = str_replace( $plugin_dir, '', $filename );
[1268] Fix | Delete
$filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename );
[1269] Fix | Delete
[1270] Fix | Delete
$plugins = get_plugins();
[1271] Fix | Delete
[1272] Fix | Delete
foreach ( $plugins as $name => $plugin ) {
[1273] Fix | Delete
if ( str_starts_with( $name, $filename ) ) {
[1274] Fix | Delete
return $plugin;
[1275] Fix | Delete
}
[1276] Fix | Delete
}
[1277] Fix | Delete
}
[1278] Fix | Delete
}
[1279] Fix | Delete
[1280] Fix | Delete
return null;
[1281] Fix | Delete
}
[1282] Fix | Delete
[1283] Fix | Delete
/**
[1284] Fix | Delete
* Meta-Box template function.
[1285] Fix | Delete
*
[1286] Fix | Delete
* @since 2.5.0
[1287] Fix | Delete
*
[1288] Fix | Delete
* @global array $wp_meta_boxes Global meta box state.
[1289] Fix | Delete
*
[1290] Fix | Delete
* @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or
[1291] Fix | Delete
* add_submenu_page() to create a new screen (and hence screen_id)
[1292] Fix | Delete
* make sure your menu slug conforms to the limits of sanitize_key()
[1293] Fix | Delete
* otherwise the 'screen' menu may not correctly render on your page.
[1294] Fix | Delete
* @param string $context The screen context for which to display meta boxes.
[1295] Fix | Delete
* @param mixed $data_object Gets passed to the meta box callback function as the first parameter.
[1296] Fix | Delete
* Often this is the object that's the focus of the current screen,
[1297] Fix | Delete
* for example a `WP_Post` or `WP_Comment` object.
[1298] Fix | Delete
* @return int Number of meta_boxes.
[1299] Fix | Delete
*/
[1300] Fix | Delete
function do_meta_boxes( $screen, $context, $data_object ) {
[1301] Fix | Delete
global $wp_meta_boxes;
[1302] Fix | Delete
static $already_sorted = false;
[1303] Fix | Delete
[1304] Fix | Delete
if ( empty( $screen ) ) {
[1305] Fix | Delete
$screen = get_current_screen();
[1306] Fix | Delete
} elseif ( is_string( $screen ) ) {
[1307] Fix | Delete
$screen = convert_to_screen( $screen );
[1308] Fix | Delete
}
[1309] Fix | Delete
[1310] Fix | Delete
$page = $screen->id;
[1311] Fix | Delete
[1312] Fix | Delete
$hidden = get_hidden_meta_boxes( $screen );
[1313] Fix | Delete
[1314] Fix | Delete
printf( '<div id="%s-sortables" class="meta-box-sortables">', esc_attr( $context ) );
[1315] Fix | Delete
[1316] Fix | Delete
/*
[1317] Fix | Delete
* Grab the ones the user has manually sorted.
[1318] Fix | Delete
* Pull them out of their previous context/priority and into the one the user chose.
[1319] Fix | Delete
*/
[1320] Fix | Delete
$sorted = get_user_option( "meta-box-order_$page" );
[1321] Fix | Delete
[1322] Fix | Delete
if ( ! $already_sorted && $sorted ) {
[1323] Fix | Delete
foreach ( $sorted as $box_context => $ids ) {
[1324] Fix | Delete
foreach ( explode( ',', $ids ) as $id ) {
[1325] Fix | Delete
if ( $id && 'dashboard_browser_nag' !== $id ) {
[1326] Fix | Delete
add_meta_box( $id, null, null, $screen, $box_context, 'sorted' );
[1327] Fix | Delete
}
[1328] Fix | Delete
}
[1329] Fix | Delete
}
[1330] Fix | Delete
}
[1331] Fix | Delete
[1332] Fix | Delete
$already_sorted = true;
[1333] Fix | Delete
[1334] Fix | Delete
$i = 0;
[1335] Fix | Delete
[1336] Fix | Delete
if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
[1337] Fix | Delete
foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {
[1338] Fix | Delete
if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
[1339] Fix | Delete
foreach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
[1340] Fix | Delete
if ( false === $box || ! $box['title'] ) {
[1341] Fix | Delete
continue;
[1342] Fix | Delete
}
[1343] Fix | Delete
[1344] Fix | Delete
$block_compatible = true;
[1345] Fix | Delete
if ( is_array( $box['args'] ) ) {
[1346] Fix | Delete
// If a meta box is just here for back compat, don't show it in the block editor.
[1347] Fix | Delete
if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) {
[1348] Fix | Delete
continue;
[1349] Fix | Delete
}
[1350] Fix | Delete
[1351] Fix | Delete
if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) {
[1352] Fix | Delete
$block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box'];
[1353] Fix | Delete
unset( $box['args']['__block_editor_compatible_meta_box'] );
[1354] Fix | Delete
}
[1355] Fix | Delete
[1356] Fix | Delete
// If the meta box is declared as incompatible with the block editor, override the callback function.
[1357] Fix | Delete
if ( ! $block_compatible && $screen->is_block_editor() ) {
[1358] Fix | Delete
$box['old_callback'] = $box['callback'];
[1359] Fix | Delete
$box['callback'] = 'do_block_editor_incompatible_meta_box';
[1360] Fix | Delete
}
[1361] Fix | Delete
[1362] Fix | Delete
if ( isset( $box['args']['__back_compat_meta_box'] ) ) {
[1363] Fix | Delete
$block_compatible = $block_compatible || (bool) $box['args']['__back_compat_meta_box'];
[1364] Fix | Delete
unset( $box['args']['__back_compat_meta_box'] );
[1365] Fix | Delete
}
[1366] Fix | Delete
}
[1367] Fix | Delete
[1368] Fix | Delete
++$i;
[1369] Fix | Delete
// get_hidden_meta_boxes() doesn't apply in the block editor.
[1370] Fix | Delete
$hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden, true ) ) ? ' hide-if-js' : '';
[1371] Fix | Delete
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes( $box['id'], $page ) . $hidden_class . '" ' . '>' . "\n";
[1372] Fix | Delete
[1373] Fix | Delete
echo '<div class="postbox-header">';
[1374] Fix | Delete
echo '<h2 class="hndle">';
[1375] Fix | Delete
if ( 'dashboard_php_nag' === $box['id'] ) {
[1376] Fix | Delete
echo '<span aria-hidden="true" class="dashicons dashicons-warning"></span>';
[1377] Fix | Delete
echo '<span class="screen-reader-text">' .
[1378] Fix | Delete
/* translators: Hidden accessibility text. */
[1379] Fix | Delete
__( 'Warning:' ) .
[1380] Fix | Delete
' </span>';
[1381] Fix | Delete
}
[1382] Fix | Delete
echo $box['title'];
[1383] Fix | Delete
echo "</h2>\n";
[1384] Fix | Delete
[1385] Fix | Delete
if ( 'dashboard_browser_nag' !== $box['id'] ) {
[1386] Fix | Delete
$widget_title = $box['title'];
[1387] Fix | Delete
[1388] Fix | Delete
if ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) {
[1389] Fix | Delete
$widget_title = $box['args']['__widget_basename'];
[1390] Fix | Delete
// Do not pass this parameter to the user callback function.
[1391] Fix | Delete
unset( $box['args']['__widget_basename'] );
[1392] Fix | Delete
}
[1393] Fix | Delete
[1394] Fix | Delete
echo '<div class="handle-actions hide-if-no-js">';
[1395] Fix | Delete
[1396] Fix | Delete
echo '<button type="button" class="handle-order-higher" aria-disabled="false" aria-describedby="' . $box['id'] . '-handle-order-higher-description">';
[1397] Fix | Delete
echo '<span class="screen-reader-text">' .
[1398] Fix | Delete
/* translators: Hidden accessibility text. */
[1399] Fix | Delete
__( 'Move up' ) .
[1400] Fix | Delete
'</span>';
[1401] Fix | Delete
echo '<span class="order-higher-indicator" aria-hidden="true"></span>';
[1402] Fix | Delete
echo '</button>';
[1403] Fix | Delete
echo '<span class="hidden" id="' . $box['id'] . '-handle-order-higher-description">' . sprintf(
[1404] Fix | Delete
/* translators: %s: Meta box title. */
[1405] Fix | Delete
__( 'Move %s box up' ),
[1406] Fix | Delete
$widget_title
[1407] Fix | Delete
) . '</span>';
[1408] Fix | Delete
[1409] Fix | Delete
echo '<button type="button" class="handle-order-lower" aria-disabled="false" aria-describedby="' . $box['id'] . '-handle-order-lower-description">';
[1410] Fix | Delete
echo '<span class="screen-reader-text">' .
[1411] Fix | Delete
/* translators: Hidden accessibility text. */
[1412] Fix | Delete
__( 'Move down' ) .
[1413] Fix | Delete
'</span>';
[1414] Fix | Delete
echo '<span class="order-lower-indicator" aria-hidden="true"></span>';
[1415] Fix | Delete
echo '</button>';
[1416] Fix | Delete
echo '<span class="hidden" id="' . $box['id'] . '-handle-order-lower-description">' . sprintf(
[1417] Fix | Delete
/* translators: %s: Meta box title. */
[1418] Fix | Delete
__( 'Move %s box down' ),
[1419] Fix | Delete
$widget_title
[1420] Fix | Delete
) . '</span>';
[1421] Fix | Delete
[1422] Fix | Delete
echo '<button type="button" class="handlediv" aria-expanded="true">';
[1423] Fix | Delete
echo '<span class="screen-reader-text">' . sprintf(
[1424] Fix | Delete
/* translators: %s: Hidden accessibility text. Meta box title. */
[1425] Fix | Delete
__( 'Toggle panel: %s' ),
[1426] Fix | Delete
$widget_title
[1427] Fix | Delete
) . '</span>';
[1428] Fix | Delete
echo '<span class="toggle-indicator" aria-hidden="true"></span>';
[1429] Fix | Delete
echo '</button>';
[1430] Fix | Delete
[1431] Fix | Delete
echo '</div>';
[1432] Fix | Delete
}
[1433] Fix | Delete
echo '</div>';
[1434] Fix | Delete
[1435] Fix | Delete
echo '<div class="inside">' . "\n";
[1436] Fix | Delete
[1437] Fix | Delete
if ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
[1438] Fix | Delete
$plugin = _get_plugin_from_callback( $box['callback'] );
[1439] Fix | Delete
if ( $plugin ) {
[1440] Fix | Delete
$meta_box_not_compatible_message = sprintf(
[1441] Fix | Delete
/* translators: %s: The name of the plugin that generated this meta box. */
[1442] Fix | Delete
__( 'This meta box, from the %s plugin, is not compatible with the block editor.' ),
[1443] Fix | Delete
"<strong>{$plugin['Name']}</strong>"
[1444] Fix | Delete
);
[1445] Fix | Delete
wp_admin_notice(
[1446] Fix | Delete
$meta_box_not_compatible_message,
[1447] Fix | Delete
array(
[1448] Fix | Delete
'additional_classes' => array( 'error', 'inline' ),
[1449] Fix | Delete
)
[1450] Fix | Delete
);
[1451] Fix | Delete
}
[1452] Fix | Delete
}
[1453] Fix | Delete
[1454] Fix | Delete
call_user_func( $box['callback'], $data_object, $box );
[1455] Fix | Delete
echo "</div>\n";
[1456] Fix | Delete
echo "</div>\n";
[1457] Fix | Delete
}
[1458] Fix | Delete
}
[1459] Fix | Delete
}
[1460] Fix | Delete
}
[1461] Fix | Delete
[1462] Fix | Delete
echo '</div>';
[1463] Fix | Delete
[1464] Fix | Delete
return $i;
[1465] Fix | Delete
}
[1466] Fix | Delete
[1467] Fix | Delete
/**
[1468] Fix | Delete
* Removes a meta box from one or more screens.
[1469] Fix | Delete
*
[1470] Fix | Delete
* @since 2.6.0
[1471] Fix | Delete
* @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
[1472] Fix | Delete
*
[1473] Fix | Delete
* @global array $wp_meta_boxes Global meta box state.
[1474] Fix | Delete
*
[1475] Fix | Delete
* @param string $id Meta box ID (used in the 'id' attribute for the meta box).
[1476] Fix | Delete
* @param string|array|WP_Screen $screen The screen or screens on which the meta box is shown (such as a
[1477] Fix | Delete
* post type, 'link', or 'comment'). Accepts a single screen ID,
[1478] Fix | Delete
* WP_Screen object, or array of screen IDs.
[1479] Fix | Delete
* @param string $context The context within the screen where the box is set to display.
[1480] Fix | Delete
* Contexts vary from screen to screen. Post edit screen contexts
[1481] Fix | Delete
* include 'normal', 'side', and 'advanced'. Comments screen contexts
[1482] Fix | Delete
* include 'normal' and 'side'. Menus meta boxes (accordion sections)
[1483] Fix | Delete
* all use the 'side' context.
[1484] Fix | Delete
*/
[1485] Fix | Delete
function remove_meta_box( $id, $screen, $context ) {
[1486] Fix | Delete
global $wp_meta_boxes;
[1487] Fix | Delete
[1488] Fix | Delete
if ( empty( $screen ) ) {
[1489] Fix | Delete
$screen = get_current_screen();
[1490] Fix | Delete
} elseif ( is_string( $screen ) ) {
[1491] Fix | Delete
$screen = convert_to_screen( $screen );
[1492] Fix | Delete
} elseif ( is_array( $screen ) ) {
[1493] Fix | Delete
foreach ( $screen as $single_screen ) {
[1494] Fix | Delete
remove_meta_box( $id, $single_screen, $context );
[1495] Fix | Delete
}
[1496] Fix | Delete
}
[1497] Fix | Delete
[1498] Fix | Delete
if ( ! isset( $screen->id ) ) {
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function