Making WordPress.org


Ignore:
Timestamp:
03/27/2019 09:48:47 PM (6 years ago)
Author:
tellyworth
Message:

Plugin directory theme: show a list of registered blocks in the Description tab, if available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r8032 r8547  
    7979            $plugin_sections = Template::get_plugin_sections();
    8080
    81             foreach ( array( 'description', 'screenshots', 'installation', 'faq', 'reviews', 'developers', 'changelog' ) as $section_slug ) :
     81            foreach ( array( 'description', 'screenshots', 'blocks', 'installation', 'faq', 'reviews', 'developers', 'changelog' ) as $section_slug ) :
    8282                $section_content = '';
    8383
     
    8686                    $section_content = get_closed_plugin_notice();
    8787
     88                } elseif ( 'blocks' === $section_slug ) {
     89                    $section_content = get_post_meta( get_the_ID(), 'all_blocks', true );
    8890                } elseif ( ! in_array( $section_slug, [ 'screenshots', 'installation', 'faq', 'changelog' ], true ) || ! $is_closed ) {
    8991                    if ( isset( $content[ $section_slug ] ) ) {
     
    99101                $section = array_pop( $section );
    100102
    101                 get_template_part( 'template-parts/section' );
     103                if ( 'blocks' === $section_slug ) {
     104                    get_template_part( 'template-parts/section-blocks' );
     105                } else {
     106                    get_template_part( 'template-parts/section' );
     107                }
    102108            endforeach;
    103109        endif; // plugin_advanced.
Note: See TracChangeset for help on using the changeset viewer.