WordPress.org

Making WordPress.org

Changeset 3863


Ignore:
Timestamp:
08/26/16 20:34:01 (16 months ago)
Author:
obenland
Message:

Plugin Directory: Use Reviews output instead of rolling our own.

Returns two reviews with the proper markup. We should review what we want the
final output to be here.

Also passes the section slug as a second parameter to the_content filter
for more context, similarly to the Plugin Directory theme..

See #1579, #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php

    r3496 r3863  
    11<?php 
    22namespace WordPressdotorg\Plugin_Directory\API\Routes; 
     3use WordPressdotorg\Plugin_Directory\Shortcodes\Reviews; 
    34use WordPressdotorg\Plugin_Directory\Plugin_Directory; 
    45use WordPressdotorg\Plugin_Directory\Template; 
     
    9697        $_pages = preg_split( "#<!--section=(.+?)-->#", $post->post_content, - 1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); 
    9798        for ( $i = 0; $i < count( $_pages ); $i += 2 ) { 
    98             $result['sections'][ $_pages[ $i ] ] = apply_filters( 'the_content', $_pages[ $i + 1 ] ); 
    99         } 
    100         $result['sections']['reviews'] = $this->get_plugin_reviews_markup( $post->post_name ); 
     99            $result['sections'][ $_pages[ $i ] ] = apply_filters( 'the_content', $_pages[ $i + 1 ], $_pages[ $i ] ); 
     100        } 
     101        $result['sections']['reviews'] = Reviews::display(); 
    101102        $result['description'] = $result['sections']['description']; 
    102103 
Note: See TracChangeset for help on using the changeset viewer.