get_settings(); } $opt = get_option( 'aha_prev_next_settings', array() ); return is_array( $opt ) ? $opt : array(); } /** * Check if plugin is enabled. * * @return bool */ function aha_prev_next_is_enabled() { $settings = aha_prev_next_get_settings(); return ! empty( $settings['enable'] ); } /** * Return the list of post types where Prev/Next can run (free defaults). * * Extend this via the filter to allow other post types. * * @return string[] */ function aha_prev_next_get_allowed_post_types() { $post_types = get_post_types( array( 'public' => true, ), 'names' ); if ( isset( $post_types['attachment'] ) ) { unset( $post_types['attachment'] ); } $allowed = array_values( $post_types ); /** * Filter allowed post types. * * @since 0.1.0 * @param string[] $allowed Allowed post types. */ $allowed = apply_filters( 'aha_prev_next_allowed_post_types', $allowed ); return array_values( array_unique( array_filter( array_map( 'sanitize_key', (array) $allowed ) ) ) ); }