Documentation

s2_authors

This hook allows the display list of content authors to be refined. For example, old and unused author accounts can be removed from the list without the need to delete the user account.

function remove_author($authors) {
    // our function takes an array of author objects as the input
    // you can then cycle through the array and remove any that you like on either 'ID' or 'display_name'
    $i = 0;
    foreach ( $authors as $author ) {
        // example use an if statement to check if author ID should be removed compared to a known ID
        if ( $author->ID == 1 ) {
            unset($authors[$i]);
        }
        $i++;
    }
    return $authors;
}
add_filter('s2_authors', 'remove_author');
Still stuck? Contact

How can we help?

Contact Us

Reach out to us for any inquiry

You must enter full name
You must enter email
You must enter message

We got your message

We will reply to you very soon :)