CPT Bootstrap Carousel - Version 1.9.1

Version Description

  • Titles and captions now show if present, independently of each other (previously both needed to be filled in)
    • You can hide them by leaving blank, or setting Show Slide Titles / Captions? to False in the settings
  • New German translation courtesy of @stefan-meier
  • Undefined index warning fixed by @pfernandez
  • Carousel items now have proper CSS IDs (by @chickahoona)
  • Fixed bug where interval of 0 was replaced with the default interval time
  • Nicer icon in the WordPress admin (thanks @stefan-meier)
  • Localization file path issue fixed (thanks @stefan-meier)
Download this release

Release Info

Developer tallphil
Plugin Icon 128x128 CPT Bootstrap Carousel
Version 1.9.1
Comparing to
See all releases

Code changes from version 1.9 to 1.9.1

cpt-bootstrap-carousel.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CPT Bootstrap Carousel
4
  Plugin URI: http://www.tallphil.co.uk/bootstrap-carousel/
5
  Description: A custom post type for choosing images and content which outputs <a href="http://getbootstrap.com/javascript/#carousel" target="_blank">Bootstrap Carousel</a> from a shortcode. Requires Bootstrap javascript and CSS to be loaded separately.
6
- Version: 1.9
7
  Author: Phil Ewels
8
  Author URI: http://phil.ewels.co.uk
9
  Text Domain: cpt-bootstrap-carousel
@@ -49,6 +49,7 @@ function cptbc_post_type() {
49
  'has_archive' => true,
50
  'hierarchical' => false,
51
  'menu_position' => 21,
 
52
  'supports' => array('title','excerpt','thumbnail', 'page-attributes')
53
  );
54
  register_post_type('cptbc', $args);
3
  Plugin Name: CPT Bootstrap Carousel
4
  Plugin URI: http://www.tallphil.co.uk/bootstrap-carousel/
5
  Description: A custom post type for choosing images and content which outputs <a href="http://getbootstrap.com/javascript/#carousel" target="_blank">Bootstrap Carousel</a> from a shortcode. Requires Bootstrap javascript and CSS to be loaded separately.
6
+ Version: 1.9.1
7
  Author: Phil Ewels
8
  Author URI: http://phil.ewels.co.uk
9
  Text Domain: cpt-bootstrap-carousel
49
  'has_archive' => true,
50
  'hierarchical' => false,
51
  'menu_position' => 21,
52
+ 'menu_icon' => 'dashicons-images-alt',
53
  'supports' => array('title','excerpt','thumbnail', 'page-attributes')
54
  );
55
  register_post_type('cptbc', $args);
