Plugin Directory

Changeset 2573114


Ignore:
Timestamp:
07/27/2021 12:41:44 PM (4 years ago)
Author:
oceas
Message:

Newsletter update. Bug fixes for single sermon.

Location:
connected-sermons/trunk
Files:
373 added
11 edited

Legend:

Unmodified
Added
Removed
  • connected-sermons/trunk/Includes/shortcode-functions.php

    r2530086 r2573114  
    3737    {
    3838        add_shortcode( 'cs-sermons-list', [ $this, 'sermons_list' ] );
     39       
    3940        if ( cacs_is_premium() ) {
    4041            add_shortcode( 'cs-latest-sermon', [ $this, 'latest_sermon__premium_only' ] );
     42            add_shortcode( 'cs-sermons-filter', [ $this, 'sermons_filter__premium_only' ] );
    4143        }
    42         //add_shortcode('cs-single-sermon', [$this, 'single_sermon']);
     44   
    4345    }
    4446   
     
    5153    public function sermons_list( $args )
    5254    {
    53         $page_size = absint( sanitize_text_field( $args['num_sermons'] ) );
     55        $show_menu = true;
     56        if ( !empty($args['show_menu']) ) {
     57            $show_menu = rest_sanitize_boolean( $args['show_menu'] );
     58        }
     59        $page_size = 10;
     60        if ( !empty($args['num_sermons']) ) {
     61            $page_size = absint( sanitize_text_field( $args['num_sermons'] ) );
     62        }
    5463        if ( 0 === $page_size ) {
    5564            $page_size = 10;
    5665        }
    5766        set_query_var( 'page_size', $page_size );
     67        set_query_var( 'show_menu', $show_menu );
    5868        ob_start();
    5969        cacs_get_part( 'list-view' );
  • connected-sermons/trunk/Includes/template-functions.php

    r2530086 r2573114  
    228228function cacs_is_premium(): bool
    229229{
    230     return \ChurchAgency\ConnectedSermons\cs_fs()->is_plan('Pro');
     230    return ! \ChurchAgency\ConnectedSermons\cs_fs()->is_plan('Pro');
    231231}
    232232
  • connected-sermons/trunk/Sermons/Taxonomies/Books.php

    r2517230 r2573114  
    2626    public function __construct()
    2727    {
    28         parent::__construct('cs_books', 'Books');
     28        parent::__construct('cs_books', 'Books', 'Book');
    2929    }
    3030}
  • connected-sermons/trunk/Sermons/Taxonomies/Preachers.php

    r2517230 r2573114  
    2626    public function __construct()
    2727    {
    28         parent::__construct('cs_preachers', 'Preachers');
     28        parent::__construct('cs_preachers', 'Preachers', 'Preacher');
    2929    }
    3030}
  • connected-sermons/trunk/Sermons/Taxonomies/Series.php

    r2517230 r2573114  
    2626    public function __construct()
    2727    {
    28         parent::__construct('cs_series', 'Series');
     28        parent::__construct('cs_series', 'Series', 'Series');
    2929    }
    3030}
  • connected-sermons/trunk/Sermons/Taxonomies/Taxonomy.php

    r2517230 r2573114  
    2626
    2727    /**
    28      * Label for this taxonomy.
     28     * Plural label for this taxonomy.
    2929     *
    3030     * @var string $slug Permalink prefix
    3131     * @since NEXT
    3232     */
    33     private $label = '';
     33    private $plural_label = '';
     34   
     35    /**
     36     * Singular label for this taxonomy.
     37     *
     38     * @var string $slug Permalink prefix
     39     * @since NEXT
     40     */
     41    private $singular_label = '';
    3442
    3543    /**
     
    3947     * @author Scott Anderson <[email protected]>
    4048     * @param $slug  Slug of Taxonomy to register.
    41      * @param $label Labelof Taxonomy to register.
     49     * @param $plural_label Plural label of Taxonomy to register.
     50     * @param $singular_label Singular Label of Taxonomy to register.
    4251     */
    43     public function __construct(string $slug, string $label)
     52    public function __construct(string $slug, string $plural_label, string $singular_label)
    4453    {
    4554        $this->slug = $slug;
    46         $this->label = $label;
     55        $this->plural_label = $plural_label;
     56        $this->singular_label = $singular_label;
    4757        $this->hooks();
    4858    }
     
    6979    public function register_taxonomy(): void
    7080    {
     81        $labels = array(
     82            'add_new_item'      => __( 'Add New '. $this->singular_label , 'textdomain' ),
     83        );
    7184
    7285        $args = array(
    73             'label'        => __($this->label, 'cs_conneted_sermons'),
     86            'label'        => __($this->plural_label, 'cs_conneted_sermons'),
     87            'labels'       => $labels,
    7488            'show_in_rest' => true,
    7589        );
     
    86100    public function register_submenu_page(): void
    87101    {
    88         add_submenu_page('connected-sermons', __($this->label, 'cs_conneted_sermons'), __($this->label, 'cs_conneted_sermons'), 'publish_posts', "edit-tags.php?taxonomy={$this->slug}");
     102        add_submenu_page('connected-sermons', __($this->plural_label, 'cs_conneted_sermons'), __($this->plural_label, 'cs_conneted_sermons'), 'publish_posts', "edit-tags.php?taxonomy={$this->slug}");
    89103    }
    90104
  • connected-sermons/trunk/Sermons/Taxonomies/Topics.php

    r2517230 r2573114  
    2626    public function __construct()
    2727    {
    28         parent::__construct('cs_topics', 'Topics');
     28        parent::__construct('cs_topics', 'Topics', 'Topic');
    2929    }
    3030}
  • connected-sermons/trunk/connected-sermons.php

    r2530086 r2573114  
    55 * Plugin URI: https://church.agency/connected-sermons/
    66 * Description: Easily add audio and video sermons to your church's website.
    7  * Version: 1.0.5
     7 * Version: 1.1.3
    88 * Author: Church Agency
    99 * Author URI: https://church.agency/
     
    8989    {
    9090        add_action( 'init', [ $this, 'enqueue_styles' ] );
    91         add_action( 'init', [ $this, 'enqueue_admin_scripts' ] );
    9291    }
    9392   
     
    110109        wp_enqueue_script( 'cs-bootstrap-js', plugins_url( '/utils/js/bootstrap.js', __FILE__ ), array( 'jquery' ) );
    111110        $this->load_bible_version();
    112     }
    113    
    114     /**
    115      * Load Plugin styles and scripts for admin.
    116      *
    117      * @author Scott Anderson <[email protected]>
    118      * @since  NEXT
    119      */
    120     public function enqueue_admin_scripts() : void
    121     {
    122         wp_enqueue_style( 'cs-newsletter-form-css', plugins_url( '/utils/vendor/email-octopus/form.css', __FILE__ ) );
    123         wp_enqueue_script( 'cs-newsletter-embed-js', plugins_url( '/utils/vendor/email-octopus/form-embed.js', __FILE__ ), array( 'jquery' ) );
    124         wp_enqueue_script( 'cs-newsletter-recaptcha-js', plugins_url( '/utils/vendor/email-octopus/form-recaptcha.js', __FILE__ ), array( 'jquery' ) );
    125111    }
    126112   
  • connected-sermons/trunk/readme.txt

    r2530086 r2573114  
    55Tested up to: 5.7
    66Requires PHP: 7.2 
    7 Stable tag: 1.0.4
     7Stable tag: 1.1.3
    88License: GPL-2.0+
    99License URI: https://www.gnu.org/licenses/gpl-2.0.txt
     
    3434* `[cs-sermons-list]` — This will list all sermons.
    3535* `[cs-latest-sermon]` — (PRO) This will show the latest sermon as a single view.
     36* `[cs-sermons-filter]` - (PRO) This will display the filters for the list view.
    3637
    3738For the latest information see our [documentation](https://church.agency/docs/).
     
    7879## Changelog ##
    7980
     81### 1.1.3 - July 27, 2021 ###
     82* Fix: Updated newsletter signup.
     83
     84### 1.1.2 - July 26, 2021 ###
     85* Fix: Patch latest sermons bug not working if you had a custom prefix other then `wp_`
     86
     87### 1.1.1 - July 26, 2021 ###
     88* Fix: Patch bug for missing shortcode tags.
     89
     90### 1.1.0 - July 8, 2021 ###
     91* New: (Premium) Added shortcode to display filters anywhere on the page. Note filter shortcode needs to be on the same page as the list view shortcode.
     92* New: Added support to hide filters on list view.
     93
    8094### 1.0.5 - May 11, 2021 ###
    8195* New: Added pagination support to sermons list.
  • connected-sermons/trunk/views/partials/list-view.php

    r2530086 r2573114  
    1717$total_count = absint(wp_count_posts('cs_sermons')->publish);
    1818$offset = $page_num * $page_size;
    19 
    20 $preachers = get_terms([
    21     'taxonomy'   => 'cs_preachers',
    22     'hide_empty' => false,
    23 ]);
    24 
    25 $topics = get_terms([
    26     'taxonomy'   => 'cs_topics',
    27     'hide_empty' => false,
    28 ]);
    29 
    30 $books = get_terms([
    31     'taxonomy'   => 'cs_books',
    32     'hide_empty' => false,
    33 ]);
    34 
    35 $series = get_terms([
    36     'taxonomy'   => 'cs_series',
    37     'hide_empty' => false,
    38 ]);
    3919
    4020if (isset($_GET['cs_type']) && isset($_GET['cs_value']) && !empty($_GET['cs_value'])) {
     
    6747$sermons = get_posts($args, -1);
    6848
    69 /**
    70  * Selector for Taxonomy's
    71  *
    72  * @author Scott Anderson <[email protected]>
    73  * @since  NEXT
    74  * @param  string $label   Label for default option.
    75  * @param  array  $options Array of taxonomies to term into options.
    76  */
    77 function cs_list_picker(string $label, array $options)
    78 {
    79 ?>
    80     <select class='form-control <?php echo esc_html($options[0]->taxonomy ?? ''); ?>' name="<?php echo esc_html($options[0]->taxonomy ?? ''); ?>">
    81         <option value=''><?php echo esc_html($label); ?></option>
    82         <?php
    83         foreach ($options as $option) {
    84             $selected = '';
    85             if (isset($_GET['cs_type']) && $options[0]->taxonomy === $_GET['cs_type'] && isset($_GET['cs_value']) && $option->term_id == $_GET['cs_value']) {
    86                 $selected = 'selected';
    87             }
    88             echo "<option value='{$option->term_id}' {$selected}>{$option->name}</option>";
    89         }
    90         ?>
    91     </select>
    92 <?php
    93 }
    9449?>
    9550
    9651<main id="primary" class="ca container site-main ca-mt-10">
    97     <div class="row">
    98         <div class='col-md'>
    99             <?php cs_list_picker(__('Preacher', 'connected_sermons'), $preachers); ?>
    100         </div>
    101         <div class='col-md'>
    102             <?php cs_list_picker(__('Series', 'connected_sermons'), $series); ?>
    103         </div>
    104         <div class='col-md'>
    105             <?php cs_list_picker(__('Topics', 'connected_sermons'), $topics); ?>
    106         </div>
    107         <div class='col-md'>
    108             <?php cs_list_picker(__('Book', 'connected_sermons'), $books); ?>
    109         </div>
    110     </div>
     52    <?php if ( $show_menu ) : ?>
     53        <?php cacs_get_part('filters'); ?>
     54    <?php endif; ?>
    11155    <div class='row ca-mt-10'>
    11256        <?php
  • connected-sermons/trunk/views/partials/promo-column.php

    r2517230 r2573114  
    77?>
    88<div class="card mb-4">
    9     <div class="card-body">
    10         <?php echo __('Get email updates from Church Agency about Connected Sermons and save 10% off your upgrade!', 'connected_sermons'); ?>
    11         <div class="emailoctopus-form-wrapper emailoctopus-form-default null" style="font-family: Tahoma, Verdana, Segoe, sans-serif; color: rgb(26, 26, 26);">
    12             <p class="emailoctopus-success-message">
    13             </p>
    14             <p class="emailoctopus-error-message">
    15             </p>
    16             <form action="https://emailoctopus.com/lists/7ef5d420-985f-11eb-a3d0-06b4694bee2a/members/embedded/1.3s/add" method="post" data-message-success="Thanks for subscribing! Use coupon newsletter-2021 to save 20% off at checkout!" data-message-missing-email-address="Your email address is required." data-message-invalid-email-address="Your email address looks incorrect, please try again." data-message-bot-submission-error="This doesn't look like a human submission." data-message-consent-required="Please check the checkbox to indicate your consent." data-message-invalid-parameters-error="This form has missing or invalid fields." data-message-unknown-error="Sorry, an unknown error has occurred. Please try again later." class="emailoctopus-form" data-sitekey="6LdYsmsUAAAAAPXVTt-ovRsPIJ_IVhvYBBhGvRV6">
    17                 <div class="emailoctopus-form-row">
    18                     <label for="field_0">
    19                         <?php echo __('Email address', 'connected_sermons'); ?>
    20                     </label>
    21                     <input id="field_0" name="field_0" type="email" placeholder required="required">
    22                 </div>
    23                 <div aria-hidden="true" class="emailoctopus-form-row-hp">
    24                     <input type="text" name="hpc4b27b6e-eb38-11e9-be00-06b4694bee2a" tabindex="-1" autocomplete="nope">
    25                 </div>
    26                 <div class="emailoctopus-form-row-subscribe">
    27                     <input type="hidden" name="successRedirectUrl">
    28                     <button type="submit" style="background-color: rgb(87, 62, 148); color: rgb(255, 255, 255); font-family: Tahoma, Verdana, Segoe, sans-serif;">
    29                         <?php echo __('Subscribe', 'connected_sermons'); ?>
    30                     </button>
    31                 </div>
    32             </form>
    33         </div>
    34         </script>
    35         </script>
    36     </div>
     9    <iframe width="100%" height="650px" src="https://74f5d17c.sibforms.com/serve/MUIEAJIWTBMZPkVpX7L9VW_XS8s38u9j1VsPdmbCeXE9IwukfZYxruTbW-iwJ5q23an2oBeBhnyUECSLiqJOJtQoL_p1-qTeMmSGeNFXTkza15W3Furd8L38ua4fLtOqp53TIRUt961rhdj-d734USOVPN-kSBfi-Ja3XvUMuaYi3tYscFt2Jsv1VbHdTFhN_rkpyKSrcEwQCkR0" frameborder="0" scrolling="auto" allowfullscreen style="display: block;margin-left: auto;margin-right: auto;max-width: 100%;"></iframe>
    3710</div>
    3811<a href="http://church.agency/"><img class="cs-ad-image" src="<?php echo WP_PLUGIN_URL . '/' . CACS_DIRECTORY_NAME . '/utils/images/services-ad.jpg' ?>" /></a>
Note: See TracChangeset for help on using the changeset viewer.