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: dashboard.php
*
[1000] Fix | Delete
* @param array $query_args The arguments passed to WP_Query to produce the list of posts.
[1001] Fix | Delete
*/
[1002] Fix | Delete
$query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );
[1003] Fix | Delete
[1004] Fix | Delete
$posts = new WP_Query( $query_args );
[1005] Fix | Delete
[1006] Fix | Delete
if ( $posts->have_posts() ) {
[1007] Fix | Delete
[1008] Fix | Delete
echo '<div id="' . $args['id'] . '" class="activity-block">';
[1009] Fix | Delete
[1010] Fix | Delete
echo '<h3>' . $args['title'] . '</h3>';
[1011] Fix | Delete
[1012] Fix | Delete
echo '<ul>';
[1013] Fix | Delete
[1014] Fix | Delete
$today = current_time( 'Y-m-d' );
[1015] Fix | Delete
$tomorrow = current_datetime()->modify( '+1 day' )->format( 'Y-m-d' );
[1016] Fix | Delete
$year = current_time( 'Y' );
[1017] Fix | Delete
[1018] Fix | Delete
while ( $posts->have_posts() ) {
[1019] Fix | Delete
$posts->the_post();
[1020] Fix | Delete
[1021] Fix | Delete
$time = get_the_time( 'U' );
[1022] Fix | Delete
[1023] Fix | Delete
if ( gmdate( 'Y-m-d', $time ) === $today ) {
[1024] Fix | Delete
$relative = __( 'Today' );
[1025] Fix | Delete
} elseif ( gmdate( 'Y-m-d', $time ) === $tomorrow ) {
[1026] Fix | Delete
$relative = __( 'Tomorrow' );
[1027] Fix | Delete
} elseif ( gmdate( 'Y', $time ) !== $year ) {
[1028] Fix | Delete
/* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/manual/datetime.format.php */
[1029] Fix | Delete
$relative = date_i18n( __( 'M jS Y' ), $time );
[1030] Fix | Delete
} else {
[1031] Fix | Delete
/* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/manual/datetime.format.php */
[1032] Fix | Delete
$relative = date_i18n( __( 'M jS' ), $time );
[1033] Fix | Delete
}
[1034] Fix | Delete
[1035] Fix | Delete
// Use the post edit link for those who can edit, the permalink otherwise.
[1036] Fix | Delete
$recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink();
[1037] Fix | Delete
[1038] Fix | Delete
$draft_or_post_title = _draft_or_post_title();
[1039] Fix | Delete
printf(
[1040] Fix | Delete
'<li><span>%1$s</span> <a href="%2$s" aria-label="%3$s">%4$s</a></li>',
[1041] Fix | Delete
/* translators: 1: Relative date, 2: Time. */
[1042] Fix | Delete
sprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, get_the_time() ),
[1043] Fix | Delete
$recent_post_link,
[1044] Fix | Delete
/* translators: %s: Post title. */
[1045] Fix | Delete
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $draft_or_post_title ) ),
[1046] Fix | Delete
$draft_or_post_title
[1047] Fix | Delete
);
[1048] Fix | Delete
}
[1049] Fix | Delete
[1050] Fix | Delete
echo '</ul>';
[1051] Fix | Delete
echo '</div>';
[1052] Fix | Delete
[1053] Fix | Delete
} else {
[1054] Fix | Delete
return false;
[1055] Fix | Delete
}
[1056] Fix | Delete
[1057] Fix | Delete
wp_reset_postdata();
[1058] Fix | Delete
[1059] Fix | Delete
return true;
[1060] Fix | Delete
}
[1061] Fix | Delete
[1062] Fix | Delete
/**
[1063] Fix | Delete
* Show Comments section.
[1064] Fix | Delete
*
[1065] Fix | Delete
* @since 3.8.0
[1066] Fix | Delete
*
[1067] Fix | Delete
* @param int $total_items Optional. Number of comments to query. Default 5.
[1068] Fix | Delete
* @return bool False if no comments were found. True otherwise.
[1069] Fix | Delete
*/
[1070] Fix | Delete
function wp_dashboard_recent_comments( $total_items = 5 ) {
[1071] Fix | Delete
// Select all comment types and filter out spam later for better query performance.
[1072] Fix | Delete
$comments = array();
[1073] Fix | Delete
[1074] Fix | Delete
$comments_query = array(
[1075] Fix | Delete
'number' => $total_items * 5,
[1076] Fix | Delete
'offset' => 0,
[1077] Fix | Delete
);
[1078] Fix | Delete
[1079] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[1080] Fix | Delete
$comments_query['status'] = 'approve';
[1081] Fix | Delete
}
[1082] Fix | Delete
[1083] Fix | Delete
while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
[1084] Fix | Delete
if ( ! is_array( $possible ) ) {
[1085] Fix | Delete
break;
[1086] Fix | Delete
}
[1087] Fix | Delete
[1088] Fix | Delete
foreach ( $possible as $comment ) {
[1089] Fix | Delete
if ( ! current_user_can( 'edit_post', $comment->comment_post_ID )
[1090] Fix | Delete
&& ( post_password_required( $comment->comment_post_ID )
[1091] Fix | Delete
|| ! current_user_can( 'read_post', $comment->comment_post_ID ) )
[1092] Fix | Delete
) {
[1093] Fix | Delete
// The user has no access to the post and thus cannot see the comments.
[1094] Fix | Delete
continue;
[1095] Fix | Delete
}
[1096] Fix | Delete
[1097] Fix | Delete
$comments[] = $comment;
[1098] Fix | Delete
[1099] Fix | Delete
if ( count( $comments ) === $total_items ) {
[1100] Fix | Delete
break 2;
[1101] Fix | Delete
}
[1102] Fix | Delete
}
[1103] Fix | Delete
[1104] Fix | Delete
$comments_query['offset'] += $comments_query['number'];
[1105] Fix | Delete
$comments_query['number'] = $total_items * 10;
[1106] Fix | Delete
}
[1107] Fix | Delete
[1108] Fix | Delete
if ( $comments ) {
[1109] Fix | Delete
echo '<div id="latest-comments" class="activity-block table-view-list">';
[1110] Fix | Delete
echo '<h3>' . __( 'Recent Comments' ) . '</h3>';
[1111] Fix | Delete
[1112] Fix | Delete
echo '<ul id="the-comment-list" data-wp-lists="list:comment">';
[1113] Fix | Delete
foreach ( $comments as $comment ) {
[1114] Fix | Delete
_wp_dashboard_recent_comments_row( $comment );
[1115] Fix | Delete
}
[1116] Fix | Delete
echo '</ul>';
[1117] Fix | Delete
[1118] Fix | Delete
if ( current_user_can( 'edit_posts' ) ) {
[1119] Fix | Delete
echo '<h3 class="screen-reader-text">' .
[1120] Fix | Delete
/* translators: Hidden accessibility text. */
[1121] Fix | Delete
__( 'View more comments' ) .
[1122] Fix | Delete
'</h3>';
[1123] Fix | Delete
_get_list_table( 'WP_Comments_List_Table' )->views();
[1124] Fix | Delete
}
[1125] Fix | Delete
[1126] Fix | Delete
wp_comment_reply( -1, false, 'dashboard', false );
[1127] Fix | Delete
wp_comment_trashnotice();
[1128] Fix | Delete
[1129] Fix | Delete
echo '</div>';
[1130] Fix | Delete
} else {
[1131] Fix | Delete
return false;
[1132] Fix | Delete
}
[1133] Fix | Delete
return true;
[1134] Fix | Delete
}
[1135] Fix | Delete
[1136] Fix | Delete
/**
[1137] Fix | Delete
* Display generic dashboard RSS widget feed.
[1138] Fix | Delete
*
[1139] Fix | Delete
* @since 2.5.0
[1140] Fix | Delete
*
[1141] Fix | Delete
* @param string $widget_id
[1142] Fix | Delete
*/
[1143] Fix | Delete
function wp_dashboard_rss_output( $widget_id ) {
[1144] Fix | Delete
$widgets = get_option( 'dashboard_widget_options' );
[1145] Fix | Delete
echo '<div class="rss-widget">';
[1146] Fix | Delete
wp_widget_rss_output( $widgets[ $widget_id ] );
[1147] Fix | Delete
echo '</div>';
[1148] Fix | Delete
}
[1149] Fix | Delete
[1150] Fix | Delete
/**
[1151] Fix | Delete
* Checks to see if all of the feed url in $check_urls are cached.
[1152] Fix | Delete
*
[1153] Fix | Delete
* If $check_urls is empty, look for the rss feed url found in the dashboard
[1154] Fix | Delete
* widget options of $widget_id. If cached, call $callback, a function that
[1155] Fix | Delete
* echoes out output for this widget. If not cache, echo a "Loading..." stub
[1156] Fix | Delete
* which is later replaced by Ajax call (see top of /wp-admin/index.php)
[1157] Fix | Delete
*
[1158] Fix | Delete
* @since 2.5.0
[1159] Fix | Delete
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
[1160] Fix | Delete
* by adding it to the function signature.
[1161] Fix | Delete
*
[1162] Fix | Delete
* @param string $widget_id The widget ID.
[1163] Fix | Delete
* @param callable $callback The callback function used to display each feed.
[1164] Fix | Delete
* @param array $check_urls RSS feeds.
[1165] Fix | Delete
* @param mixed ...$args Optional additional parameters to pass to the callback function.
[1166] Fix | Delete
* @return bool True on success, false on failure.
[1167] Fix | Delete
*/
[1168] Fix | Delete
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array(), ...$args ) {
[1169] Fix | Delete
$doing_ajax = wp_doing_ajax();
[1170] Fix | Delete
$loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading&hellip;' ) . '</p>';
[1171] Fix | Delete
$loading .= wp_get_admin_notice(
[1172] Fix | Delete
__( 'This widget requires JavaScript.' ),
[1173] Fix | Delete
array(
[1174] Fix | Delete
'type' => 'error',
[1175] Fix | Delete
'additional_classes' => array( 'inline', 'hide-if-js' ),
[1176] Fix | Delete
)
[1177] Fix | Delete
);
[1178] Fix | Delete
[1179] Fix | Delete
if ( empty( $check_urls ) ) {
[1180] Fix | Delete
$widgets = get_option( 'dashboard_widget_options' );
[1181] Fix | Delete
[1182] Fix | Delete
if ( empty( $widgets[ $widget_id ]['url'] ) && ! $doing_ajax ) {
[1183] Fix | Delete
echo $loading;
[1184] Fix | Delete
return false;
[1185] Fix | Delete
}
[1186] Fix | Delete
[1187] Fix | Delete
$check_urls = array( $widgets[ $widget_id ]['url'] );
[1188] Fix | Delete
}
[1189] Fix | Delete
[1190] Fix | Delete
$locale = get_user_locale();
[1191] Fix | Delete
$cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
[1192] Fix | Delete
$output = get_transient( $cache_key );
[1193] Fix | Delete
[1194] Fix | Delete
if ( false !== $output ) {
[1195] Fix | Delete
echo $output;
[1196] Fix | Delete
return true;
[1197] Fix | Delete
}
[1198] Fix | Delete
[1199] Fix | Delete
if ( ! $doing_ajax ) {
[1200] Fix | Delete
echo $loading;
[1201] Fix | Delete
return false;
[1202] Fix | Delete
}
[1203] Fix | Delete
[1204] Fix | Delete
if ( $callback && is_callable( $callback ) ) {
[1205] Fix | Delete
array_unshift( $args, $widget_id, $check_urls );
[1206] Fix | Delete
ob_start();
[1207] Fix | Delete
call_user_func_array( $callback, $args );
[1208] Fix | Delete
// Default lifetime in cache of 12 hours (same as the feeds).
[1209] Fix | Delete
set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS );
[1210] Fix | Delete
}
[1211] Fix | Delete
[1212] Fix | Delete
return true;
[1213] Fix | Delete
}
[1214] Fix | Delete
[1215] Fix | Delete
//
[1216] Fix | Delete
// Dashboard Widgets Controls.
[1217] Fix | Delete
//
[1218] Fix | Delete
[1219] Fix | Delete
/**
[1220] Fix | Delete
* Calls widget control callback.
[1221] Fix | Delete
*
[1222] Fix | Delete
* @since 2.5.0
[1223] Fix | Delete
*
[1224] Fix | Delete
* @global callable[] $wp_dashboard_control_callbacks
[1225] Fix | Delete
*
[1226] Fix | Delete
* @param int|false $widget_control_id Optional. Registered widget ID. Default false.
[1227] Fix | Delete
*/
[1228] Fix | Delete
function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
[1229] Fix | Delete
global $wp_dashboard_control_callbacks;
[1230] Fix | Delete
[1231] Fix | Delete
if ( is_scalar( $widget_control_id ) && $widget_control_id
[1232] Fix | Delete
&& isset( $wp_dashboard_control_callbacks[ $widget_control_id ] )
[1233] Fix | Delete
&& is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] )
[1234] Fix | Delete
) {
[1235] Fix | Delete
call_user_func(
[1236] Fix | Delete
$wp_dashboard_control_callbacks[ $widget_control_id ],
[1237] Fix | Delete
'',
[1238] Fix | Delete
array(
[1239] Fix | Delete
'id' => $widget_control_id,
[1240] Fix | Delete
'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
[1241] Fix | Delete
)
[1242] Fix | Delete
);
[1243] Fix | Delete
}
[1244] Fix | Delete
}
[1245] Fix | Delete
[1246] Fix | Delete
/**
[1247] Fix | Delete
* Sets up the RSS dashboard widget control and $args to be used as input to wp_widget_rss_form().
[1248] Fix | Delete
*
[1249] Fix | Delete
* Handles POST data from RSS-type widgets.
[1250] Fix | Delete
*
[1251] Fix | Delete
* @since 2.5.0
[1252] Fix | Delete
*
[1253] Fix | Delete
* @param string $widget_id
[1254] Fix | Delete
* @param array $form_inputs
[1255] Fix | Delete
*/
[1256] Fix | Delete
function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
[1257] Fix | Delete
$widget_options = get_option( 'dashboard_widget_options' );
[1258] Fix | Delete
[1259] Fix | Delete
if ( ! $widget_options ) {
[1260] Fix | Delete
$widget_options = array();
[1261] Fix | Delete
}
[1262] Fix | Delete
[1263] Fix | Delete
if ( ! isset( $widget_options[ $widget_id ] ) ) {
[1264] Fix | Delete
$widget_options[ $widget_id ] = array();
[1265] Fix | Delete
}
[1266] Fix | Delete
[1267] Fix | Delete
$number = 1; // Hack to use wp_widget_rss_form().
[1268] Fix | Delete
[1269] Fix | Delete
$widget_options[ $widget_id ]['number'] = $number;
[1270] Fix | Delete
[1271] Fix | Delete
if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget-rss'][ $number ] ) ) {
[1272] Fix | Delete
$_POST['widget-rss'][ $number ] = wp_unslash( $_POST['widget-rss'][ $number ] );
[1273] Fix | Delete
$widget_options[ $widget_id ] = wp_widget_rss_process( $_POST['widget-rss'][ $number ] );
[1274] Fix | Delete
$widget_options[ $widget_id ]['number'] = $number;
[1275] Fix | Delete
[1276] Fix | Delete
// Title is optional. If black, fill it if possible.
[1277] Fix | Delete
if ( ! $widget_options[ $widget_id ]['title'] && isset( $_POST['widget-rss'][ $number ]['title'] ) ) {
[1278] Fix | Delete
$rss = fetch_feed( $widget_options[ $widget_id ]['url'] );
[1279] Fix | Delete
if ( is_wp_error( $rss ) ) {
[1280] Fix | Delete
$widget_options[ $widget_id ]['title'] = htmlentities( __( 'Unknown Feed' ) );
[1281] Fix | Delete
} else {
[1282] Fix | Delete
$widget_options[ $widget_id ]['title'] = htmlentities( strip_tags( $rss->get_title() ) );
[1283] Fix | Delete
$rss->__destruct();
[1284] Fix | Delete
unset( $rss );
[1285] Fix | Delete
}
[1286] Fix | Delete
}
[1287] Fix | Delete
[1288] Fix | Delete
update_option( 'dashboard_widget_options', $widget_options );
[1289] Fix | Delete
[1290] Fix | Delete
$locale = get_user_locale();
[1291] Fix | Delete
$cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
[1292] Fix | Delete
delete_transient( $cache_key );
[1293] Fix | Delete
}
[1294] Fix | Delete
[1295] Fix | Delete
wp_widget_rss_form( $widget_options[ $widget_id ], $form_inputs );
[1296] Fix | Delete
}
[1297] Fix | Delete
[1298] Fix | Delete
[1299] Fix | Delete
/**
[1300] Fix | Delete
* Renders the Events and News dashboard widget.
[1301] Fix | Delete
*
[1302] Fix | Delete
* @since 4.8.0
[1303] Fix | Delete
*/
[1304] Fix | Delete
function wp_dashboard_events_news() {
[1305] Fix | Delete
wp_print_community_events_markup();
[1306] Fix | Delete
[1307] Fix | Delete
?>
[1308] Fix | Delete
[1309] Fix | Delete
<div class="wordpress-news hide-if-no-js">
[1310] Fix | Delete
<?php wp_dashboard_primary(); ?>
[1311] Fix | Delete
</div>
[1312] Fix | Delete
[1313] Fix | Delete
<p class="community-events-footer">
[1314] Fix | Delete
<?php
[1315] Fix | Delete
printf(
[1316] Fix | Delete
'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
[1317] Fix | Delete
'https://make.wordpress.org/community/meetups-landing-page',
[1318] Fix | Delete
__( 'Meetups' ),
[1319] Fix | Delete
/* translators: Hidden accessibility text. */
[1320] Fix | Delete
__( '(opens in a new tab)' )
[1321] Fix | Delete
);
[1322] Fix | Delete
?>
[1323] Fix | Delete
[1324] Fix | Delete
|
[1325] Fix | Delete
[1326] Fix | Delete
<?php
[1327] Fix | Delete
printf(
[1328] Fix | Delete
'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
[1329] Fix | Delete
'https://central.wordcamp.org/schedule/',
[1330] Fix | Delete
__( 'WordCamps' ),
[1331] Fix | Delete
/* translators: Hidden accessibility text. */
[1332] Fix | Delete
__( '(opens in a new tab)' )
[1333] Fix | Delete
);
[1334] Fix | Delete
?>
[1335] Fix | Delete
[1336] Fix | Delete
|
[1337] Fix | Delete
[1338] Fix | Delete
<?php
[1339] Fix | Delete
printf(
[1340] Fix | Delete
'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
[1341] Fix | Delete
/* translators: If a Rosetta site exists (e.g. https://es.wordpress.org/news/), then use that. Otherwise, leave untranslated. */
[1342] Fix | Delete
esc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),
[1343] Fix | Delete
__( 'News' ),
[1344] Fix | Delete
/* translators: Hidden accessibility text. */
[1345] Fix | Delete
__( '(opens in a new tab)' )
[1346] Fix | Delete
);
[1347] Fix | Delete
?>
[1348] Fix | Delete
</p>
[1349] Fix | Delete
[1350] Fix | Delete
<?php
[1351] Fix | Delete
}
[1352] Fix | Delete
[1353] Fix | Delete
/**
[1354] Fix | Delete
* Prints the markup for the Community Events section of the Events and News Dashboard widget.
[1355] Fix | Delete
*
[1356] Fix | Delete
* @since 4.8.0
[1357] Fix | Delete
*/
[1358] Fix | Delete
function wp_print_community_events_markup() {
[1359] Fix | Delete
$community_events_notice = '<p class="hide-if-js">' . ( 'This widget requires JavaScript.' ) . '</p>';
[1360] Fix | Delete
$community_events_notice .= '<p class="community-events-error-occurred" aria-hidden="true">' . __( 'An error occurred. Please try again.' ) . '</p>';
[1361] Fix | Delete
$community_events_notice .= '<p class="community-events-could-not-locate" aria-hidden="true"></p>';
[1362] Fix | Delete
[1363] Fix | Delete
wp_admin_notice(
[1364] Fix | Delete
$community_events_notice,
[1365] Fix | Delete
array(
[1366] Fix | Delete
'type' => 'error',
[1367] Fix | Delete
'additional_classes' => array( 'community-events-errors', 'inline', 'hide-if-js' ),
[1368] Fix | Delete
'paragraph_wrap' => false,
[1369] Fix | Delete
)
[1370] Fix | Delete
);
[1371] Fix | Delete
[1372] Fix | Delete
/*
[1373] Fix | Delete
* Hide the main element when the page first loads, because the content
[1374] Fix | Delete
* won't be ready until wp.communityEvents.renderEventsTemplate() has run.
[1375] Fix | Delete
*/
[1376] Fix | Delete
?>
[1377] Fix | Delete
<div id="community-events" class="community-events" aria-hidden="true">
[1378] Fix | Delete
<div class="activity-block">
[1379] Fix | Delete
<p>
[1380] Fix | Delete
<span id="community-events-location-message"></span>
[1381] Fix | Delete
[1382] Fix | Delete
<button class="button-link community-events-toggle-location" aria-expanded="false">
[1383] Fix | Delete
<span class="dashicons dashicons-location" aria-hidden="true"></span>
[1384] Fix | Delete
<span class="community-events-location-edit"><?php _e( 'Select location' ); ?></span>
[1385] Fix | Delete
</button>
[1386] Fix | Delete
</p>
[1387] Fix | Delete
[1388] Fix | Delete
<form class="community-events-form" aria-hidden="true" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" method="post">
[1389] Fix | Delete
<label for="community-events-location">
[1390] Fix | Delete
<?php _e( 'City:' ); ?>
[1391] Fix | Delete
</label>
[1392] Fix | Delete
<?php
[1393] Fix | Delete
/* translators: Replace with a city related to your locale.
[1394] Fix | Delete
* Test that it matches the expected location and has upcoming
[1395] Fix | Delete
* events before including it. If no cities related to your
[1396] Fix | Delete
* locale have events, then use a city related to your locale
[1397] Fix | Delete
* that would be recognizable to most users. Use only the city
[1398] Fix | Delete
* name itself, without any region or country. Use the endonym
[1399] Fix | Delete
* (native locale name) instead of the English name if possible.
[1400] Fix | Delete
*/
[1401] Fix | Delete
?>
[1402] Fix | Delete
<input id="community-events-location" class="regular-text" type="text" name="community-events-location" placeholder="<?php esc_attr_e( 'Cincinnati' ); ?>" />
[1403] Fix | Delete
[1404] Fix | Delete
<?php submit_button( __( 'Submit' ), 'secondary', 'community-events-submit', false ); ?>
[1405] Fix | Delete
[1406] Fix | Delete
<button class="community-events-cancel button-link" type="button" aria-expanded="false">
[1407] Fix | Delete
<?php _e( 'Cancel' ); ?>
[1408] Fix | Delete
</button>
[1409] Fix | Delete
[1410] Fix | Delete
<span class="spinner"></span>
[1411] Fix | Delete
</form>
[1412] Fix | Delete
</div>
[1413] Fix | Delete
[1414] Fix | Delete
<ul class="community-events-results activity-block last"></ul>
[1415] Fix | Delete
</div>
[1416] Fix | Delete
[1417] Fix | Delete
<?php
[1418] Fix | Delete
}
[1419] Fix | Delete
[1420] Fix | Delete
/**
[1421] Fix | Delete
* Renders the events templates for the Event and News widget.
[1422] Fix | Delete
*
[1423] Fix | Delete
* @since 4.8.0
[1424] Fix | Delete
*/
[1425] Fix | Delete
function wp_print_community_events_templates() {
[1426] Fix | Delete
?>
[1427] Fix | Delete
[1428] Fix | Delete
<script id="tmpl-community-events-attend-event-near" type="text/template">
[1429] Fix | Delete
<?php
[1430] Fix | Delete
printf(
[1431] Fix | Delete
/* translators: %s: The name of a city. */
[1432] Fix | Delete
__( 'Attend an upcoming event near %s.' ),
[1433] Fix | Delete
'<strong>{{ data.location.description }}</strong>'
[1434] Fix | Delete
);
[1435] Fix | Delete
?>
[1436] Fix | Delete
</script>
[1437] Fix | Delete
[1438] Fix | Delete
<script id="tmpl-community-events-could-not-locate" type="text/template">
[1439] Fix | Delete
<?php
[1440] Fix | Delete
printf(
[1441] Fix | Delete
/* translators: %s is the name of the city we couldn't locate.
[1442] Fix | Delete
* Replace the examples with cities in your locale, but test
[1443] Fix | Delete
* that they match the expected location before including them.
[1444] Fix | Delete
* Use endonyms (native locale names) whenever possible.
[1445] Fix | Delete
*/
[1446] Fix | Delete
__( '%s could not be located. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
[1447] Fix | Delete
'<em>{{data.unknownCity}}</em>'
[1448] Fix | Delete
);
[1449] Fix | Delete
?>
[1450] Fix | Delete
</script>
[1451] Fix | Delete
[1452] Fix | Delete
<script id="tmpl-community-events-event-list" type="text/template">
[1453] Fix | Delete
<# _.each( data.events, function( event ) { #>
[1454] Fix | Delete
<li class="event event-{{ event.type }} wp-clearfix">
[1455] Fix | Delete
<div class="event-info">
[1456] Fix | Delete
<div class="dashicons event-icon" aria-hidden="true"></div>
[1457] Fix | Delete
<div class="event-info-inner">
[1458] Fix | Delete
<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
[1459] Fix | Delete
<# if ( event.type ) {
[1460] Fix | Delete
const titleCaseEventType = event.type.replace(
[1461] Fix | Delete
/\w\S*/g,
[1462] Fix | Delete
function ( type ) { return type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); }
[1463] Fix | Delete
);
[1464] Fix | Delete
#>
[1465] Fix | Delete
{{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }}
[1466] Fix | Delete
<span class="ce-separator"></span>
[1467] Fix | Delete
<# } #>
[1468] Fix | Delete
<span class="event-city">{{ event.location.location }}</span>
[1469] Fix | Delete
</div>
[1470] Fix | Delete
</div>
[1471] Fix | Delete
[1472] Fix | Delete
<div class="event-date-time">
[1473] Fix | Delete
<span class="event-date">{{ event.user_formatted_date }}</span>
[1474] Fix | Delete
<# if ( 'meetup' === event.type ) { #>
[1475] Fix | Delete
<span class="event-time">
[1476] Fix | Delete
{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}
[1477] Fix | Delete
</span>
[1478] Fix | Delete
<# } #>
[1479] Fix | Delete
</div>
[1480] Fix | Delete
</li>
[1481] Fix | Delete
<# } ) #>
[1482] Fix | Delete
[1483] Fix | Delete
<# if ( data.events.length <= 2 ) { #>
[1484] Fix | Delete
<li class="event-none">
[1485] Fix | Delete
<?php
[1486] Fix | Delete
printf(
[1487] Fix | Delete
/* translators: %s: Localized meetup organization documentation URL. */
[1488] Fix | Delete
__( 'Want more events? <a href="%s">Help organize the next one</a>!' ),
[1489] Fix | Delete
__( 'https://make.wordpress.org/community/organize-event-landing-page/' )
[1490] Fix | Delete
);
[1491] Fix | Delete
?>
[1492] Fix | Delete
</li>
[1493] Fix | Delete
<# } #>
[1494] Fix | Delete
[1495] Fix | Delete
</script>
[1496] Fix | Delete
[1497] Fix | Delete
<script id="tmpl-community-events-no-upcoming-events" type="text/template">
[1498] Fix | Delete
<li class="event-none">
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function