WordPress.org

Plugin Directory

Changeset 994306


Ignore:
Timestamp:
09/21/14 18:00:23 (3 years ago)
Author:
bassgang
Message:

Release 1.0.3

Location:
advent-calender/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • advent-calender/trunk/README.txt

    r894680 r994306  
    11=== Advent Calendar === 
    22Contributors: bassgang 
    3 Tags: advent, calendar, christmas 
     3Tags: advent, calendar, christmas, flexible 
    44Requires at least: 3.7.1 
    5 Tested up to: 3.9 
    6 Stable tag: 1.0.2 
     5Tested up to: 4.0 
     6Stable tag: 1.0.3 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     9Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FCCQCWL3QNM36 
    910 
    1011A simple calendar plugin to show a list of 24 days before christmas. 
     
    3536* Use the bulk creation tool to create the Advent calendar entries. 
    3637* Set a featured image for each Advent calendar entry. 
    37 * Adapt the Advent calendar single entry template to your needs, you can find it here: 
    38 ** wp-content/plugins/advent-calendar/public/views/single-advent-calendar-entry.php. 
    39 ** Make sure you include the PHP to output the "featured image" somewhere in the template. 
    40 *** You can find it in "single-advent-calendar-entry.php" line 32 - 36. 
    41 ** A good starting point is to copy the contents of your "single.php" template from your current theme into this file. 
    4238* Use the shortcode "[advent-calendar]" to output the Advent calendar overview. 
     39 
     40== Frequently Asked Questions == 
     41 
     42= Defaults = 
     43* Yeb, you are right, by default the Advent calender post type only provides a "title" and a "featured image". If you 
     44want to extend it, read further ;) 
     45 
     46= Advent Calender Post Type Customization = 
     47* Advent calender post type customization via the provided "pvb_acal_cpt_params" hook. The following example will extend 
     48the advent calender post type with the common post WordPress content / editor box. Youh can use the hook in your themes 
     49"functions.php" or in a plugin like 
     50 
     51` 
     52function acal_change_post_type_params( $custom_post_type_params ) { 
     53    $custom_post_type_params['supports'] = array( 
     54        'title', 
     55        'editor', 
     56        'thumbnail' 
     57    ); 
     58    return $custom_post_type_params; 
     59} 
     60add_filter( 'pvb_acal_cpt_params', 'acal_change_post_type_params' ); 
     61` 
     62= Single Advent Calender Template / View Customization = 
     63* If you want to use a custom template for a single advent calender entry (the "detail view") copy 
     64"wp-content/plugins/advent-calendar/public/views/single-advent-calendar-entry-custom.php" to your theme folder, i.e. 
     65"wp-content/themes/YOUR-THEME/single-advent-calendar-entry-custom.php". 
    4366 
    4467== Screenshots == 
     
    4972== Changelog == 
    5073 
     74= 1.0.3 = 
     75* Provide "pvb_acal_cpt_params" hook to enable flexible "3rd party" customization of the advent calendar post type. For 
     76example: Now it is easy to add the normal "content" section (editor) to an advent calender entry 
     77* Provide further customization possibilities by loading a custom single advent calender entry template if present, 
     78the plugin checks for 'single-advent-calendar-entry-custom.php' in the folder of your active theme under 
     79wp-content/themes. 
     80 
    5181= 1.0.2 = 
    52 * Increase overall theme compatibility. 
    53 ** Remove specific twentythirteen functions in "public/views/single-advent-calendar-entry.php". 
     82* Increase overall theme compatibility: Remove specific twentythirteen functions in "public/views/single-advent-calendar-entry.php". 
    5483* Improve installation instructions. 
    5584 
  • advent-calender/trunk/public/class-advent-calendar.php

    r815845 r994306  
    278278    public function acal_create_post_type() { 
    279279 
    280         register_post_type( 
    281             'acal_entry', 
     280        $custom_post_type_params = 
    282281            array( 
    283                 'labels'      => array( 
     282                'labels' => array( 
    284283                    'name'          => __( 'Advent calendar entries', $this->plugin_slug ), 
    285284                    'singular_name' => __( 'Advent calendar entry', $this->plugin_slug ) 
     
    296295                    'thumbnail' 
    297296                ) 
    298             ) 
     297            ); 
     298 
     299        register_post_type( 
     300            'acal_entry', 
     301            apply_filters( 'pvb_acal_cpt_params', $custom_post_type_params ) 
    299302        ); 
    300  
    301303    } 
    302304 
     
    309311 
    310312        if ( $post->post_type == 'acal_entry' ) { 
    311             $single_template = dirname( __FILE__ ) . '/views/single-advent-calendar-entry.php'; 
     313 
     314            // Check for custom single template in theme folder 
     315            if ( $custom_theme_file = locate_template( array( 'single-advent-calendar-entry-custom.php' ) ) ) { 
     316                $single_template = $custom_theme_file; 
     317            } 
     318            // Load plugin default template 
     319            else { 
     320                $single_template = dirname( __FILE__ ) . '/views/single-advent-calendar-entry.php'; 
     321            } 
    312322        } 
    313323 
  • advent-calender/trunk/public/views/single-advent-calendar-entry.php

    r815845 r994306  
    4444                            </div><!-- .entry-summary --> 
    4545                        <?php else : ?> 
    46                             <div class="entry-content"> 
    47                                 <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> 
    48                                 <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> 
    49                             </div><!-- .entry-content --> 
     46                            <?php // By default an advent calender entry does not have "content", just a title and a 
     47                                  // featured image, consider to customize the advent calender post type via provided 
     48                                  // hook if you need "content". 
     49                            ?> 
    5050                        <?php endif; ?> 
    5151 
Note: See TracChangeset for help on using the changeset viewer.