Aventyret / solarplexus

Wordpress Block that is useful when building news sites
GNU General Public License v2.0
6 stars 1 forks source link

Add pagination next url permalink filter #121

Closed fiwa closed 1 month ago

fiwa commented 1 month ago

Closes #120

Example usage:

/**
 * Return the URL of the current term if the page is an archive page.
 */
add_filter('splx_pagination_next_url_permalink', function($permalink) {
    $result = $permalink;

    if (is_archive()) {
        $term = get_queried_object();

        if ($term) {
            $term_permalink = get_term_link($term);

            if ($term_permalink) {
                $result = $term_permalink;
            }
        }
    }

    return $result;
}, 10, 1);