This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
+41 -27
View File
@@ -1424,9 +1424,15 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
$title = __( 'Page not found' );
}
$prefix = '';
if ( ! empty( $title ) ) {
$prefix = " $sep ";
if ( ! is_string( $title ) ) {
$title = '';
}
$prefix = '';
$title_array = array();
if ( '' !== $title ) {
$prefix = " $sep ";
$title_array = explode( $t_sep, $title );
}
/**
@@ -1436,7 +1442,7 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
*
* @param string[] $title_array Array of parts of the page title.
*/
$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );
$title_array = apply_filters( 'wp_title_parts', $title_array );
// Determines position of the separator and direction of the breadcrumb.
if ( 'right' === $seplocation ) { // Separator on right, so reverse the order.
@@ -2069,11 +2075,11 @@ function wp_get_archives( $args = '' ) {
if ( 'monthly' === $parsed_args['type'] ) {
$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
$key = md5( $query );
$key = "wp_get_archives:$key:$last_changed";
$results = wp_cache_get( $key, 'post-queries' );
$key = "wp_get_archives:$key";
$results = wp_cache_get_salted( $key, 'post-queries', $last_changed );
if ( ! $results ) {
$results = $wpdb->get_results( $query );
wp_cache_set( $key, $results, 'post-queries' );
wp_cache_set_salted( $key, $results, 'post-queries', $last_changed );
}
if ( $results ) {
$after = $parsed_args['after'];
@@ -2094,11 +2100,11 @@ function wp_get_archives( $args = '' ) {
} elseif ( 'yearly' === $parsed_args['type'] ) {
$query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
$key = md5( $query );
$key = "wp_get_archives:$key:$last_changed";
$results = wp_cache_get( $key, 'post-queries' );
$key = "wp_get_archives:$key";
$results = wp_cache_get_salted( $key, 'post-queries', $last_changed );
if ( ! $results ) {
$results = $wpdb->get_results( $query );
wp_cache_set( $key, $results, 'post-queries' );
wp_cache_set_salted( $key, $results, 'post-queries', $last_changed );
}
if ( $results ) {
$after = $parsed_args['after'];
@@ -2118,11 +2124,11 @@ function wp_get_archives( $args = '' ) {
} elseif ( 'daily' === $parsed_args['type'] ) {
$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
$key = md5( $query );
$key = "wp_get_archives:$key:$last_changed";
$results = wp_cache_get( $key, 'post-queries' );
$key = "wp_get_archives:$key";
$results = wp_cache_get_salted( $key, 'post-queries', $last_changed );
if ( ! $results ) {
$results = $wpdb->get_results( $query );
wp_cache_set( $key, $results, 'post-queries' );
wp_cache_set_salted( $key, $results, 'post-queries', $last_changed );
}
if ( $results ) {
$after = $parsed_args['after'];
@@ -2144,11 +2150,11 @@ function wp_get_archives( $args = '' ) {
$week = _wp_mysql_week( '`post_date`' );
$query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
$key = md5( $query );
$key = "wp_get_archives:$key:$last_changed";
$results = wp_cache_get( $key, 'post-queries' );
$key = "wp_get_archives:$key";
$results = wp_cache_get_salted( $key, 'post-queries', $last_changed );
if ( ! $results ) {
$results = $wpdb->get_results( $query );
wp_cache_set( $key, $results, 'post-queries' );
wp_cache_set_salted( $key, $results, 'post-queries', $last_changed );
}
$arc_w_last = '';
if ( $results ) {
@@ -2183,11 +2189,11 @@ function wp_get_archives( $args = '' ) {
$orderby = ( 'alpha' === $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
$query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
$key = md5( $query );
$key = "wp_get_archives:$key:$last_changed";
$results = wp_cache_get( $key, 'post-queries' );
$key = "wp_get_archives:$key";
$results = wp_cache_get_salted( $key, 'post-queries', $last_changed );
if ( ! $results ) {
$results = $wpdb->get_results( $query );
wp_cache_set( $key, $results, 'post-queries' );
wp_cache_set_salted( $key, $results, 'post-queries', $last_changed );
}
if ( $results ) {
foreach ( (array) $results as $result ) {
@@ -2289,7 +2295,6 @@ function get_calendar( $args = array() ) {
* @type bool $display Whether to display the calendar output. Default true.
* @type string $post_type Optional. Post type. Default 'post'.
* }
* @return array The arguments for the `get_calendar` function.
*/
$args = apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) );
@@ -2494,7 +2499,7 @@ function get_calendar( $args = array() ) {
$daysinmonth = (int) gmdate( 't', $unixmonth );
for ( $day = 1; $day <= $daysinmonth; ++$day ) {
if ( isset( $newrow ) && $newrow ) {
if ( $newrow ) {
$calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
}
@@ -3327,9 +3332,13 @@ function feed_links_extra( $args = array() ) {
*/
$args = apply_filters( 'feed_links_extra_args', $args );
if ( is_singular() ) {
$id = 0;
$post = get_post( $id );
/*
* The template conditionals are referring to the global query, so the queried object is used rather than
* depending on a global $post being set.
*/
$queried_object = get_queried_object();
if ( is_singular() && $queried_object instanceof WP_Post ) {
$post = $queried_object;
/** This filter is documented in wp-includes/general-template.php */
$show_comments_feed = apply_filters( 'feed_links_show_comments_feed', true );
@@ -3349,12 +3358,17 @@ function feed_links_extra( $args = array() ) {
*/
$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
if ( $show_post_comments_feed && ( comments_open() || pings_open() || $post->comment_count > 0 ) ) {
if ( $show_post_comments_feed && ( comments_open( $post ) || pings_open( $post ) || (int) $post->comment_count > 0 ) ) {
$title = sprintf(
$args['singletitle'],
get_bloginfo( 'name' ),
$args['separator'],
the_title_attribute( array( 'echo' => false ) )
the_title_attribute(
array(
'echo' => false,
'post' => $post,
)
)
);
$feed_link = get_post_comments_feed_link( $post->ID );
@@ -4067,7 +4081,7 @@ function wp_enqueue_code_editor( $args ) {
}
}
wp_add_inline_script( 'code-editor', sprintf( 'jQuery.extend( wp.codeEditor.defaultSettings, %s );', wp_json_encode( $settings ) ) );
wp_add_inline_script( 'code-editor', sprintf( 'jQuery.extend( wp.codeEditor.defaultSettings, %s );', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) );
/**
* Fires when scripts and styles are enqueued for the code editor.