@@ -91,11 +91,11 @@ public static function sm_exclude_form() {
91
91
?>
92
92
<div style="margin-bottom:10px;">
93
93
<input type="checkbox" name="sm_sitemap_exclude" id="sm_sitemap_exclude"
94
- value="yes" <?php echo esc_attr ( $ sm_sitemap_exclude_cb_attr ) ?> >
94
+ value="yes" <?php echo esc_attr ( $ sm_sitemap_exclude_cb_attr ); ?> >
95
95
<label for="sm_sitemap_exclude">Display page name in sitemap without link</label>
96
96
</div>
97
97
<input type="checkbox" name="sm_sitemap_exclude_completely" id="sm_sitemap_exclude_completely"
98
- value="yes" <?php echo esc_attr ( $ sm_sitemap_exclude_completely_cb_attr ) ?> >
98
+ value="yes" <?php echo esc_attr ( $ sm_sitemap_exclude_completely_cb_attr ); ?> >
99
99
<label for="sm_sitemap_exclude_completely">Exclude this page from sitemap</label>
100
100
<?php
101
101
// Output nonce for verification on submit.
@@ -143,7 +143,10 @@ public static function sm_sitemap_exclude_save() {
143
143
public static function sm_pages_recursive ( $ parent_id , $ lvl ) {
144
144
$ output = '' ;
145
145
// get child pages.
146
- $ args = [ 'child_of ' => $ parent_id , 'parent ' => $ parent_id ];
146
+ $ args = [
147
+ 'child_of ' => $ parent_id ,
148
+ 'parent ' => $ parent_id ,
149
+ ];
147
150
$ pages = get_pages ( $ args );
148
151
149
152
if ( $ pages ) {
@@ -206,7 +209,11 @@ public static function sm_google_sitemap_recursive( $parent_id, $lvl ) {
206
209
// @codingStandardsIgnoreLine get_pages is fine to use ignore rule
207
210
$ the_pages = get_pages ( $ args );
208
211
209
- $ args = [ 'post_parent ' => $ parent_id , 'post_type ' => 'post ' , 'numberposts ' => - 1 ];
212
+ $ args = [
213
+ 'post_parent ' => $ parent_id ,
214
+ 'post_type ' => 'post ' ,
215
+ 'numberposts ' => - 1 ,
216
+ ];
210
217
211
218
// @codingStandardsIgnoreLine get_posts is fine to use ignore rule
212
219
$ the_posts = get_posts ( $ args );
@@ -242,6 +249,7 @@ public static function sm_google_sitemap_recursive( $parent_id, $lvl ) {
242
249
*/
243
250
public static function get_sm_google_sitemap () {
244
251
$ ouput = '<?xml version="1.0" encoding="UTF-8"?> ' . PHP_EOL ;
252
+ // extend output.
245
253
$ ouput .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> ' . PHP_EOL ;
246
254
$ ouput .= static ::sm_google_sitemap_recursive ( 0 , 0 ) . PHP_EOL ;
247
255
$ ouput .= '</urlset> ' . PHP_EOL ;
@@ -273,6 +281,7 @@ public static function sm_google_sitemap() {
273
281
*/
274
282
public static function sm_sitemap ( $ atts , $ content = null ) {
275
283
$ ouput = '<style> ' . PHP_EOL ;
284
+ // extend output.
276
285
$ ouput .= '#smSitemap h1,#smSitemap h2,#smSitemap h3,#smSitemap h4,#smSitemap h5,#smSitemap h6 { display:inline; } ' . PHP_EOL ;
277
286
$ ouput .= '</style> ' . PHP_EOL ;
278
287
$ ouput .= '<div id="smSitemap"> ' . static ::sm_pages_recursive ( 0 , 0 ) . '</div> ' . PHP_EOL ;
@@ -288,8 +297,8 @@ public static function sm_sitemap( $atts, $content = null ) {
288
297
* @return string
289
298
*/
290
299
public static function get_server_post_param ( $ key ) {
291
- if ( isset ( $ _POST [ $ key ], $ _POST ['sm_sitemap_nonce ' ] )
292
- && wp_verify_nonce ( sanitize_key ( $ _POST ['sm_sitemap_nonce ' ] ), plugin_basename ( __FILE__ ) ) ) {
300
+ if ( isset ( $ _POST [ $ key ], $ _POST ['sm_sitemap_nonce ' ] ) &&
301
+ wp_verify_nonce ( sanitize_key ( $ _POST ['sm_sitemap_nonce ' ] ), plugin_basename ( __FILE__ ) ) ) {
293
302
return sanitize_text_field ( wp_unslash ( $ _POST [ $ key ] ) );
294
303
} else {
295
304
return false ;
0 commit comments