Plugin Directory

Changeset 2625364


Ignore:
Timestamp:
11/06/2021 08:39:00 AM (4 years ago)
Author:
funnycat
Message:

fix PHP warning message

Location:
wp-sitemap-page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-sitemap-page/trunk/readme.txt

    r2620383 r2625364  
    102102== Changelog ==
    103103
     104= 1.9.1 =
     105* fix PHP warning message
    104106= 1.9.0 =
    105107* security improvement
  • wp-sitemap-page/trunk/wp-sitemap-page.php

    r2620383 r2625364  
    44Plugin URI:  http://tonyarchambeau.com/
    55Description: Add a sitemap on any page/post using the simple shortcode [wp_sitemap_page]
    6 Version:     1.9.0
     6Version:     1.9.1
    77Author:      Tony Archambeau
    88Author URI:  http://tonyarchambeau.com/
     
    473473 */
    474474function wsp_wp_sitemap_page_main_func( $atts, $content=null ) {
    475    
    476     // allow only specific HTML tags
    477     $str = strip_tags($str, '<a><br><strong><b><em><i><ul><li><h1><h2><h3><h4><h5><h6><p>');
    478     // escape HTML with WordPress function
    479     $arr_tag_a = array(
    480         'href' => array(),
    481         'title' => array(),
    482         'class' => array(),
    483         'style' => array()
    484     );
    485     $arr_tag_usual = array(
    486         'title' => array(),
    487         'class' => array(),
    488         'style' => array()
    489     );
    490     $arr = array(
    491         'a'  => $arr_tag_a,
    492         'br' => $arr_tag_usual,
    493         'strong' => $arr_tag_usual,
    494         'b'  => $arr_tag_usual,
    495         'em' => $arr_tag_usual,
    496         'i'  => $arr_tag_usual,
    497         'ul' => $arr_tag_usual,
    498         'li' => $arr_tag_usual,
    499         'h1' => $arr_tag_usual,
    500         'h2' => $arr_tag_usual,
    501         'h3' => $arr_tag_usual,
    502         'h4' => $arr_tag_usual,
    503         'h5' => $arr_tag_usual,
    504         'h6' => $arr_tag_usual,
    505         'p' => $arr_tag_usual,
    506     );
    507    
    508475    // return the content
    509     return '<div class="wsp-container">'.wsp_esc_some_html_tags(wsp_wp_sitemap_page_func( $atts, $content ), $arr).'</div>';
     476    return '<div class="wsp-container">'.wsp_esc_some_html_tags(wsp_wp_sitemap_page_func( $atts, $content )).'</div>';
    510477}
    511478add_shortcode( 'wp_sitemap_page', 'wsp_wp_sitemap_page_main_func' );
Note: See TracChangeset for help on using the changeset viewer.