Changeset 2886954
- Timestamp:
- 03/25/2023 11:56:33 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sheet-music-library/trunk/template/template-filters.php
r2270479 r2886954 2 2 /** 3 3 * Filter functions for sheet music library fields for theme-compat. 4 5 4 6 */ 5 7 … … 91 93 <div class="piece single-piece"> 92 94 <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 ); ?> 94 96 <div class="taxonomy-box"> 95 97 <p><?php the_terms( get_the_ID(), 'composer', __( 'Composer: ', 'sheet-music-library' ), ', ' ); ?></p> … … 118 120 } ?> 119 121 </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 ); ?> 121 123 </div> 122 124 </div> … … 129 131 } 130 132 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 <?php147 }148 133 149 134 // Filter post titles in archive contexts … … 220 205 } 221 206 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 <?php235 $output = trim( ob_get_contents() );236 ob_end_clean();237 238 return $output;239 }240 241 207 // Display a collection of pieces in a table 242 208 // @param pieces Array of WP_Post objects.
Note: See TracChangeset
for help on using the changeset viewer.