Skip to content

Commit bd05fa8

Browse files
Body Class
1 parent 51a0839 commit bd05fa8

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

addons/auto-pagination/auto-pagination-functions.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,34 @@ public function remove_nextpage() {
6060
global $post, $sh_page_links;
6161

6262
if (!$post->post_content || $post->post_content == '')
63-
return;
64-
63+
return;
64+
6565
$options = $sh_page_links->get_options();
66-
$auto_options = $options['auto_pagination'];
6766

6867
$option = get_post_meta($post->ID,"single_override_pagination",true);
69-
$ignore = false;
70-
if ($option == false || $option == "default") {
71-
if ($auto_options['inline_nextpage'] == 1)
68+
$ignore = false;
69+
70+
if ($option == false || $option == "default" || $option == '') {
71+
if (isset($options['auto_pagination']) && $options['auto_pagination'] == 1)
7272
$ignore = true;
7373
} else {
7474
if ($option == "ignore")
7575
$ignore = true;
76-
}
77-
if ($ignore)
78-
$post->post_content = str_replace("<!--nextpage-->", "", $post->post_content);
79-
else
80-
$post->post_content = str_replace("<!--nextpage-->", "<!--sh_nextpage-->", $post->post_content);
76+
}
77+
78+
if ($ignore) {
79+
$post->post_content = str_replace("<!--nextpage-->", "", $post->post_content);
80+
} else {
81+
$post->post_content = str_replace("<!--nextpage-->", "<!--sh_nextpage-->", $post->post_content);
82+
}
83+
84+
if (get_post_meta( $post->ID, 'single_not_paginate', true ) != 'yes') {
85+
add_filter('body_class', function($classes){
86+
$classes[] = 'plp-on';
87+
return $classes;
88+
});
89+
}
90+
8191
}
8292

8393
public function pagination_metabox() {

0 commit comments

Comments
 (0)