mirror of
https://github.com/Automattic/wordpress-activitypub
synced 2024-10-18 12:23:32 +00:00
Merge branch 'trunk' into improve/actor-mode
This commit is contained in:
commit
7bb5b6bd9e
2 changed files with 7 additions and 3 deletions
|
@ -163,13 +163,13 @@ class Activitypub {
|
|||
$self_link = esc_url( $self_link );
|
||||
|
||||
if ( ! headers_sent() ) {
|
||||
header( 'Link: <' . $self_link . '>; rel="alternate"; type="application/activity+json"' );
|
||||
header( 'Link: <' . $self_link . '>; title="ActivityPub (JSON)" rel="alternate"; type="application/activity+json"' );
|
||||
}
|
||||
|
||||
add_action(
|
||||
'wp_head',
|
||||
function () use ( $self_link ) {
|
||||
echo PHP_EOL . '<link rel="alternate" type="application/activity+json" href="' . esc_url( $self_link ) . '" />' . PHP_EOL;
|
||||
echo PHP_EOL . '<link rel="alternate" title="ActivityPub (JSON)" type="application/activity+json" href="' . esc_url( $self_link ) . '" />' . PHP_EOL;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -156,7 +156,11 @@ class Replies {
|
|||
$total_replies = \get_comments( array_merge( $args, array( 'count' => true ) ) );
|
||||
|
||||
// Modify query args to retrieve paginated results.
|
||||
$comments_per_page = \get_option( 'comments_per_page' );
|
||||
$comments_per_page = (int) \get_option( 'comments_per_page' );
|
||||
// If set to zero, we get errors below. You need at least one comment per page, here.
|
||||
if ( ! $comments_per_page ) {
|
||||
$comments_per_page = 1;
|
||||
}
|
||||
|
||||
// Fetch internal and external comments for current page.
|
||||
$comments = get_comments( self::add_pagination_args( $args, $page, $comments_per_page ) );
|
||||
|
|
Loading…
Reference in a new issue