cptbc-frontend.php CHANGED
@@ -93,7 +93,11 @@ function cptbc_frontend($atts){
93
  <?php
94
  // Carousel Content
95
  foreach ($images as $key => $image) {
96
-
 
 
 
 
97
  // Build anchor link so it can be reused
98
  $linkstart = '';
99
  $linkend = '';
@@ -106,7 +110,7 @@ function cptbc_frontend($atts){
106
  $linkend = '</a>';
107
  } ?>
108
 
109
- <div class="item <?php echo $key == 0 ? 'active' : ''; ?>" id="<?php echo $image['post_id']; ?>" <?php if($atts['use_background_images'] == 1){ echo ' style="height: '.$atts['background_images_height'].'px; background: url(\''.$image['img_src'].'\') no-repeat center center ; -webkit-background-size: ' . $atts['select_background_images_style_size'] . '; -moz-background-size: ' . $atts['select_background_images_style_size'] . '; -o-background-size: ' . $atts['select_background_images_style_size'] . '; background-size: ' . $atts['select_background_images_style_size'] . ';"'; } ?>>
110
  <?php
111
  // Regular behaviour - display image with link around it
112
  if($atts['use_background_images'] == 0){
@@ -120,7 +124,7 @@ function cptbc_frontend($atts){
120
  echo ' style="display:block; width:100%; height:100%;">&nbsp;</a>';
121
  }
122
  // The Caption div
123
- if(($atts['showcaption'] === 'true' && strlen($image['title']) > 0 && strlen($image['content']) > 0) || ($image['url'] && $atts['link_button'] == 1)) {
124
  echo '<div class="carousel-caption">';
125
  // Title
126
  if(strlen($image['title']) > 0){
93
  <?php
94
  // Carousel Content
95
  foreach ($images as $key => $image) {
96
+
97
+ if( !isset($atts['link_button']) ) {
98
+ $atts['link_button'] = 0;
99
+ }
100
+
101
  // Build anchor link so it can be reused
102
  $linkstart = '';
103
  $linkend = '';
110
  $linkend = '</a>';
111
  } ?>
112
 
113
+ <div class="item <?php echo $key == 0 ? 'active' : ''; ?>" id="cptbc-item-<?php echo $image['post_id']; ?>" <?php if($atts['use_background_images'] == 1){ echo ' style="height: '.$atts['background_images_height'].'px; background: url(\''.$image['img_src'].'\') no-repeat center center ; -webkit-background-size: ' . $atts['select_background_images_style_size'] . '; -moz-background-size: ' . $atts['select_background_images_style_size'] . '; -o-background-size: ' . $atts['select_background_images_style_size'] . '; background-size: ' . $atts['select_background_images_style_size'] . ';"'; } ?>>
114
  <?php
115
  // Regular behaviour - display image with link around it
116
  if($atts['use_background_images'] == 0){
124
  echo ' style="display:block; width:100%; height:100%;">&nbsp;</a>';
125
  }
126
  // The Caption div
127
+ if(($atts['showcaption'] === 'true' && (strlen($image['title']) > 0 || strlen($image['content']) > 0)) || ($image['url'] && $atts['link_button'] == 1)) {
128
  echo '<div class="carousel-caption">';
129
  // Title
130
  if(strlen($image['title']) > 0){
cptbc-settings.php CHANGED
@@ -133,7 +133,7 @@ class cptbc_settings_page {
133
  );
134
  add_settings_field(
135
  'showcaption', // ID
136
- __('Show Slide Captions?', 'cpt-bootstrap-carousel'), // Title
137
  array( $this, 'showcaption_callback' ), // Callback
138
  'cpt-bootstrap-carousel', // Page
139
  'cptbc_settings_behaviour' // Section
@@ -301,9 +301,6 @@ class cptbc_settings_page {
301
  foreach($input as $key => $var){
302
  if($key == 'twbs' || $key == 'interval' || $key == 'background_images_height'){
303
  $new_input[$key] = absint( $input[$key] );
304
- if($key == 'interval' && $new_input[$key] == 0){
305
- $new_input[$key] = 5000;
306
- }
307
  } else if ($key == 'link_button_before' || $key == 'link_button_after' || $key == 'before_title' || $key == 'after_title' || $key == 'before_caption' || $key == 'after_caption'){
308
  $new_input[$key] = $input[$key]; // Don't sanitise these, meant to be html!
309
  } else {
133
  );
134
  add_settings_field(
135
  'showcaption', // ID
136
+ __('Show Slide Titles / Captions?', 'cpt-bootstrap-carousel'), // Title
137
  array( $this, 'showcaption_callback' ), // Callback
138
  'cpt-bootstrap-carousel', // Page
139
  'cptbc_settings_behaviour' // Section
301
  foreach($input as $key => $var){
302
  if($key == 'twbs' || $key == 'interval' || $key == 'background_images_height'){
303
  $new_input[$key] = absint( $input[$key] );
 
 
 
304
  } else if ($key == 'link_button_before' || $key == 'link_button_after' || $key == 'before_title' || $key == 'after_title' || $key == 'before_caption' || $key == 'after_caption'){
305
  $new_input[$key] = $input[$key]; // Don't sanitise these, meant to be html!
306
  } else {
languages/cpt-bootstrap-carousel-de_DE.mo ADDED
Binary file
languages/cpt-bootstrap-carousel-de_DE.po ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 CPT Bootstrap Carousel
2
+ # This file is distributed under the same license as the CPT Bootstrap Carousel package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: CPT Bootstrap Carousel 1.9\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/cpt-bootstrap-carousel\n"
7
+ "POT-Creation-Date: 2013-12-15 15:20:37+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-04-30 13:23+0100\n"
12
+ "Last-Translator: Stefan Meier <hello@stefanmeier.net>\n"
13
+ "Language-Team: Stefan Meier <hello@stefanmeier.net>\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Generator: Poedit 1.7.1\n"
16
+ "Language: de_DE\n"
17
+
18
+ #: cpt-bootstrap-carousel.php:26
19
+ msgid "Carousel Images"
20
+ msgstr "Karussell-Bilder"
21
+
22
+ #: cpt-bootstrap-carousel.php:27
23
+ msgid "Carousel Image"
24
+ msgstr "Karussell-Bild"
25
+
26
+ #: cpt-bootstrap-carousel.php:28
27
+ msgid "Add New"
28
+ msgstr "Erstellen"
29
+
30
+ #: cpt-bootstrap-carousel.php:29
31
+ msgid "Add New Carousel Image"
32
+ msgstr "Neues Karussell-Bild"
33
+
34
+ #: cpt-bootstrap-carousel.php:30
35
+ msgid "Edit Carousel Image"
36
+ msgstr "Karussell-Bild bearbeiten"
37
+
38
+ #: cpt-bootstrap-carousel.php:31
39
+ msgid "New Carousel Image"
40
+ msgstr "Neues Karussell-Bild"
41
+
42
+ #: cpt-bootstrap-carousel.php:32
43
+ msgid "View Carousel Image"
44
+ msgstr "Karussell-Bilder anzeigen"
45
+
46
+ #: cpt-bootstrap-carousel.php:33
47
+ msgid "Search Carousel Images"
48
+ msgstr "Karussell-Bilder suchen"
49
+
50
+ #: cpt-bootstrap-carousel.php:34
51
+ msgid "No Carousel Image"
52
+ msgstr "Keine Karussell-Bilder"
53
+
54
+ #: cpt-bootstrap-carousel.php:35
55
+ msgid "No Carousel Images found in Trash"
56
+ msgstr "Keine Karussell-Bilder im Papierkorb"
57
+
58
+ #: cpt-bootstrap-carousel.php:37
59
+ msgid "Carousel"
60
+ msgstr "Karussell"
61
+
62
+ #: cpt-bootstrap-carousel.php:89
63
+ msgid "Featured Image"
64
+ msgstr "Beitragsbild"
65
+
66
+ #: cpt-bootstrap-carousel.php:110
67
+ msgid "Image URL"
68
+ msgstr "Bild URL"
69
+
70
+ #: cpt-bootstrap-carousel.php:112
71
+ msgid "(optional - leave blank for no link)"
72
+ msgstr "(optional - leer lassen, falls kein Link)"
73
+
74
+ #: cpt-bootstrap-carousel.php:113
75
+ msgid "Open link in new window?"
76
+ msgstr "Link in neuem Fenster öffnen?"
77
+
78
+ #: cpt-bootstrap-carousel.php:166 cpt-bootstrap-carousel.php:179
79
+ #: cpt-bootstrap-carousel.php:389
80
+ msgid "Settings"
81
+ msgstr "Einstellungen"
82
+
83
+ #: cpt-bootstrap-carousel.php:180
84
+ msgid ""
85
+ "You can set the default behaviour of your carousels here. All of these settings can "
86
+ "be overridden by using %s shortcode attributes %s."
87
+ msgstr ""
88
+ "Hier kannst du das standardmäßige Verhalten deines Karussells einstellen. Diese "
89
+ "Einstellungen können alle mittels %s Shortcode Attributen %s überschrieben werden."
90
+
91
+ #: cpt-bootstrap-carousel.php:210
92
+ msgid "Twitter Bootstrap Version"
93
+ msgstr "Twitter Bootstrap Version"
94
+
95
+ #: cpt-bootstrap-carousel.php:218
96
+ msgid "Slide Interval (milliseconds)"
97
+ msgstr "Folien Intervall (Millisekunden)"
98
+
99
+ #: cpt-bootstrap-carousel.php:226
100
+ msgid "Show Slide Captions?"
101
+ msgstr "Folien-Überschriften anzeigen?"
102
+
103
+ #: cpt-bootstrap-carousel.php:234
104
+ msgid "Show Slide Controls?"
105
+ msgstr "Schalter anzeigen?"
106
+
107
+ #: cpt-bootstrap-carousel.php:242
108
+ msgid "Order Slides By"
109
+ msgstr "Folien sortieren nach"
110
+
111
+ #: cpt-bootstrap-carousel.php:250
112
+ msgid "Ordering Direction"
113
+ msgstr "Sortierungs-Richtung"
114
+
115
+ #: cpt-bootstrap-carousel.php:258
116
+ msgid "Restrict to Category"
117
+ msgstr "Auf Kategorie beschränken"
118
+
119
+ #: cpt-bootstrap-carousel.php:315 cpt-bootstrap-carousel.php:329
120
+ msgid "Show"
121
+ msgstr "Anzeigen"
122
+
123
+ #: cpt-bootstrap-carousel.php:316 cpt-bootstrap-carousel.php:330
124
+ msgid "Hide"
125
+ msgstr "Verstecken"
126
+
127
+ #: cpt-bootstrap-carousel.php:336
128
+ msgid "Menu order, as set in Carousel overview page"
129
+ msgstr "Menü-Reihenfolge, wie in der Karussell-Übersicht festgelegt"
130
+
131
+ #: cpt-bootstrap-carousel.php:337
132
+ msgid "Date slide was published"
133
+ msgstr "Datum der Veröffentlichung"
134
+
135
+ #: cpt-bootstrap-carousel.php:338
136
+ msgid "Random ordering"
137
+ msgstr "Zufällige Reihenfolge"
138
+
139
+ #: cpt-bootstrap-carousel.php:339
140
+ msgid "Slide title"
141
+ msgstr "Folien-Titel"
142
+
143
+ #: cpt-bootstrap-carousel.php:361
144
+ msgid "Ascending"
145
+ msgstr "Aufsteigend"
146
+
147
+ #: cpt-bootstrap-carousel.php:362
148
+ msgid "Decending"
149
+ msgstr "Absteigend"
150
+
151
+ #: cpt-bootstrap-carousel.php:369
152
+ msgid "All Categories"
153
+ msgstr "Alle Kategorien"
154
+
155
+ #. Plugin Name of the plugin/theme
156
+ msgid "CPT Bootstrap Carousel"
157
+ msgstr "CPT Bootstrap Carousel"
158
+
159
+ #. Plugin URI of the plugin/theme
160
+ msgid "http://www.tallphil.co.uk/bootstrap-carousel/"
161
+ msgstr "http://www.tallphil.co.uk/bootstrap-carousel/"
162
+
163
+ #. Description of the plugin/theme
164
+ msgid ""
165
+ "A custom post type for choosing images and content which outputs <a href=\"http://"
166
+ "twitter.github.io/bootstrap/javascript.html#carousel\" target=\"_blank\">Bootstrap "
167
+ "Carousel</a> from a shortcode. Requires Bootstrap javascript and CSS to be loaded "
168
+ "separately."
169
+ msgstr ""
170
+ "Ein Inhaltstyp um Bilder und Inhalte mittels Shortcode als <a href=\"http://"
171
+ "getbootstrap.com/javascript/#carousel\" target=\"_blank\">Bootstrap Carousel</a> "
172
+ "auszugeben. Benötigt Bootstrap JavaScript und CSS."
173
+
174
+ #. Author of the plugin/theme
175
+ msgid "Phil Ewels"
176
+ msgstr "Phil Ewels"
177
+
178
+ #. Author URI of the plugin/theme
179
+ msgid "http://phil.ewels.co.uk"
180
+ msgstr "http://phil.ewels.co.uk\t"
languages/{cpt-bootstrap-carousel_en-GB.mo → cpt-bootstrap-carousel-en_GB.mo} RENAMED
File without changes
languages/{cpt-bootstrap-carousel_en-GB.po → cpt-bootstrap-carousel-en_GB.po} RENAMED
File without changes
languages/{cpt-bootstrap-carousel_fr_FR.mo → cpt-bootstrap-carousel-fr_FR.mo} RENAMED
File without changes
languages/{cpt-bootstrap-carousel_fr_FR.po → cpt-bootstrap-carousel-fr_FR.po} RENAMED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: tallphil
3
  Donate Link: http://www.tallphil.co.uk/bootstrap-carousel/
4
  Tags: carousel, slider, image, bootstrap
5
  Requires at least: 3.0.1
6
- Tested up to: 4.2
7
- Stable tag: 1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -156,6 +156,16 @@ You need to make sure that each image is the same height. You can do this by set
156
 
157
  == Changelog ==
158
 
 
 
 
 
 
 
 
 
 
 
159
  = 1.9 =
160
  * Prevented the help tab from displaying on pages other than Carousel Items
161
  * Made the output buffer cleaning only happen if we have images (thanks @ChrisLomax)
3
  Donate Link: http://www.tallphil.co.uk/bootstrap-carousel/
4
  Tags: carousel, slider, image, bootstrap
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.3
7
+ Stable tag: 1.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
156
 
157
  == Changelog ==
158
 
159
+ = 1.9.1 =
160
+ * Titles and captions now show if present, independently of each other (previously both needed to be filled in)
161
+ * You can hide them by leaving blank, or setting _Show Slide Titles / Captions?_ to False in the settings
162
+ * New German translation courtesy of @stefan-meier
163
+ * `Undefined index` warning fixed by @pfernandez
164
+ * Carousel items now have proper CSS IDs (by @chickahoona)
165
+ * Fixed bug where interval of 0 was replaced with the default interval time
166
+ * Nicer icon in the WordPress admin (thanks @stefan-meier)
167
+ * Localization file path issue fixed (thanks @stefan-meier)
168
+
169
  = 1.9 =
170
  * Prevented the help tab from displaying on pages other than Carousel Items
171
  * Made the output buffer cleaning only happen if we have images (thanks @ChrisLomax)