@@ -98,16 +98,25 @@ public function pagination_metabox_render($post) {
9898 <option value="ignore" <?php if ($ value == "ignore " ) echo "SELECTED " ; ?> ><?php _e ("Ignore inline <!--nextpage--> tags. " , SH_PAGE_LINKS_DOMAIN ); ?> </option>
9999 <option value="noignore" <?php if ($ value == "noignore " ) echo "SELECTED " ; ?> ><?php _e ("Accomodate inline <!--nextpage--> tags. " , SH_PAGE_LINKS_DOMAIN ); ?> </option>
100100 </select>
101+ <br /><br />
102+ <?php
103+ $ value = get_post_meta ($ post ->ID ,"single_not_paginate " ,true );
104+ $ postType = get_post_type_object (get_post_type ($ post ));
105+ $ ptype = '' ;
106+ if ($ postType )
107+ $ ptype = $ postType ->labels ->singular_name ;
108+ ?>
109+ <input type="checkbox" id="single_not_paginate" name="single_not_paginate" value="yes" <?php checked ( 'yes ' , $ value , true ); ?> /><label for="single_not_paginate"><?php _e ("Don't paginate this " , SH_PAGE_LINKS_DOMAIN ); echo ' ' . strtolower ($ ptype ); ?> </label>
101110 <?php
102111 }
103112
104113 public function pagination_metabox_render_save ($ post_id ) {
105- global $ post ;
106114
107115 if ( ! isset ( $ _POST ['pagination_override ' ] ) || ! wp_verify_nonce ( $ _POST ['pagination_override ' ], plugin_basename ( __FILE__ ) ) )
108116 return ;
109117
110- update_post_meta ($ post ->ID , 'single_override_pagination ' , $ _POST ['single_override_pagination ' ]);
118+ update_post_meta ($ post_id , 'single_override_pagination ' , $ _POST ['single_override_pagination ' ]);
119+ update_post_meta ($ post_id , 'single_not_paginate ' , $ _POST ['single_not_paginate ' ]);
111120 }
112121
113122
@@ -150,6 +159,11 @@ public function generate_excerpt($text) {
150159 */
151160 public function add_pagination ($ content ) {
152161 global $ sh_page_links , $ auto_paged , $ post , $ sh_single_view , $ pages_count ;
162+
163+ //Check if is set to ignore pagination
164+ if (get_post_meta ( $ post ->ID , 'single_not_paginate ' , true ) == 'yes ' )
165+ return $ content ;
166+
153167 $ options = $ sh_page_links ->get_options ();
154168
155169 $ content = str_replace ("<!--nextpage--> " , "" , $ content );
@@ -310,23 +324,23 @@ public function get_pages($content, $options = false) {
310324 if ($ break_on < 1 )
311325 $ break_on == 1 ;
312326 $ excess = $ paragraph_count %$ page_count ;
313- $ modified_exploded_content = $ array ;
327+ $ modified_exploded_content = array () ;
314328 foreach ($ content_pages as $ page ) {
315329 $ i ++;
316330 if ($ i > $ break_on ) {
317331 if ($ excess > 0 ) {
318332 $ excess --;
319- $ modified_exploded_content [$ j ] . = $ page . "\n<!--sh_nextpage--> " ;
333+ $ modified_exploded_content [$ j ] = $ page . "\n<!--sh_nextpage--> " ;
320334 $ j ++;
321335 $ i = 0 ;
322336 continue ;
323337 } else {
324- $ modified_exploded_content [$ j ] . = "\n<!--sh_nextpage--> " ;
338+ $ modified_exploded_content [$ j ] = "\n<!--sh_nextpage--> " ;
325339 }
326340 $ i = 1 ;
327341 $ j ++;
328342 }
329- $ modified_exploded_content [$ j ] . = $ page ;
343+ $ modified_exploded_content [$ j ] = $ page ;
330344 }
331345
332346 } elseif ($ options ['break_type ' ] == 2 ) {
0 commit comments