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-inclu...
File: link-template.php
* @param string $feed Feed type. Possible values include 'rss2', 'atom'.
[1000] Fix | Delete
* @param string $taxonomy The taxonomy name.
[1001] Fix | Delete
*/
[1002] Fix | Delete
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
[1003] Fix | Delete
}
[1004] Fix | Delete
[1005] Fix | Delete
return $link;
[1006] Fix | Delete
}
[1007] Fix | Delete
[1008] Fix | Delete
/**
[1009] Fix | Delete
* Retrieves the permalink for a tag feed.
[1010] Fix | Delete
*
[1011] Fix | Delete
* @since 2.3.0
[1012] Fix | Delete
*
[1013] Fix | Delete
* @param int|WP_Term|object $tag The ID or term object whose feed link will be retrieved.
[1014] Fix | Delete
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
[1015] Fix | Delete
* Default is the value of get_default_feed().
[1016] Fix | Delete
* @return string The feed permalink for the given tag.
[1017] Fix | Delete
*/
[1018] Fix | Delete
function get_tag_feed_link( $tag, $feed = '' ) {
[1019] Fix | Delete
return get_term_feed_link( $tag, 'post_tag', $feed );
[1020] Fix | Delete
}
[1021] Fix | Delete
[1022] Fix | Delete
/**
[1023] Fix | Delete
* Retrieves the edit link for a tag.
[1024] Fix | Delete
*
[1025] Fix | Delete
* @since 2.7.0
[1026] Fix | Delete
*
[1027] Fix | Delete
* @param int|WP_Term|object $tag The ID or term object whose edit link will be retrieved.
[1028] Fix | Delete
* @param string $taxonomy Optional. Taxonomy slug. Default 'post_tag'.
[1029] Fix | Delete
* @return string The edit tag link URL for the given tag.
[1030] Fix | Delete
*/
[1031] Fix | Delete
function get_edit_tag_link( $tag, $taxonomy = 'post_tag' ) {
[1032] Fix | Delete
/**
[1033] Fix | Delete
* Filters the edit link for a tag (or term in another taxonomy).
[1034] Fix | Delete
*
[1035] Fix | Delete
* @since 2.7.0
[1036] Fix | Delete
*
[1037] Fix | Delete
* @param string $link The term edit link.
[1038] Fix | Delete
*/
[1039] Fix | Delete
return apply_filters( 'get_edit_tag_link', get_edit_term_link( $tag, $taxonomy ) );
[1040] Fix | Delete
}
[1041] Fix | Delete
[1042] Fix | Delete
/**
[1043] Fix | Delete
* Displays or retrieves the edit link for a tag with formatting.
[1044] Fix | Delete
*
[1045] Fix | Delete
* @since 2.7.0
[1046] Fix | Delete
*
[1047] Fix | Delete
* @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
[1048] Fix | Delete
* @param string $before Optional. Display before edit link. Default empty.
[1049] Fix | Delete
* @param string $after Optional. Display after edit link. Default empty.
[1050] Fix | Delete
* @param WP_Term $tag Optional. Term object. If null, the queried object will be inspected.
[1051] Fix | Delete
* Default null.
[1052] Fix | Delete
*/
[1053] Fix | Delete
function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
[1054] Fix | Delete
$link = edit_term_link( $link, '', '', $tag, false );
[1055] Fix | Delete
[1056] Fix | Delete
/**
[1057] Fix | Delete
* Filters the anchor tag for the edit link for a tag (or term in another taxonomy).
[1058] Fix | Delete
*
[1059] Fix | Delete
* @since 2.7.0
[1060] Fix | Delete
*
[1061] Fix | Delete
* @param string $link The anchor tag for the edit link.
[1062] Fix | Delete
*/
[1063] Fix | Delete
echo $before . apply_filters( 'edit_tag_link', $link ) . $after;
[1064] Fix | Delete
}
[1065] Fix | Delete
[1066] Fix | Delete
/**
[1067] Fix | Delete
* Retrieves the URL for editing a given term.
[1068] Fix | Delete
*
[1069] Fix | Delete
* @since 3.1.0
[1070] Fix | Delete
* @since 4.5.0 The `$taxonomy` parameter was made optional.
[1071] Fix | Delete
*
[1072] Fix | Delete
* @param int|WP_Term|object $term The ID or term object whose edit link will be retrieved.
[1073] Fix | Delete
* @param string $taxonomy Optional. Taxonomy. Defaults to the taxonomy of the term identified
[1074] Fix | Delete
* by `$term`.
[1075] Fix | Delete
* @param string $object_type Optional. The object type. Used to highlight the proper post type
[1076] Fix | Delete
* menu on the linked page. Defaults to the first object_type associated
[1077] Fix | Delete
* with the taxonomy.
[1078] Fix | Delete
* @return string|null The edit term link URL for the given term, or null on failure.
[1079] Fix | Delete
*/
[1080] Fix | Delete
function get_edit_term_link( $term, $taxonomy = '', $object_type = '' ) {
[1081] Fix | Delete
$term = get_term( $term, $taxonomy );
[1082] Fix | Delete
if ( ! $term || is_wp_error( $term ) ) {
[1083] Fix | Delete
return;
[1084] Fix | Delete
}
[1085] Fix | Delete
[1086] Fix | Delete
$tax = get_taxonomy( $term->taxonomy );
[1087] Fix | Delete
$term_id = $term->term_id;
[1088] Fix | Delete
if ( ! $tax || ! current_user_can( 'edit_term', $term_id ) ) {
[1089] Fix | Delete
return;
[1090] Fix | Delete
}
[1091] Fix | Delete
[1092] Fix | Delete
$args = array(
[1093] Fix | Delete
'taxonomy' => $taxonomy,
[1094] Fix | Delete
'tag_ID' => $term_id,
[1095] Fix | Delete
);
[1096] Fix | Delete
[1097] Fix | Delete
if ( $object_type ) {
[1098] Fix | Delete
$args['post_type'] = $object_type;
[1099] Fix | Delete
} elseif ( ! empty( $tax->object_type ) ) {
[1100] Fix | Delete
$args['post_type'] = reset( $tax->object_type );
[1101] Fix | Delete
}
[1102] Fix | Delete
[1103] Fix | Delete
if ( $tax->show_ui ) {
[1104] Fix | Delete
$location = add_query_arg( $args, admin_url( 'term.php' ) );
[1105] Fix | Delete
} else {
[1106] Fix | Delete
$location = '';
[1107] Fix | Delete
}
[1108] Fix | Delete
[1109] Fix | Delete
/**
[1110] Fix | Delete
* Filters the edit link for a term.
[1111] Fix | Delete
*
[1112] Fix | Delete
* @since 3.1.0
[1113] Fix | Delete
*
[1114] Fix | Delete
* @param string $location The edit link.
[1115] Fix | Delete
* @param int $term_id Term ID.
[1116] Fix | Delete
* @param string $taxonomy Taxonomy name.
[1117] Fix | Delete
* @param string $object_type The object type.
[1118] Fix | Delete
*/
[1119] Fix | Delete
return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );
[1120] Fix | Delete
}
[1121] Fix | Delete
[1122] Fix | Delete
/**
[1123] Fix | Delete
* Displays or retrieves the edit term link with formatting.
[1124] Fix | Delete
*
[1125] Fix | Delete
* @since 3.1.0
[1126] Fix | Delete
*
[1127] Fix | Delete
* @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
[1128] Fix | Delete
* @param string $before Optional. Display before edit link. Default empty.
[1129] Fix | Delete
* @param string $after Optional. Display after edit link. Default empty.
[1130] Fix | Delete
* @param int|WP_Term|null $term Optional. Term ID or object. If null, the queried object will be inspected. Default null.
[1131] Fix | Delete
* @param bool $display Optional. Whether or not to echo the return. Default true.
[1132] Fix | Delete
* @return string|void HTML content.
[1133] Fix | Delete
*/
[1134] Fix | Delete
function edit_term_link( $link = '', $before = '', $after = '', $term = null, $display = true ) {
[1135] Fix | Delete
if ( is_null( $term ) ) {
[1136] Fix | Delete
$term = get_queried_object();
[1137] Fix | Delete
} else {
[1138] Fix | Delete
$term = get_term( $term );
[1139] Fix | Delete
}
[1140] Fix | Delete
[1141] Fix | Delete
if ( ! $term ) {
[1142] Fix | Delete
return;
[1143] Fix | Delete
}
[1144] Fix | Delete
[1145] Fix | Delete
$tax = get_taxonomy( $term->taxonomy );
[1146] Fix | Delete
if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
[1147] Fix | Delete
return;
[1148] Fix | Delete
}
[1149] Fix | Delete
[1150] Fix | Delete
if ( empty( $link ) ) {
[1151] Fix | Delete
$link = __( 'Edit This' );
[1152] Fix | Delete
}
[1153] Fix | Delete
[1154] Fix | Delete
$link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '">' . $link . '</a>';
[1155] Fix | Delete
[1156] Fix | Delete
/**
[1157] Fix | Delete
* Filters the anchor tag for the edit link of a term.
[1158] Fix | Delete
*
[1159] Fix | Delete
* @since 3.1.0
[1160] Fix | Delete
*
[1161] Fix | Delete
* @param string $link The anchor tag for the edit link.
[1162] Fix | Delete
* @param int $term_id Term ID.
[1163] Fix | Delete
*/
[1164] Fix | Delete
$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
[1165] Fix | Delete
[1166] Fix | Delete
if ( $display ) {
[1167] Fix | Delete
echo $link;
[1168] Fix | Delete
} else {
[1169] Fix | Delete
return $link;
[1170] Fix | Delete
}
[1171] Fix | Delete
}
[1172] Fix | Delete
[1173] Fix | Delete
/**
[1174] Fix | Delete
* Retrieves the permalink for a search.
[1175] Fix | Delete
*
[1176] Fix | Delete
* @since 3.0.0
[1177] Fix | Delete
*
[1178] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[1179] Fix | Delete
*
[1180] Fix | Delete
* @param string $query Optional. The query string to use. If empty the current query is used. Default empty.
[1181] Fix | Delete
* @return string The search permalink.
[1182] Fix | Delete
*/
[1183] Fix | Delete
function get_search_link( $query = '' ) {
[1184] Fix | Delete
global $wp_rewrite;
[1185] Fix | Delete
[1186] Fix | Delete
if ( empty( $query ) ) {
[1187] Fix | Delete
$search = get_search_query( false );
[1188] Fix | Delete
} else {
[1189] Fix | Delete
$search = stripslashes( $query );
[1190] Fix | Delete
}
[1191] Fix | Delete
[1192] Fix | Delete
$permastruct = $wp_rewrite->get_search_permastruct();
[1193] Fix | Delete
[1194] Fix | Delete
if ( empty( $permastruct ) ) {
[1195] Fix | Delete
$link = home_url( '?s=' . urlencode( $search ) );
[1196] Fix | Delete
} else {
[1197] Fix | Delete
$search = urlencode( $search );
[1198] Fix | Delete
$search = str_replace( '%2F', '/', $search ); // %2F(/) is not valid within a URL, send it un-encoded.
[1199] Fix | Delete
$link = str_replace( '%search%', $search, $permastruct );
[1200] Fix | Delete
$link = home_url( user_trailingslashit( $link, 'search' ) );
[1201] Fix | Delete
}
[1202] Fix | Delete
[1203] Fix | Delete
/**
[1204] Fix | Delete
* Filters the search permalink.
[1205] Fix | Delete
*
[1206] Fix | Delete
* @since 3.0.0
[1207] Fix | Delete
*
[1208] Fix | Delete
* @param string $link Search permalink.
[1209] Fix | Delete
* @param string $search The URL-encoded search term.
[1210] Fix | Delete
*/
[1211] Fix | Delete
return apply_filters( 'search_link', $link, $search );
[1212] Fix | Delete
}
[1213] Fix | Delete
[1214] Fix | Delete
/**
[1215] Fix | Delete
* Retrieves the permalink for the search results feed.
[1216] Fix | Delete
*
[1217] Fix | Delete
* @since 2.5.0
[1218] Fix | Delete
*
[1219] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[1220] Fix | Delete
*
[1221] Fix | Delete
* @param string $search_query Optional. Search query. Default empty.
[1222] Fix | Delete
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
[1223] Fix | Delete
* Default is the value of get_default_feed().
[1224] Fix | Delete
* @return string The search results feed permalink.
[1225] Fix | Delete
*/
[1226] Fix | Delete
function get_search_feed_link( $search_query = '', $feed = '' ) {
[1227] Fix | Delete
global $wp_rewrite;
[1228] Fix | Delete
$link = get_search_link( $search_query );
[1229] Fix | Delete
[1230] Fix | Delete
if ( empty( $feed ) ) {
[1231] Fix | Delete
$feed = get_default_feed();
[1232] Fix | Delete
}
[1233] Fix | Delete
[1234] Fix | Delete
$permastruct = $wp_rewrite->get_search_permastruct();
[1235] Fix | Delete
[1236] Fix | Delete
if ( empty( $permastruct ) ) {
[1237] Fix | Delete
$link = add_query_arg( 'feed', $feed, $link );
[1238] Fix | Delete
} else {
[1239] Fix | Delete
$link = trailingslashit( $link );
[1240] Fix | Delete
$link .= "feed/$feed/";
[1241] Fix | Delete
}
[1242] Fix | Delete
[1243] Fix | Delete
/**
[1244] Fix | Delete
* Filters the search feed link.
[1245] Fix | Delete
*
[1246] Fix | Delete
* @since 2.5.0
[1247] Fix | Delete
*
[1248] Fix | Delete
* @param string $link Search feed link.
[1249] Fix | Delete
* @param string $feed Feed type. Possible values include 'rss2', 'atom'.
[1250] Fix | Delete
* @param string $type The search type. One of 'posts' or 'comments'.
[1251] Fix | Delete
*/
[1252] Fix | Delete
return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
[1253] Fix | Delete
}
[1254] Fix | Delete
[1255] Fix | Delete
/**
[1256] Fix | Delete
* Retrieves the permalink for the search results comments feed.
[1257] Fix | Delete
*
[1258] Fix | Delete
* @since 2.5.0
[1259] Fix | Delete
*
[1260] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[1261] Fix | Delete
*
[1262] Fix | Delete
* @param string $search_query Optional. Search query. Default empty.
[1263] Fix | Delete
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
[1264] Fix | Delete
* Default is the value of get_default_feed().
[1265] Fix | Delete
* @return string The comments feed search results permalink.
[1266] Fix | Delete
*/
[1267] Fix | Delete
function get_search_comments_feed_link( $search_query = '', $feed = '' ) {
[1268] Fix | Delete
global $wp_rewrite;
[1269] Fix | Delete
[1270] Fix | Delete
if ( empty( $feed ) ) {
[1271] Fix | Delete
$feed = get_default_feed();
[1272] Fix | Delete
}
[1273] Fix | Delete
[1274] Fix | Delete
$link = get_search_feed_link( $search_query, $feed );
[1275] Fix | Delete
[1276] Fix | Delete
$permastruct = $wp_rewrite->get_search_permastruct();
[1277] Fix | Delete
[1278] Fix | Delete
if ( empty( $permastruct ) ) {
[1279] Fix | Delete
$link = add_query_arg( 'feed', 'comments-' . $feed, $link );
[1280] Fix | Delete
} else {
[1281] Fix | Delete
$link = add_query_arg( 'withcomments', 1, $link );
[1282] Fix | Delete
}
[1283] Fix | Delete
[1284] Fix | Delete
/** This filter is documented in wp-includes/link-template.php */
[1285] Fix | Delete
return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
[1286] Fix | Delete
}
[1287] Fix | Delete
[1288] Fix | Delete
/**
[1289] Fix | Delete
* Retrieves the permalink for a post type archive.
[1290] Fix | Delete
*
[1291] Fix | Delete
* @since 3.1.0
[1292] Fix | Delete
* @since 4.5.0 Support for posts was added.
[1293] Fix | Delete
*
[1294] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[1295] Fix | Delete
*
[1296] Fix | Delete
* @param string $post_type Post type.
[1297] Fix | Delete
* @return string|false The post type archive permalink. False if the post type
[1298] Fix | Delete
* does not exist or does not have an archive.
[1299] Fix | Delete
*/
[1300] Fix | Delete
function get_post_type_archive_link( $post_type ) {
[1301] Fix | Delete
global $wp_rewrite;
[1302] Fix | Delete
[1303] Fix | Delete
$post_type_obj = get_post_type_object( $post_type );
[1304] Fix | Delete
[1305] Fix | Delete
if ( ! $post_type_obj ) {
[1306] Fix | Delete
return false;
[1307] Fix | Delete
}
[1308] Fix | Delete
[1309] Fix | Delete
if ( 'post' === $post_type ) {
[1310] Fix | Delete
$show_on_front = get_option( 'show_on_front' );
[1311] Fix | Delete
$page_for_posts = get_option( 'page_for_posts' );
[1312] Fix | Delete
[1313] Fix | Delete
if ( 'page' === $show_on_front && $page_for_posts ) {
[1314] Fix | Delete
$link = get_permalink( $page_for_posts );
[1315] Fix | Delete
} else {
[1316] Fix | Delete
$link = get_home_url();
[1317] Fix | Delete
}
[1318] Fix | Delete
/** This filter is documented in wp-includes/link-template.php */
[1319] Fix | Delete
return apply_filters( 'post_type_archive_link', $link, $post_type );
[1320] Fix | Delete
}
[1321] Fix | Delete
[1322] Fix | Delete
if ( ! $post_type_obj->has_archive ) {
[1323] Fix | Delete
return false;
[1324] Fix | Delete
}
[1325] Fix | Delete
[1326] Fix | Delete
if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
[1327] Fix | Delete
$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
[1328] Fix | Delete
if ( $post_type_obj->rewrite['with_front'] ) {
[1329] Fix | Delete
$struct = $wp_rewrite->front . $struct;
[1330] Fix | Delete
} else {
[1331] Fix | Delete
$struct = $wp_rewrite->root . $struct;
[1332] Fix | Delete
}
[1333] Fix | Delete
$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
[1334] Fix | Delete
} else {
[1335] Fix | Delete
$link = home_url( '?post_type=' . $post_type );
[1336] Fix | Delete
}
[1337] Fix | Delete
[1338] Fix | Delete
/**
[1339] Fix | Delete
* Filters the post type archive permalink.
[1340] Fix | Delete
*
[1341] Fix | Delete
* @since 3.1.0
[1342] Fix | Delete
*
[1343] Fix | Delete
* @param string $link The post type archive permalink.
[1344] Fix | Delete
* @param string $post_type Post type name.
[1345] Fix | Delete
*/
[1346] Fix | Delete
return apply_filters( 'post_type_archive_link', $link, $post_type );
[1347] Fix | Delete
}
[1348] Fix | Delete
[1349] Fix | Delete
/**
[1350] Fix | Delete
* Retrieves the permalink for a post type archive feed.
[1351] Fix | Delete
*
[1352] Fix | Delete
* @since 3.1.0
[1353] Fix | Delete
*
[1354] Fix | Delete
* @param string $post_type Post type.
[1355] Fix | Delete
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
[1356] Fix | Delete
* Default is the value of get_default_feed().
[1357] Fix | Delete
* @return string|false The post type feed permalink. False if the post type
[1358] Fix | Delete
* does not exist or does not have an archive.
[1359] Fix | Delete
*/
[1360] Fix | Delete
function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
[1361] Fix | Delete
$default_feed = get_default_feed();
[1362] Fix | Delete
if ( empty( $feed ) ) {
[1363] Fix | Delete
$feed = $default_feed;
[1364] Fix | Delete
}
[1365] Fix | Delete
[1366] Fix | Delete
$link = get_post_type_archive_link( $post_type );
[1367] Fix | Delete
if ( ! $link ) {
[1368] Fix | Delete
return false;
[1369] Fix | Delete
}
[1370] Fix | Delete
[1371] Fix | Delete
$post_type_obj = get_post_type_object( $post_type );
[1372] Fix | Delete
if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
[1373] Fix | Delete
$link = trailingslashit( $link );
[1374] Fix | Delete
$link .= 'feed/';
[1375] Fix | Delete
if ( $feed !== $default_feed ) {
[1376] Fix | Delete
$link .= "$feed/";
[1377] Fix | Delete
}
[1378] Fix | Delete
} else {
[1379] Fix | Delete
$link = add_query_arg( 'feed', $feed, $link );
[1380] Fix | Delete
}
[1381] Fix | Delete
[1382] Fix | Delete
/**
[1383] Fix | Delete
* Filters the post type archive feed link.
[1384] Fix | Delete
*
[1385] Fix | Delete
* @since 3.1.0
[1386] Fix | Delete
*
[1387] Fix | Delete
* @param string $link The post type archive feed link.
[1388] Fix | Delete
* @param string $feed Feed type. Possible values include 'rss2', 'atom'.
[1389] Fix | Delete
*/
[1390] Fix | Delete
return apply_filters( 'post_type_archive_feed_link', $link, $feed );
[1391] Fix | Delete
}
[1392] Fix | Delete
[1393] Fix | Delete
/**
[1394] Fix | Delete
* Retrieves the URL used for the post preview.
[1395] Fix | Delete
*
[1396] Fix | Delete
* Allows additional query args to be appended.
[1397] Fix | Delete
*
[1398] Fix | Delete
* @since 4.4.0
[1399] Fix | Delete
*
[1400] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or `WP_Post` object. Defaults to global `$post`.
[1401] Fix | Delete
* @param array $query_args Optional. Array of additional query args to be appended to the link.
[1402] Fix | Delete
* Default empty array.
[1403] Fix | Delete
* @param string $preview_link Optional. Base preview link to be used if it should differ from the
[1404] Fix | Delete
* post permalink. Default empty.
[1405] Fix | Delete
* @return string|null URL used for the post preview, or null if the post does not exist.
[1406] Fix | Delete
*/
[1407] Fix | Delete
function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) {
[1408] Fix | Delete
$post = get_post( $post );
[1409] Fix | Delete
[1410] Fix | Delete
if ( ! $post ) {
[1411] Fix | Delete
return;
[1412] Fix | Delete
}
[1413] Fix | Delete
[1414] Fix | Delete
$post_type_object = get_post_type_object( $post->post_type );
[1415] Fix | Delete
if ( is_post_type_viewable( $post_type_object ) ) {
[1416] Fix | Delete
if ( ! $preview_link ) {
[1417] Fix | Delete
$preview_link = set_url_scheme( get_permalink( $post ) );
[1418] Fix | Delete
}
[1419] Fix | Delete
[1420] Fix | Delete
$query_args['preview'] = 'true';
[1421] Fix | Delete
$preview_link = add_query_arg( $query_args, $preview_link );
[1422] Fix | Delete
}
[1423] Fix | Delete
[1424] Fix | Delete
/**
[1425] Fix | Delete
* Filters the URL used for a post preview.
[1426] Fix | Delete
*
[1427] Fix | Delete
* @since 2.0.5
[1428] Fix | Delete
* @since 4.0.0 Added the `$post` parameter.
[1429] Fix | Delete
*
[1430] Fix | Delete
* @param string $preview_link URL used for the post preview.
[1431] Fix | Delete
* @param WP_Post $post Post object.
[1432] Fix | Delete
*/
[1433] Fix | Delete
return apply_filters( 'preview_post_link', $preview_link, $post );
[1434] Fix | Delete
}
[1435] Fix | Delete
[1436] Fix | Delete
/**
[1437] Fix | Delete
* Retrieves the edit post link for post.
[1438] Fix | Delete
*
[1439] Fix | Delete
* Can be used within the WordPress loop or outside of it. Can be used with
[1440] Fix | Delete
* pages, posts, attachments, revisions, global styles, templates, and template parts.
[1441] Fix | Delete
*
[1442] Fix | Delete
* @since 2.3.0
[1443] Fix | Delete
* @since 6.3.0 Adds custom link for wp_navigation post types.
[1444] Fix | Delete
* Adds custom links for wp_template_part and wp_template post types.
[1445] Fix | Delete
*
[1446] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
[1447] Fix | Delete
* @param string $context Optional. How to output the '&' character. Default '&amp;'.
[1448] Fix | Delete
* @return string|null The edit post link for the given post. Null if the post type does not exist
[1449] Fix | Delete
* or does not allow an editing UI.
[1450] Fix | Delete
*/
[1451] Fix | Delete
function get_edit_post_link( $post = 0, $context = 'display' ) {
[1452] Fix | Delete
$post = get_post( $post );
[1453] Fix | Delete
[1454] Fix | Delete
if ( ! $post ) {
[1455] Fix | Delete
return;
[1456] Fix | Delete
}
[1457] Fix | Delete
[1458] Fix | Delete
if ( 'revision' === $post->post_type ) {
[1459] Fix | Delete
$action = '';
[1460] Fix | Delete
} elseif ( 'display' === $context ) {
[1461] Fix | Delete
$action = '&amp;action=edit';
[1462] Fix | Delete
} else {
[1463] Fix | Delete
$action = '&action=edit';
[1464] Fix | Delete
}
[1465] Fix | Delete
[1466] Fix | Delete
$post_type_object = get_post_type_object( $post->post_type );
[1467] Fix | Delete
[1468] Fix | Delete
if ( ! $post_type_object ) {
[1469] Fix | Delete
return;
[1470] Fix | Delete
}
[1471] Fix | Delete
[1472] Fix | Delete
if ( ! current_user_can( 'edit_post', $post->ID ) ) {
[1473] Fix | Delete
return;
[1474] Fix | Delete
}
[1475] Fix | Delete
[1476] Fix | Delete
$link = '';
[1477] Fix | Delete
[1478] Fix | Delete
if ( 'wp_template' === $post->post_type || 'wp_template_part' === $post->post_type ) {
[1479] Fix | Delete
$slug = urlencode( get_stylesheet() . '//' . $post->post_name );
[1480] Fix | Delete
$link = admin_url( sprintf( $post_type_object->_edit_link, $post->post_type, $slug ) );
[1481] Fix | Delete
} elseif ( 'wp_navigation' === $post->post_type ) {
[1482] Fix | Delete
$link = admin_url( sprintf( $post_type_object->_edit_link, (string) $post->ID ) );
[1483] Fix | Delete
} elseif ( $post_type_object->_edit_link ) {
[1484] Fix | Delete
$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
[1485] Fix | Delete
}
[1486] Fix | Delete
[1487] Fix | Delete
/**
[1488] Fix | Delete
* Filters the post edit link.
[1489] Fix | Delete
*
[1490] Fix | Delete
* @since 2.3.0
[1491] Fix | Delete
*
[1492] Fix | Delete
* @param string $link The edit link.
[1493] Fix | Delete
* @param int $post_id Post ID.
[1494] Fix | Delete
* @param string $context The link context. If set to 'display' then ampersands
[1495] Fix | Delete
* are encoded.
[1496] Fix | Delete
*/
[1497] Fix | Delete
return apply_filters( 'get_edit_post_link', $link, $post->ID, $context );
[1498] Fix | Delete
}
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function