Plugin Directory

Changeset 2489520


Ignore:
Timestamp:
03/08/2021 12:40:48 PM (5 years ago)
Author:
liveblogwp
Message:

Added option to override customizer settings on per post basis.

Location:
live-blog-wp/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • live-blog-wp/trunk/acf/acf.php

    r2489121 r2489520  
    1212
    1313            acf_add_local_field_group(array(
    14                 'key' => 'group_602140b531b74',
     14                'key' => 'group_live_blog_wp_post',
    1515                'title' => 'Live Blog WP',
    1616                'fields' => array(
    1717                    array(
    18                         'key' => 'field_6021413dc5343',
     18                        'key' => 'field_lbwp_attached_post',
    1919                        'label' => 'Attach to Post',
    2020                        'name' => 'lbwp_attached_post',
     
    3838                    ),
    3939                    array(
    40                         'key' => 'field_602402b41df9c',
     40                        'key' => 'field_lbwp_is_key_point',
    4141                        'label' => 'Key Point',
    4242                        'name' => 'lbwp_is_key_point',
     
    8181                'fields' => array(
    8282                    array(
    83                         'key' => 'field_60315b929b829',
     83                        'key' => 'field_lbwp_pinned_post',
    8484                        'label' => 'Pinned Post' . \Live_Blog_WP\Instance::instance()->pro_tag(),
    8585                        'name' => 'lbwp_pinned_post',
    8686                        'type' => 'post_object',
    87                         'instructions' => 'The pinned post is shown at the top the live blog feed, it updates at the same interval as the live blog but does not change position. It is a good place to show important information such as the current sports teams scores.',
     87                        'instructions' => 'The pinned post is shown at the top the live blog feed, it updates at the same interval as the live blog but does not change position.',
    8888                        'required' => 0,
    8989                        'conditional_logic' => 0,
     
    101101                        'return_format' => 'id',
    102102                        'ui' => 1,
     103                    ),
     104                    array(
     105                        'key' => 'field_lbwp_single_template',
     106                        'label' => 'Single Template',
     107                        'name' => 'lbwp_single_template',
     108                        'type' => 'select',
     109                        'instructions' => 'Force the use of a single template.',
     110                        'required' => 0,
     111                        'conditional_logic' => 0,
     112                        'wrapper' => array(
     113                            'width' => '',
     114                            'class' => '',
     115                            'id' => '',
     116                        ),
     117                        'choices' => array(
     118                            'global' => '-',
     119                            'full_width' => 'Full Width',
     120                            'sidebar' => 'Sidebar',
     121                        ),
     122                        'default_value' => 'global',
     123                        'allow_null' => 0,
     124                        'multiple' => 0,
     125                        'ui' => 0,
     126                        'return_format' => 'value',
     127                        'ajax' => 0,
     128                        'placeholder' => '',
     129                    ),
     130                    array(
     131                        'key' => 'field_lbwp_post_template',
     132                        'label' => 'Post Template',
     133                        'name' => 'lbwp_post_template',
     134                        'type' => 'select',
     135                        'instructions' => 'Force the use of a post template.',
     136                        'required' => 0,
     137                        'conditional_logic' => 0,
     138                        'wrapper' => array(
     139                            'width' => '',
     140                            'class' => '',
     141                            'id' => '',
     142                        ),
     143                        'choices' => array(
     144                            'global' => '-',
     145                            'card_1' => 'Card 1',
     146                            'card_2' => 'Card 2',
     147                        ),
     148                        'default_value' => 'global',
     149                        'allow_null' => 0,
     150                        'multiple' => 0,
     151                        'ui' => 0,
     152                        'return_format' => 'value',
     153                        'ajax' => 0,
     154                        'placeholder' => '',
     155                    ),
     156                    array(
     157                        'key' => 'field_lbwp_key_points',
     158                        'label' => 'Key Points',
     159                        'name' => 'lbwp_key_points',
     160                        'type' => 'select',
     161                        'instructions' => 'Show or hide key points.',
     162                        'required' => 0,
     163                        'conditional_logic' => 0,
     164                        'wrapper' => array(
     165                            'width' => '',
     166                            'class' => '',
     167                            'id' => '',
     168                        ),
     169                        'choices' => array(
     170                            'global' => '-',
     171                            'show' => 'Show',
     172                            'hide' => 'Hide',
     173                        ),
     174                        'default_value' => 'global',
     175                        'allow_null' => 0,
     176                        'multiple' => 0,
     177                        'ui' => 0,
     178                        'return_format' => 'value',
     179                        'ajax' => 0,
     180                        'placeholder' => '',
     181                    ),
     182                    array(
     183                        'key' => 'field_lbwp_headings',
     184                        'label' => 'Headings',
     185                        'name' => 'lbwp_headings',
     186                        'type' => 'select',
     187                        'instructions' => 'Show or hide post headings.',
     188                        'required' => 0,
     189                        'conditional_logic' => 0,
     190                        'wrapper' => array(
     191                            'width' => '',
     192                            'class' => '',
     193                            'id' => '',
     194                        ),
     195                        'choices' => array(
     196                            'global' => '-',
     197                            'show' => 'Show',
     198                            'hide' => 'Hide',
     199                        ),
     200                        'default_value' => 'global',
     201                        'allow_null' => 0,
     202                        'multiple' => 0,
     203                        'ui' => 0,
     204                        'return_format' => 'value',
     205                        'ajax' => 0,
     206                        'placeholder' => '',
    103207                    ),
    104208                ),
  • live-blog-wp/trunk/blocks/live-blog.js

    r2489121 r2489520  
    1 ( function( blocks, i18n, element ) {
     1( function( blocks, element ) {
    22    var el = element.createElement;
    3     var __ = i18n.__;
    43
    54    var blockStyle = {
     
    109
    1110    blocks.registerBlockType( 'lbwp/post', {
    12         title: __( 'Live Blog WP', 'lbwp' ),
     11        title: 'Live Blog WP',
    1312        icon: 'megaphone',
    1413        category: 'widgets',
     
    2221        }
    2322    } );
    24 } )( window.wp.blocks, window.wp.i18n, window.wp.element );
     23} )( window.wp.blocks, window.wp.element );
  • live-blog-wp/trunk/live-blog-wp.php

    r2489121 r2489520  
    44* Description: Turn any post into a real time auto updating live blog.
    55* Plugin URI:  https://liveblogwp.com
    6 * Version:     1.0.4
     6* Version:     1.0.5
    77* Author:      Live Blog WP
    88* Text Domain: lbwp
     
    2525    * Holds the plugins current version
    2626    */
    27     const VERSION = '1.0.4';
     27    const VERSION = '1.0.5';
    2828
    2929    /*
     
    3636    */
    3737    const MINIMUM_WP_VERSION = '5.0';
     38
     39    /*
     40    * A place to cache the stored options
     41    */
     42    public static $options = [];
    3843
    3944    /*
     
    132137        add_action( 'wp_head' , [ $this, 'output_customizer_css' ], 100 );
    133138
     139        // options
     140        self::$options = $this->get_options();
     141
    134142        // boradcast the plugin was loaded
    135143        do_action( 'lbwp/loaded' );
     
    137145    }
    138146
    139 
    140147    /*
    141148    * Handles the front end display of the gutenberg block
     
    149156            ob_start();
    150157
    151             if ( $options['single_template'] == 'full_width' ) {
     158            $local_template = get_field( 'lbwp_single_template', get_the_ID() );
     159
     160            // check for legacy templates having no value
     161            if ( empty( $local_template ) || $local_template == 'global' ) {
     162
     163                $single_template = $options['single_template'];
     164
     165            } else {
     166
     167                $single_template = $local_template;
     168
     169            }
     170
     171            // apply the selected template
     172            if ( $single_template == 'full_width' ) {
    152173
    153174                if ( class_exists( '\Live_Blog_WP_Pro\Single_Templates\Full_Width' ) ) {
     
    163184            }
    164185
    165             if ( $options['single_template'] == 'sidebar' ) {
     186            if ( $single_template == 'sidebar' ) {
    166187
    167188                if ( class_exists( '\Live_Blog_WP_Pro\Single_Templates\Sidebar' ) ) {
     
    195216            'lbwp-live-blog',
    196217            plugins_url( 'blocks/live-blog.js', __FILE__ ),
    197             array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
     218            array( 'wp-blocks', 'wp-element' ),
    198219            filemtime( plugin_dir_path( __FILE__ ) . 'blocks/live-blog.js' )
    199220        );
     
    274295        $return['has_error'] = false;
    275296        $return['child_ids'] = $child_ids;
     297
     298        /*
     299        * Check for pinned html
     300        */
     301        if ( $pinned_post = get_field( 'lbwp_pinned_post', $parent_id ) ) {
     302
     303            $return['pinned_html'] = apply_filters( 'the_content', get_the_content( '', false, $pinned_post ) );
     304
     305        }
    276306
    277307        // build the query arguemnts to try and get new posts
     
    289319
    290320        /*
    291         * Check for pinned html
    292         */
    293 
    294         if ( $pinned_post = get_field( 'lbwp_pinned_post', $parent_id ) ) {
    295 
    296             $return['pinned_html'] = apply_filters( 'the_content', get_the_content( '', false, $pinned_post ) );
    297 
    298         }
    299 
    300         /*
    301321        * Get any new posts since last check
    302322        */
    303 
    304323        $new_posts = get_posts( $new_posts_args );
    305324
     
    312331            $return['child_ids'] = array_merge( $child_ids, $new_posts );
    313332
     333            // check for local post template override
     334            $local_template = get_field( 'lbwp_post_template', $parent_id );
     335
     336            // check for legacy templates having no value
     337            if ( empty( $local_template ) || $local_template == 'global' ) {
     338
     339                $single_template = $options['post_template'];
     340
     341            } else {
     342
     343                $single_template = $local_template;
     344
     345            }
     346
    314347            // start buffering temaplate output
    315348            ob_start();
     
    319352                $wrapper_classes = [];
    320353
    321                 if ( $options['post_template'] == 'card_1' ) {
     354                if ( $single_template == 'card_1' ) {
    322355
    323356                    $wrapper_classes[] = 'lbwp-post-template-card-1-done';
     
    333366                }
    334367
    335                 if ( $options['post_template'] == 'card_2' ) {
     368                if ( $single_template == 'card_2' ) {
    336369
    337370                    $wrapper_classes[] = 'lbwp-post-template-card-2-done';
     
    532565            margin-bottom: <?php echo absint( $options['pinned_margin_bottom'] ); ?>px;
    533566        }
    534     </style>
    535 
    536     <?php
     567        </style>
     568
     569        <?php
     570
     571    }
     572
     573
     574    /*
     575    * Holds the defaults customizer options if they dont exist.
     576    */
     577    public function get_options() {
     578
     579        $defaults = array(
     580            'single_template' => 'full_width',
     581            'post_template' => 'card_1',
     582            'show_toolbar' => '1',
     583            'support_blog_page' => false,
     584            'support_blog_text' => 'SUPPORT',
     585            'get_posts_interval' => 60,
     586            'step_offset' => 65,
     587            'label_js_suffixAgo' => 'ago',
     588            'label_js_seconds' => 'less than a minute',
     589            'label_js_minute' => 'about a minute',
     590            'label_js_minutes' => '%d minutes',
     591            'label_js_hour' => 'about an hour',
     592            'label_js_hours' => 'about %d hours',
     593            'label_js_day' => 'about a day',
     594            'label_js_days' => '%d days',
     595            'label_js_month' => 'about a month',
     596            'label_js_months' => '%d months',
     597            'label_js_year' => 'about a year',
     598            'label_js_years' => '%d years',
     599            'toolbar_background_color' => '#1e87f0',
     600            'toolbar_icon_color' => '#ffffff',
     601            'toolbar_icon_hover_color' => '#e5e5e5',
     602            'toolbar_icon_size' => '1.2',
     603            'toolbar_border_color' => '#1e87f0',
     604            'toolbar_border_width' => '0',
     605            'toolbar_padding' => '15',
     606            'toolbar_box_shadow' => '0',
     607            'toolbar_z_index' => '980',
     608            'toolbar_offset' => '0',
     609            'toolbar_new_text' => 'NEW POSTS',
     610            'toolbar_new_text_size' => '18',
     611            'spinner_color' => '#1e87f0',
     612            'spinner_size' => '2',
     613            'show_points' => '1',
     614            'show_points_heading' => '1',
     615            'show_points_time' => '1',
     616            'points_text' => 'Key Points',
     617            'points_heading_tag' => 'h4',
     618            'points_columns' => 'uk-child-width-1-3@m',
     619            'points_link_tag' => 'h5',
     620            'points_time_color' => '#000000',
     621            'points_link_color' => '#1e87f0',
     622            'points_link_hover_color' => '#1e87f0',
     623            'points_margin_bottom' => '5',
     624            'points_wrap_margin_bottom' => '15',
     625            'show_alert' => '1',
     626            'force_show_alert' => '0',
     627            'alert_text' => 'NEW POSTS',
     628            'alert_tag' => 'div',
     629            'alert_background_color' => '#ffffff',
     630            'alert_text_color' => '#000000',
     631            'alert_text_hover_color' => '#000000',
     632            'alert_border_color' => '#000000',
     633            'alert_border_width' => '1',
     634            'alert_top_bottom_padding' => '10',
     635            'alert_left_right_padding' => '20',
     636            'alert_box_shadow' => '0',
     637            'alert_position' => 'uk-position-bottom-right',
     638            'tab_text' => '(NEW POSTS)',
     639            'show_pinned' => '0',
     640            'pinned_margin_bottom' => '20',
     641            'template_card_1_avatars' => '1',
     642            'template_card_1_authors' => '1',
     643            'template_card_1_author_prefix' => '',
     644            'template_card_1_headings' => '0',
     645            'template_card_1_heading_tag' => 'h4',
     646            'template_card_1_background_color' => '#ffffff',
     647            'template_card_1_border_color' => '#ffffff',
     648            'template_card_1_border_width' => '0',
     649            'template_card_1_icon_color' => '#000000',
     650            'template_card_1_icon_hover_color' => '#1e87f0',
     651            'template_card_1_icon_size' => '1.2',
     652            'template_card_1_time_color' => '#000000',
     653            'template_card_1_author_color' => '#000000',
     654            'template_card_1_box_shadow' => '0',
     655            'template_card_1_padding' => '0',
     656            'template_card_1_margin_bottom' => '20',
     657            'template_card_1_time_size' => '14',
     658            'template_card_1_author_size' => '14',
     659
     660        );
     661
     662        return wp_parse_args( get_option( 'lbwp_options' ), $defaults );
     663
     664    }
     665
     666    /*
     667    * Warning when the site doesn't have a minimum required PHP version.
     668    */
     669    public function admin_notice_minimum_php_version() {
     670
     671        if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
     672
     673        $message = sprintf(
     674            /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
     675            esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'lbwp' ),
     676            '<strong>' . esc_html__( 'Live BLog WP', 'lbwp' ) . '</strong>',
     677            '<strong>' . esc_html__( 'PHP', 'lbwp' ) . '</strong>',
     678            self::MINIMUM_PHP_VERSION
     679        );
     680
     681        printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
     682
     683    }
     684
     685    /*
     686    * Warning when the site doesn't have a minimum required WP version.
     687    */
     688    public function admin_notice_minimum_wp_version() {
     689
     690        if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
     691
     692        $message = sprintf(
     693            /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
     694            esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'lbwp' ),
     695            '<strong>' . esc_html__( 'Live Blog WP', 'lbwp' ) . '</strong>',
     696            '<strong>' . esc_html__( 'WordPress', 'lbwp' ) . '</strong>',
     697            self::MINIMUM_WP_VERSION
     698        );
     699
     700        printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
     701
     702    }
     703
     704    /*
     705    * Warning when the site doesn't ACF.
     706    */
     707    public function admin_notice_missing_acf() {
     708
     709        if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
     710
     711        $message = sprintf(
     712            /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
     713            esc_html__( '"%1$s" requires "%2$s".', 'lbwp' ),
     714            '<strong>' . esc_html__( 'Live Blog WP', 'lbwp' ) . '</strong>',
     715            '<strong>' . esc_html__( 'Advanced Custom Fields.', 'lbwp' ) . '</strong>'
     716        );
     717
     718        printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
     719
     720    }
    537721
    538722}
    539723
    540 
    541 /*
    542 * Holds the defaults customizer options if they dont exist.
    543 */
    544 public function get_options( $option_name = '' ) {
    545 
    546     $defaults = array(
    547         'single_template' => 'full_width',
    548         'post_template' => 'card_1',
    549         'show_toolbar' => '1',
    550         'support_blog_page' => false,
    551         'support_blog_text' => 'SUPPORT',
    552         'get_posts_interval' => 60,
    553         'step_offset' => 65,
    554         'label_js_suffixAgo' => 'ago',
    555         'label_js_seconds' => 'less than a minute',
    556         'label_js_minute' => 'about a minute',
    557         'label_js_minutes' => '%d minutes',
    558         'label_js_hour' => 'about an hour',
    559         'label_js_hours' => 'about %d hours',
    560         'label_js_day' => 'about a day',
    561         'label_js_days' => '%d days',
    562         'label_js_month' => 'about a month',
    563         'label_js_months' => '%d months',
    564         'label_js_year' => 'about a year',
    565         'label_js_years' => '%d years',
    566         'toolbar_background_color' => '#1e87f0',
    567         'toolbar_icon_color' => '#ffffff',
    568         'toolbar_icon_hover_color' => '#e5e5e5',
    569         'toolbar_icon_size' => '1.2',
    570         'toolbar_border_color' => '#1e87f0',
    571         'toolbar_border_width' => '0',
    572         'toolbar_padding' => '15',
    573         'toolbar_box_shadow' => '0',
    574         'toolbar_z_index' => '980',
    575         'toolbar_offset' => '0',
    576         'toolbar_new_text' => 'NEW POSTS',
    577         'toolbar_new_text_size' => '18',
    578         'spinner_color' => '#1e87f0',
    579         'spinner_size' => '2',
    580         'show_points' => '1',
    581         'show_points_heading' => '1',
    582         'show_points_time' => '1',
    583         'points_text' => 'Key Points',
    584         'points_heading_tag' => 'h4',
    585         'points_columns' => 'uk-child-width-1-3@m',
    586         'points_link_tag' => 'h5',
    587         'points_time_color' => '#000000',
    588         'points_link_color' => '#1e87f0',
    589         'points_link_hover_color' => '#1e87f0',
    590         'points_margin_bottom' => '5',
    591         'points_wrap_margin_bottom' => '15',
    592         'show_alert' => '1',
    593         'force_show_alert' => '0',
    594         'alert_text' => 'NEW POSTS',
    595         'alert_tag' => 'div',
    596         'alert_background_color' => '#ffffff',
    597         'alert_text_color' => '#000000',
    598         'alert_text_hover_color' => '#000000',
    599         'alert_border_color' => '#000000',
    600         'alert_border_width' => '1',
    601         'alert_top_bottom_padding' => '10',
    602         'alert_left_right_padding' => '20',
    603         'alert_box_shadow' => '0',
    604         'alert_position' => 'uk-position-bottom-right',
    605         'tab_text' => '(NEW POSTS)',
    606         'show_pinned' => '0',
    607         'pinned_margin_bottom' => '20',
    608         'template_card_1_avatars' => '1',
    609         'template_card_1_authors' => '1',
    610         'template_card_1_author_prefix' => '',
    611         'template_card_1_headings' => '0',
    612         'template_card_1_heading_tag' => 'h4',
    613         'template_card_1_background_color' => '#ffffff',
    614         'template_card_1_border_color' => '#ffffff',
    615         'template_card_1_border_width' => '0',
    616         'template_card_1_icon_color' => '#000000',
    617         'template_card_1_icon_hover_color' => '#1e87f0',
    618         'template_card_1_icon_size' => '1.2',
    619         'template_card_1_time_color' => '#000000',
    620         'template_card_1_author_color' => '#000000',
    621         'template_card_1_box_shadow' => '0',
    622         'template_card_1_padding' => '0',
    623         'template_card_1_margin_bottom' => '20',
    624         'template_card_1_time_size' => '14',
    625         'template_card_1_author_size' => '14',
    626 
    627     );
    628 
    629     return wp_parse_args( get_option( 'lbwp_options' ), $defaults );
    630 
    631 }
    632 
    633 /*
    634 * Warning when the site doesn't have a minimum required PHP version.
    635 */
    636 public function admin_notice_minimum_php_version() {
    637 
    638     if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
    639 
    640     $message = sprintf(
    641         /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
    642         esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'lbwp' ),
    643         '<strong>' . esc_html__( 'Live BLog WP', 'lbwp' ) . '</strong>',
    644         '<strong>' . esc_html__( 'PHP', 'lbwp' ) . '</strong>',
    645         self::MINIMUM_PHP_VERSION
    646     );
    647 
    648     printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
    649 
    650 }
    651 
    652 /*
    653 * Warning when the site doesn't have a minimum required WP version.
    654 */
    655 public function admin_notice_minimum_wp_version() {
    656 
    657     if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
    658 
    659     $message = sprintf(
    660         /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
    661         esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'lbwp' ),
    662         '<strong>' . esc_html__( 'Live Blog WP', 'lbwp' ) . '</strong>',
    663         '<strong>' . esc_html__( 'WordPress', 'lbwp' ) . '</strong>',
    664         self::MINIMUM_WP_VERSION
    665     );
    666 
    667     printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
    668 
    669 }
    670 
    671 /*
    672 * Warning when the site doesn't ACF.
    673 */
    674 public function admin_notice_missing_acf() {
    675 
    676     if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
    677 
    678     $message = sprintf(
    679         /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
    680         esc_html__( '"%1$s" requires "%2$s".', 'lbwp' ),
    681         '<strong>' . esc_html__( 'Live Blog WP', 'lbwp' ) . '</strong>',
    682         '<strong>' . esc_html__( 'Advanced Custom Fields.', 'lbwp' ) . '</strong>'
    683     );
    684 
    685     printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
    686 
    687 }
    688 
    689 }
    690 
    691724\Live_Blog_WP\Instance::instance();
  • live-blog-wp/trunk/post-templates/card-1.php

    r2489121 r2489520  
    99    public static function render( $post_id, $wrapper_classes = [], $parent_id = 0 ) {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        ?>
     
    7272            <div class="uk-width-expand">
    7373
    74                 <?php if ( !empty( $options['template_card_1_headings']) ) : ?>
     74                <?php $local_headings_setting = get_field( 'lbwp_headings', $parent_id ); ?>
     75
     76                <?php if ( ( $local_headings_setting == 'show' ) || ( ( $local_headings_setting == 'global' || empty( $local_headings_setting ) ) && ! empty( $options['template_card_1_headings'] ) ) ) : ?>
    7577
    7678                    <div class="uk-margin-small-bottom">
  • live-blog-wp/trunk/post-templates/card-2.php

    r2481145 r2489520  
    99    public static function render( $post_id, $wrapper_classes = [], $parent_id = 0 ) {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        ?>
     
    2727                        </div>
    2828
    29                         <<?php echo esc_attr( $options['template_card_1_heading_tag']); ?> class="uk-margin-remove">
     29                        <?php $local_headings_setting = get_field( 'lbwp_headings', $parent_id ); ?>
    3030
    31                         <?php echo esc_html( get_the_title( $post_id ) ); ?>
     31                        <?php if ( ( $local_headings_setting == 'show' ) || ( ( $local_headings_setting == 'global' || empty( $local_headings_setting ) ) && ! empty( $options['template_card_1_headings'] ) ) ) : ?>
    3232
    33                         </<?php echo esc_attr( $options['template_card_1_heading_tag']); ?>>
     33                            <<?php echo esc_attr( $options['template_card_1_heading_tag']); ?> class="uk-margin-remove">
     34
     35                            <?php echo esc_html( get_the_title( $post_id ) ); ?>
     36
     37                            </<?php echo esc_attr( $options['template_card_1_heading_tag']); ?>>
     38
     39                        <?php endif; ?>
    3440
    3541                        <?php if ( ! empty( $options['template_card_1_authors'] ) ) : ?>
  • live-blog-wp/trunk/readme.txt

    r2489121 r2489520  
    7171== Changelog ==
    7272
     73= 1.0.5 =
     74Added option to override templates on per post basis.
     75Performance improvements.
     76
    7377= 1.0.4 =
    7478Added the Pinned Posts feature.
  • live-blog-wp/trunk/single-templates/alert.php

    r2489121 r2489520  
    99    public static function render() {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        $alert_classes[] = 'lbwp-alert';
  • live-blog-wp/trunk/single-templates/full-width.php

    r2489121 r2489520  
    99    public static function render() {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        ?>
  • live-blog-wp/trunk/single-templates/header.php

    r2489121 r2489520  
    99    public static function render() {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        ?>
     
    193193
    194194                if ( lbwp_first_run == false ) {
    195                     lbwp_clipboard.destroy();
     195                    clipboard.destroy();
    196196                    clipboard = new ClipboardJS('.lbwp-clipboard');
    197197                }
  • live-blog-wp/trunk/single-templates/spinner.php

    r2489121 r2489520  
    99    public static function render() {
    1010
    11         $options = \Live_Blog_WP\Instance::instance()->get_options();
     11        $options = \Live_Blog_WP\Instance::$options;
    1212
    1313        ?>
Note: See TracChangeset for help on using the changeset viewer.