LLMS_Section::get_next()

Retrieve the previous section


Return Return

(LLMS_Section|false)


Top ↑

Source Source

File: includes/models/model.llms.section.php

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
public function get_next() {
 
    $siblings = $this->get_siblings( 'ids' );
    $index    = array_search( $this->get( 'id' ), $siblings );
 
    /**
     * The `$index` var will be false if the current section isn't found and
     * will equal the length of the array if it's the last one (and there is no next).
     */
    if ( false === $index || count( $siblings ) - 1 === $index ) {
        return false;
    }
 
    return llms_get_post( $siblings[ $index + 1 ] );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Unknown.
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.