Plugin Directory

Changeset 2886954

Timestamp:
03/25/2023 11:56:33 PM (17 months ago)
Author:
celloexpressions
Message:

Sheet Music Library: Update template filters to reference template parts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sheet-music-library/trunk/template/template-filters.php

    r2270479 r2886954  
    22/**
    33 * Filter functions for sheet music library fields for theme-compat.
     4
     5
    46 */
    57
     
    9193    <div class="piece single-piece">
    9294         <div class="piece-meta wp-caption alignright">
    93             <?php sml_sheet_music_download_box( $score_url, $parts_url, $no_download_message ); ?>
     95            <?php sml_sheet_music_download_box( $score_url, $parts_url, $no_download_message ); ?>
    9496            <div class="taxonomy-box">
    9597                <p><?php the_terms( get_the_ID(), 'composer', __( 'Composer: ', 'sheet-music-library' ), ', ' ); ?></p>
     
    118120                } ?>
    119121            </div>
    120             <?php sml_sheet_music_download_box( $score_url, $parts_url, $no_download_message ); ?>
     122            <?php sml_sheet_music_download_box( $score_url, $parts_url, $no_download_message ); ?>
    121123        </div>
    122124    </div>
     
    129131}
    130132
    131 // Display the download buttons and terms.
    132 function sml_sheet_music_download_box( $score_url, $parts_url, $no_download_message ) {
    133 ?>  <div class="download-box">
    134         <?php if ( $no_download_message ) {
    135             echo '<p class="piece-download-terms">' . $no_download_message . '</p>';
    136         } else {
    137             if ( $score_url ) : ?>
    138                 <a class="button" href="<?php echo $score_url; ?>" target="_blank"><?php _e( 'Download Score', 'sheet-music-library' ); ?></a>
    139             <?php endif;
    140             if ( $parts_url ) : ?>
    141                 <a class="button" href="<?php echo $parts_url; ?>" target="_blank"><?php _e( 'Download Parts', 'sheet-music-library' ); ?></a>
    142             <?php endif; ?>
    143             <p class="piece-download-terms"><?php echo get_option( 'sml_terms', __( 'By downloading this music, you agree to the <a href="/terms/">Terms & Conditions</a>.', 'sheet-music-library' ) ); ?></p>
    144         <?php } ?>
    145     </div>
    146 <?php
    147 }
    148133
    149134// Filter post titles in archive contexts
     
    220205}
    221206
    222 // Returns a search form based on the html5 version of `get_search_form()`, scoped to the sheet music post type.
    223 function sml_sheet_music_search_form() {
    224     ob_start();
    225     ?>
    226     <form role="search" method="get" class="search-form sheet-music-search-form" action="<?php echo home_url( '/' ); ?>">
    227         <label>
    228             <span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'sheet-music-library' ) ?></span>
    229             <input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'sheet-music-library' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'sheet-music-library' ) ?>" />
    230         </label>
    231         <input type="hidden" name="post_type" value="sheet_music" />
    232         <input type="submit" class="search-submit button" value="<?php echo esc_attr_x( 'Search', 'submit button', 'sheet-music-library' ) ?>" />
    233     </form>
    234     <?php
    235     $output = trim( ob_get_contents() );
    236     ob_end_clean();
    237 
    238     return $output;
    239 }
    240 
    241207// Display a collection of pieces in a table
    242208// @param pieces Array of WP_Post objects.
Note: See TracChangeset for help on using the changeset viewer.