Plugin Directory

Changeset 2120393


Ignore:
Timestamp:
07/10/2019 01:17:04 AM (7 years ago)
Author:
nikolam
Message:

Fix not getting the real latest series image via "latest_series" shortcode

Location:
sermon-manager-for-wordpress/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sermon-manager-for-wordpress/trunk/includes/class-sm-shortcodes.php

    r2028753 r2120393  
    631631        switch ( $default_orderby ) {
    632632            case 'date_preached':
     633            case 'date':
    633634                $query_args += array(
    634635                    'orderby'      => 'meta_value_num',
  • sermon-manager-for-wordpress/trunk/includes/sm-template-functions.php

    r2118409 r2120393  
    1313     * Include template files.
    1414     */
    15     if ( ! \SermonManager::getOption( 'theme_compatibility' ) ) {
    16         add_filter( 'template_include', function ( $template ) {
    17             return sm_get_views_path( $template );
    18         } );
     15    if ( ! SermonManager::getOption( 'theme_compatibility' ) ) {
     16        add_filter(
     17            'template_include',
     18            function ( $template ) {
     19                return sm_get_views_path( $template );
     20            }
     21        );
    1922    }
    2023
     
    3942
    4043    add_filter( 'the_content', 'add_wpfc_sermon_content' );
    41     if ( ! \SermonManager::getOption( 'disable_the_excerpt' ) ) {
     44    if ( ! SermonManager::getOption( 'disable_the_excerpt' ) ) {
    4245        add_filter( 'the_excerpt', 'add_wpfc_sermon_content' );
    4346    }
     
    4952 * @param array $args Display options. See the 'sermon_sort_fields' shortcode for array items.
    5053 *
     54 * @return string The HTML.
     55 *
    5156 * @see   WPFC_Shortcodes->displaySermonSorting()
    52  *
    53  * @return string The HTML.
    5457 *
    5558 * @since 2.5.0 added $args
     
    6164
    6265    // Filters HTML fields data.
    63     $filters = apply_filters( 'render_wpfc_sorting_filters', array(
     66    $filters = apply_filters(
     67        'render_wpfc_sorting_filters',
    6468        array(
    65             'className' => 'sortPreacher',
    66             'taxonomy'  => 'wpfc_preacher',
    67             'title'     => sm_get_taxonomy_field( 'wpfc_preacher', 'singular_name' ),
    68         ),
     69            array(
     70                'className' => 'sortPreacher',
     71                'taxonomy'  => 'wpfc_preacher',
     72                'title'     => sm_get_taxonomy_field( 'wpfc_preacher', 'singular_name' ),
     73            ),
     74            array(
     75                'className' => 'sortSeries',
     76                'taxonomy'  => 'wpfc_sermon_series',
     77                'title'     => __( 'Series', 'sermon-manager-for-wordpress' ),
     78            ),
     79            array(
     80                'className' => 'sortTopics',
     81                'taxonomy'  => 'wpfc_sermon_topics',
     82                'title'     => __( 'Topic', 'sermon-manager-for-wordpress' ),
     83            ),
     84            array(
     85                'className' => 'sortBooks',
     86                'taxonomy'  => 'wpfc_bible_book',
     87                'title'     => __( 'Book', 'sermon-manager-for-wordpress' ),
     88            ),
     89            array(
     90                'className' => 'sortServiceTypes',
     91                'taxonomy'  => 'wpfc_service_type',
     92                'title'     => sm_get_taxonomy_field( 'wpfc_service_type', 'singular_name' ),
     93            ),
     94        )
     95    );
     96
     97    $visibility_mapping = apply_filters(
     98        'render_wpfc_sorting_visibility_mapping',
    6999        array(
    70             'className' => 'sortSeries',
    71             'taxonomy'  => 'wpfc_sermon_series',
    72             'title'     => __( 'Series', 'sermon-manager-for-wordpress' ),
    73         ),
    74         array(
    75             'className' => 'sortTopics',
    76             'taxonomy'  => 'wpfc_sermon_topics',
    77             'title'     => __( 'Topic', 'sermon-manager-for-wordpress' ),
    78         ),
    79         array(
    80             'className' => 'sortBooks',
    81             'taxonomy'  => 'wpfc_bible_book',
    82             'title'     => __( 'Book', 'sermon-manager-for-wordpress' ),
    83         ),
    84         array(
    85             'className' => 'sortServiceTypes',
    86             'taxonomy'  => 'wpfc_service_type',
    87             'title'     => sm_get_taxonomy_field( 'wpfc_service_type', 'singular_name' ),
    88         ),
    89     ) );
    90 
    91     $visibility_mapping = apply_filters( 'render_wpfc_sorting_visibility_mapping', array(
    92         'wpfc_sermon_topics' => 'hide_topics',
    93         'wpfc_sermon_series' => 'hide_series',
    94         'wpfc_preacher'      => 'hide_preachers',
    95         'wpfc_bible_book'    => 'hide_books',
    96         'wpfc_service_type'  => 'hide_service_types',
    97         'wpfc_dates'         => 'hide_dates',
    98     ) );
     100            'wpfc_sermon_topics' => 'hide_topics',
     101            'wpfc_sermon_series' => 'hide_series',
     102            'wpfc_preacher'      => 'hide_preachers',
     103            'wpfc_bible_book'    => 'hide_books',
     104            'wpfc_service_type'  => 'hide_service_types',
     105            'wpfc_dates'         => 'hide_dates',
     106        )
     107    );
    99108
    100109    // Save orig args for filters.
     
    139148     * Allows to filter filtering args.
    140149     *
    141      * @since 2.13.5
    142      * @since 2.15.0 - add other args, except $args.
    143      *
    144150     * @param array  $args               The args.
    145151     * @param array  $orig_args          The unmodified args.
     
    147153     * @param array  $filters            Filters HTML form data. i.e. no idea.
    148154     * @param array  $visibility_mapping Taxonomy slug -> args parameter name
     155     *
     156     * @since 2.15.0 - add other args, except $args.
     157     *
     158     * @since 2.13.5
    149159     */
    150160    $args = apply_filters( 'sm_render_wpfc_sorting_args', $args, $orig_args, $action, $filters, $visibility_mapping );
     
    154164    /**
    155165     * Allows to skip rendering of filtering completely.
    156      *
    157      * @since 2.13.5
    158      * @since 2.15.0 - add other parameters, except $hide_filters.
    159166     *
    160167     * @param bool   $hide_filters       True to show, false to hide. Default as it is defined in settings.
     
    164171     * @param array  $filters            Filters HTML form data. i.e. no idea.
    165172     * @param array  $visibility_mapping Taxonomy slug -> args parameter name
     173     *
     174     * @since 2.13.5
     175     * @since 2.15.0 - add other parameters, except $hide_filters.
    166176     */
    167177    if ( apply_filters( 'sm_render_wpfc_sorting', $hide_filters, $args, $orig_args, $action, $filters, $visibility_mapping ) ) {
    168         $content = wpfc_get_partial( 'content-sermon-filtering', array(
    169             'action'             => $action,
    170             'filters'            => $filters,
    171             'visibility_mapping' => $visibility_mapping,
    172             'args'               => $args,
    173         ) );
     178        $content = wpfc_get_partial(
     179            'content-sermon-filtering',
     180            array(
     181                'action'             => $action,
     182                'filters'            => $filters,
     183                'visibility_mapping' => $visibility_mapping,
     184                'args'               => $args,
     185            )
     186        );
    174187    } else {
    175188        $content = '';
     
    271284 *                       false to disable auto detection.
    272285 *
     286 * @return string Video player HTML.
     287 * @since 2.12.3 added $seek
     288 *
    273289 * @since 2.11.0
    274  * @since 2.12.3 added $seek
    275  *
    276  * @return string Video player HTML.
    277290 */
    278291function wpfc_render_video( $url = '', $seek = true ) {
     
    289302    }
    290303
    291     $player = strtolower( \SermonManager::getOption( 'player' ) ?: 'plyr' );
     304    $player = strtolower( SermonManager::getOption( 'player' ) ?: 'plyr' );
    292305
    293306    if ( strtolower( 'WordPress' ) === $player ) {
     
    344357 * @param int        $seek   Seek to specific second in audio file.
    345358 *
     359 * @return string|false Audio player HTML or false if sermon has no audio.
     360 * @since 2.15.15 The sermon can be used as first parameter
     361 *
    346362 * @since 2.12.3 added $seek
    347  * @since 2.15.15 The sermon can be used as first parameter
    348  *
    349  * @return string|false Audio player HTML or false if sermon has no audio.
    350363 */
    351364function wpfc_render_audio( $source = '', $seek = null ) {
     
    381394
    382395    // Get the current player.
    383     $player = strtolower( \SermonManager::getOption( 'player' ) ?: 'plyr' );
     396    $player = strtolower( SermonManager::getOption( 'player' ) ?: 'plyr' );
    384397
    385398    switch ( strtolower( $player ) ) {
     
    534547    $html = '';
    535548
    536     $terms = get_terms( array(
    537         'taxonomy'   => $taxonomy,
    538         'hide_empty' => false, // todo: add option to disable/enable this globally.
    539     ) );
    540 
    541     if ( 'wpfc_bible_book' === $taxonomy && \SermonManager::getOption( 'sort_bible_books', true ) ) {
     549    $terms = get_terms(
     550        array(
     551            'taxonomy'   => $taxonomy,
     552            'hide_empty' => false, // todo: add option to disable/enable this globally.
     553        )
     554    );
     555
     556    if ( 'wpfc_bible_book' === $taxonomy && SermonManager::getOption( 'sort_bible_books', true ) ) {
    542557        // Book order.
    543558        $books = array(
     
    720735 * Returns SM template path.
    721736 *
    722  * @param string $template
     737 * @param string $template The template.
    723738 *
    724739 * @return string The template path.
     
    734749        $term = get_queried_object();
    735750
    736         if ( is_tax( array(
    737             'wpfc_preacher',
    738             'wpfc_sermon_series',
    739             'wpfc_sermon_topics',
    740             'wpfc_bible_book',
    741             'wpfc_service_type',
    742         ) ) ) {
     751        if ( is_tax(
     752            array(
     753                'wpfc_preacher',
     754                'wpfc_sermon_series',
     755                'wpfc_sermon_topics',
     756                'wpfc_bible_book',
     757                'wpfc_service_type',
     758            )
     759        ) ) {
    743760            $default_file = 'taxonomy-' . $term->taxonomy . '.php';
    744761
  • sermon-manager-for-wordpress/trunk/readme.txt

    r2118409 r2120393  
    129129* Fix: Vimeo videos not seeking to the predefined timestamp
    130130* Fix: Preacher label not being replaced everywhere
     131* Fix: Not getting the real latest series image via "latest_series" shortcode
    131132* Dev: Add a filter to disable sidebar on supported themes
    132133
Note: See TracChangeset for help on using the changeset viewer.