gmdate( 'Y' ), 'current_year' => gmdate( 'Y' ), 'date' => gmdate( 'm/d/Y' ), 'site_title' => get_bloginfo( 'name' ), 'site_url' => get_bloginfo( 'url' ), 'site_name' => get_bloginfo( 'name' ), ] ); for ( $i = 0; $i < count( $matches ); $i++ ) { $with_tags = $matches[0][ $i ] ?? ''; if ( ! $with_tags ) { continue; } $without_tags = str_replace( [ '{', '}' ], '', $with_tags ); if ( ! $without_tags ) { continue; } if ( shortcode_exists( $without_tags ) ) { return $html; } $id = $object->context['postId'] ?? get_the_ID(); $post_field = null; $post_meta = null; if ( ! is_null( $id ) ) { $post_field = esc_html( get_post_field( $without_tags, $id ) ); if ( $post_field ) { $html = str_replace( $with_tags, $post_field, $html ); } $post_meta = esc_html( get_post_meta( $id, $without_tags, true ) ); if ( ! $post_field && $post_meta ) { $html = str_replace( $with_tags, $post_meta, $html ); } } $custom = esc_html( $tags[ $with_tags ] ?? $tags[ $without_tags ] ?? '' ); if ( ! $post_field && ! $post_meta && $custom ) { $html = str_replace( $with_tags, $custom, $html ); } } return $html; }