Plugin Directory

Changeset 2121742


Ignore:
Timestamp:
07/11/2019 10:27:32 PM (7 years ago)
Author:
nikolam
Message:

Add a image size parameter for series image function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sermon-manager-for-wordpress/trunk/includes/sm-core-functions.php

    r2118409 r2121742  
    565565 * Gets sermon series image URL.
    566566 *
    567  * @param int $series_id ID of the series.
     567 * @param int          $series_id  ID of the series.
     568 * @param string|array $image_size The image size to get. Either a valid image size or array with width and height in
     569 *                                 pixels.
    568570 *
    569571 * @return string|null Image URL; null if image not set or invalid/not set series ID.
     
    571573 * @since 2.11.0
    572574 */
    573 function get_sermon_series_image_url( $series_id = 0 ) {
     575function get_sermon_series_image_url( $series_id = 0, $image_size = 'thumbnail' ) {
    574576    if ( ! ( is_int( $series_id ) && 0 !== $series_id ) ) {
    575577        return null;
     
    578580    $associations = sermon_image_plugin_get_associations();
    579581
    580     return ! empty( $associations[ $series_id ] ) ? wp_get_attachment_image_url( $associations[ $series_id ] ) : null;
     582    return ! empty( $associations[ $series_id ] ) ? wp_get_attachment_image_url( $associations[ $series_id ], $image_size ) : null;
    581583}
    582584
Note: See TracChangeset for help on using the changeset viewer.