Code cleanup and remove errant wp_die()

Yikes.
This commit is contained in:
Tetrakern 2024-02-06 00:32:15 +01:00
parent 627f2e90a2
commit affc19f5b8
5 changed files with 23 additions and 9 deletions

View File

@ -1801,7 +1801,8 @@ if ( ! function_exists( 'fictioneer_check_comment_disallowed_list' ) ) {
// Skip empty lines.
if ( empty( $word ) ) {
continue; }
continue;
}
// Do some escaping magic so that '#' chars in the spam words don't break things:
$word = preg_quote( $word, '#' );

View File

@ -329,9 +329,6 @@ function fictioneer_mobile_user_menu() {
$bookmarks_link = fictioneer_get_assigned_page_link( 'fictioneer_bookmarks_page' );
$bookshelf_link = fictioneer_get_assigned_page_link( 'fictioneer_bookshelf_page' );
$discord_link = get_option( 'fictioneer_discord_invite_link' );
$can_checkmarks = get_option( 'fictioneer_enable_checkmarks' );
$can_follows = get_option( 'fictioneer_enable_follows' );
$can_reminders = get_option( 'fictioneer_enable_reminders' );
$profile_link = get_edit_profile_url();
$profile_page_id = intval( get_option( 'fictioneer_user_profile_page', -1 ) ?: -1 );
$output = [];
@ -370,7 +367,15 @@ function fictioneer_mobile_user_menu() {
);
}
if ( $bookshelf_link && fictioneer_show_auth_content() && ( $can_checkmarks || $can_follows || $can_reminders ) ) {
if (
$bookshelf_link &&
fictioneer_show_auth_content() &&
(
get_option( 'fictioneer_enable_checkmarks' ) ||
get_option( 'fictioneer_enable_follows' ) ||
get_option( 'fictioneer_enable_reminders' )
)
) {
$output['bookshelf'] = sprintf(
'<a href="%s" rel="noopener noreferrer nofollow"><i class="fa-solid fa-list mobile-menu__item-icon"></i> %s</a>',
esc_url( $bookshelf_link ),

View File

@ -274,7 +274,10 @@ function fictioneer_ajax_get_finished_checkmarks_list() {
$navigation .= '</li>';
} elseif ( $page > 1 ) {
$navigation = '<li class="pagination bookshelf-pagination _checkmarks"><button class="page-numbers" data-page="1">' . __('First Page', 'fictioneer') . '</button></li>';
$navigation = sprintf(
'<li class="pagination bookshelf-pagination _checkmarks"><button class="page-numbers" data-page="1">%s</button></li>',
__( 'First Page', 'fictioneer' )
);
}
// Send result

View File

@ -432,7 +432,10 @@ function fictioneer_ajax_get_follows_list() {
$navigation .= '</li>';
} elseif ( $page > 1 ) {
$navigation = '<li class="pagination bookshelf-pagination _follows"><button class="page-numbers" data-page="1">' . __('First Page', 'fictioneer') . '</button></li>';
$navigation = sprintf(
'<li class="pagination bookshelf-pagination _follows"><button class="page-numbers" data-page="1">%s</button></li>',
__( 'First Page', 'fictioneer' )
);
}
// Send result

View File

@ -200,8 +200,10 @@ function fictioneer_ajax_get_reminders_list() {
$navigation .= '</li>';
} elseif ( $page > 1 ) {
wp_die();
$navigation = '<li class="pagination bookshelf-pagination _reminders"><button class="page-numbers" data-page="1">' . __('First Page', 'fictioneer') . '</button></li>';
$navigation = sprintf(
'<li class="pagination bookshelf-pagination _reminders"><button class="page-numbers" data-page="1">%s</button></li>',
__( 'First Page', 'fictioneer' )
);
}
// Send result