WordPress.org

Making WordPress.org

Ticket #3319: link-to-faq.patch

File link-to-faq.patch, 838 bytes (added by joostdevalk, 3 years ago)

Patch

  • wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
    index a938062e..e24e225d 100644
    class Parser { 
    400400                        if ( $this->faq ) {
    401401                                $this->sections['faq'] .= "\n<dl>\n";
    402402                                foreach ( $this->faq as $question => $answer ) {
    403                                         $this->sections['faq'] .= "<dt>{$question}</dt>\n<dd>{$answer}</dd>\n";
     403                                        $question_slug = sanitize_title( $question );
     404                                        $this->sections['faq'] .= "<dt id='{$question_slug}'>{$question}</dt>\n<dd>{$answer}</dd>\n";
    404405                                }
    405406                                $this->sections['faq'] .= "\n</dl>\n";
    406407                        }