Version Description
Release Date - 17 June 2016
- Updated plugin design,
- Changed the plugin page setup filter name from
pt-ocdi/plugin-page-setuptopt-ocdi/plugin_page_setup(mind the underscore characters instead of dashes).
Download this release
Release Info
| Developer | capuderg |
| Plugin | |
| Version | 1.1.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.2 to 1.1.3
- assets/css/main.css +46 -9
- inc/class-ocdi-helpers.php +2 -2
- languages/pt-ocdi.pot +29 -24
- one-click-demo-import.php +43 -40
- readme.txt +16 -3
assets/css/main.css
CHANGED
|
@@ -18,19 +18,18 @@
|
|
| 18 |
|
| 19 |
/* Plugin intro text */
|
| 20 |
.ocdi__intro-text {
|
|
|
|
| 21 |
background-color: #f5fafd;
|
| 22 |
-
margin:10px 0;
|
| 23 |
-
padding: 10px
|
| 24 |
color: #0C518F;
|
| 25 |
-
border:
|
|
|
|
| 26 |
clear: both;
|
| 27 |
-
width: calc( 100% - 16px );
|
| 28 |
-
line-height: 18px;
|
| 29 |
}
|
| 30 |
|
| 31 |
.ocdi__intro-text ul {
|
| 32 |
-
padding-left:
|
| 33 |
-
list-style-position: inside;
|
| 34 |
list-style-type: square;
|
| 35 |
}
|
| 36 |
|
|
@@ -44,9 +43,47 @@
|
|
| 44 |
max-width: 100%;
|
| 45 |
}
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
@media (min-width: 992px) {
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
}
|
| 52 |
|
| 18 |
|
| 19 |
/* Plugin intro text */
|
| 20 |
.ocdi__intro-text {
|
| 21 |
+
width: calc( 100% - 46px );
|
| 22 |
background-color: #f5fafd;
|
| 23 |
+
margin: 10px 0;
|
| 24 |
+
padding: 10px 20px;
|
| 25 |
color: #0C518F;
|
| 26 |
+
border: 1px solid #cae0f3;
|
| 27 |
+
border-left: 5px solid #cae0f3;
|
| 28 |
clear: both;
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
.ocdi__intro-text ul {
|
| 32 |
+
padding-left: 40px;
|
|
|
|
| 33 |
list-style-type: square;
|
| 34 |
}
|
| 35 |
|
| 43 |
max-width: 100%;
|
| 44 |
}
|
| 45 |
|
| 46 |
+
/* Plugin multi select import and Plugin file upload containers */
|
| 47 |
+
.ocdi__single-file-upload-container,
|
| 48 |
+
.ocdi__multi-select-import {
|
| 49 |
+
width: calc( 100% - 46px );
|
| 50 |
+
background-color: #ffffff;
|
| 51 |
+
margin: 10px 0;
|
| 52 |
+
padding: 20px;
|
| 53 |
+
border: 1px solid #e5e5e5;
|
| 54 |
+
border-left: 5px solid #e5e5e5;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.ocdi__single-file-upload-container {
|
| 58 |
+
margin: 0;
|
| 59 |
+
margin-bottom: -1px;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.ocdi__single-file-upload-container span {
|
| 63 |
+
color: #999999;
|
| 64 |
+
float: right;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.ocdi__single-file-upload-container h3,
|
| 68 |
+
.ocdi__multi-select-import h3 {
|
| 69 |
+
margin-top: 0;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.ocdi__single-file-upload-container h3 {
|
| 73 |
+
margin-bottom: .5em;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
@media (min-width: 992px) {
|
| 77 |
+
.ocdi__single-file-upload-container,
|
| 78 |
+
.ocdi__multi-select-import {
|
| 79 |
+
width: 65%;
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
@media (min-width: 1200px) {
|
| 84 |
+
.ocdi__single-file-upload-container,
|
| 85 |
+
.ocdi__multi-select-import {
|
| 86 |
+
width: 50%;
|
| 87 |
}
|
| 88 |
}
|
| 89 |
|
inc/class-ocdi-helpers.php
CHANGED
|
@@ -314,7 +314,7 @@ class OCDI_Helpers {
|
|
| 314 |
}
|
| 315 |
|
| 316 |
// Get plugin page settings.
|
| 317 |
-
$plugin_page_setup = apply_filters( 'pt-ocdi/
|
| 318 |
'parent_slug' => 'themes.php',
|
| 319 |
'page_title' => esc_html__( 'One Click Demo Import' , 'pt-ocdi' ),
|
| 320 |
'menu_title' => esc_html__( 'Import Demo Data' , 'pt-ocdi' ),
|
|
@@ -444,7 +444,7 @@ class OCDI_Helpers {
|
|
| 444 |
|
| 445 |
// Write error to log file and send an AJAX response with the error.
|
| 446 |
self::log_error_and_send_ajax_response(
|
| 447 |
-
__( 'Please upload XML file for content import. If you want to import widgets only, please use Widget Importer & Exporter plugin.', 'pt-ocdi' ),
|
| 448 |
$log_file_path,
|
| 449 |
esc_html__( 'Upload files', 'pt-ocdi' )
|
| 450 |
);
|
| 314 |
}
|
| 315 |
|
| 316 |
// Get plugin page settings.
|
| 317 |
+
$plugin_page_setup = apply_filters( 'pt-ocdi/plugin_page_setup', array(
|
| 318 |
'parent_slug' => 'themes.php',
|
| 319 |
'page_title' => esc_html__( 'One Click Demo Import' , 'pt-ocdi' ),
|
| 320 |
'menu_title' => esc_html__( 'Import Demo Data' , 'pt-ocdi' ),
|
| 444 |
|
| 445 |
// Write error to log file and send an AJAX response with the error.
|
| 446 |
self::log_error_and_send_ajax_response(
|
| 447 |
+
__( 'Please upload XML file for content import. If you want to import widgets or customizer settings only, please use Widget Importer & Exporter or the Customizer Export/Import plugin.', 'pt-ocdi' ),
|
| 448 |
$log_file_path,
|
| 449 |
esc_html__( 'Upload files', 'pt-ocdi' )
|
| 450 |
);
|
languages/pt-ocdi.pot
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# This file is distributed under the GPL 2.0.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"Project-Id-Version: One Click Demo Import 1.1.
|
| 6 |
"Report-Msgid-Bugs-To: http://support.proteusthemes.com/\n"
|
| 7 |
"POT-Creation-Date: 2016-05-14 09:53:17+00:00\n"
|
| 8 |
"MIME-Version: 1.0\n"
|
|
@@ -74,7 +74,7 @@ msgid "One Click Demo Import"
|
|
| 74 |
msgstr ""
|
| 75 |
|
| 76 |
#: inc/class-ocdi-helpers.php:320 one-click-demo-import.php:101
|
| 77 |
-
#: one-click-demo-import.php:
|
| 78 |
msgid "Import Demo Data"
|
| 79 |
msgstr ""
|
| 80 |
|
|
@@ -96,8 +96,9 @@ msgstr ""
|
|
| 96 |
|
| 97 |
#: inc/class-ocdi-helpers.php:447
|
| 98 |
msgid ""
|
| 99 |
-
"Please upload XML file for content import. If you want to import widgets "
|
| 100 |
-
"only, please use Widget Importer & Exporter
|
|
|
|
| 101 |
msgstr ""
|
| 102 |
|
| 103 |
#: inc/class-ocdi-helpers.php:449 inc/class-ocdi-helpers.php:471
|
|
@@ -207,51 +208,55 @@ msgid ""
|
|
| 207 |
"the import files manually!"
|
| 208 |
msgstr ""
|
| 209 |
|
| 210 |
-
#: one-click-demo-import.php:
|
| 211 |
msgid "Choose a XML file for content import:"
|
| 212 |
msgstr ""
|
| 213 |
|
| 214 |
-
#: one-click-demo-import.php:
|
| 215 |
-
msgid "
|
| 216 |
msgstr ""
|
| 217 |
|
| 218 |
-
#: one-click-demo-import.php:
|
| 219 |
-
msgid "
|
| 220 |
msgstr ""
|
| 221 |
|
| 222 |
-
#: one-click-demo-import.php:
|
| 223 |
msgid "Choose a DAT file for customizer import:"
|
| 224 |
msgstr ""
|
| 225 |
|
| 226 |
-
#: one-click-demo-import.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
msgid "Import preview:"
|
| 228 |
msgstr ""
|
| 229 |
|
| 230 |
-
#: one-click-demo-import.php:
|
| 231 |
msgid "No preview image defined for this import."
|
| 232 |
msgstr ""
|
| 233 |
|
| 234 |
-
#: one-click-demo-import.php:
|
| 235 |
msgid "Importing, please wait!"
|
| 236 |
msgstr ""
|
| 237 |
|
| 238 |
-
#: one-click-demo-import.php:
|
| 239 |
msgid "Manually uploaded files"
|
| 240 |
msgstr ""
|
| 241 |
|
| 242 |
-
#: one-click-demo-import.php:
|
| 243 |
msgid "Downloaded files"
|
| 244 |
msgstr ""
|
| 245 |
|
| 246 |
-
#: one-click-demo-import.php:
|
| 247 |
msgid "The import files for: %s were successfully downloaded!"
|
| 248 |
msgstr ""
|
| 249 |
|
| 250 |
-
#: one-click-demo-import.php:
|
| 251 |
msgid "No import files specified!"
|
| 252 |
msgstr ""
|
| 253 |
|
| 254 |
-
#: one-click-demo-import.php:
|
| 255 |
msgid ""
|
| 256 |
"%1$s%3$sThat's it, all done!%4$s%2$sThe demo import has finished. Please "
|
| 257 |
"check your page and make sure that everything has imported correctly. If it "
|
|
@@ -259,30 +264,30 @@ msgid ""
|
|
| 259 |
"it has done its job.%5$s"
|
| 260 |
msgstr ""
|
| 261 |
|
| 262 |
-
#: one-click-demo-import.php:
|
| 263 |
msgid ""
|
| 264 |
"%1$sThe demo import has finished, but there were some import "
|
| 265 |
"errors.%2$sMore details about the errors can be found in this %3$s%5$slog "
|
| 266 |
"file%6$s%4$s%7$s"
|
| 267 |
msgstr ""
|
| 268 |
|
| 269 |
-
#: one-click-demo-import.php:
|
| 270 |
msgid "Importing content"
|
| 271 |
msgstr ""
|
| 272 |
|
| 273 |
-
#: one-click-demo-import.php:
|
| 274 |
msgid "Importing widgets"
|
| 275 |
msgstr ""
|
| 276 |
|
| 277 |
-
#: one-click-demo-import.php:
|
| 278 |
msgid "Importing customizer settings"
|
| 279 |
msgstr ""
|
| 280 |
|
| 281 |
-
#: one-click-demo-import.php:
|
| 282 |
msgid "Customizer settings import finished!"
|
| 283 |
msgstr ""
|
| 284 |
|
| 285 |
-
#: one-click-demo-import.php:
|
| 286 |
msgid "Completed AJAX call number: "
|
| 287 |
msgstr ""
|
| 288 |
|
| 2 |
# This file is distributed under the GPL 2.0.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"Project-Id-Version: One Click Demo Import 1.1.2\n"
|
| 6 |
"Report-Msgid-Bugs-To: http://support.proteusthemes.com/\n"
|
| 7 |
"POT-Creation-Date: 2016-05-14 09:53:17+00:00\n"
|
| 8 |
"MIME-Version: 1.0\n"
|
| 74 |
msgstr ""
|
| 75 |
|
| 76 |
#: inc/class-ocdi-helpers.php:320 one-click-demo-import.php:101
|
| 77 |
+
#: one-click-demo-import.php:229
|
| 78 |
msgid "Import Demo Data"
|
| 79 |
msgstr ""
|
| 80 |
|
| 96 |
|
| 97 |
#: inc/class-ocdi-helpers.php:447
|
| 98 |
msgid ""
|
| 99 |
+
"Please upload XML file for content import. If you want to import widgets or "
|
| 100 |
+
"customizer settings only, please use Widget Importer & Exporter or the "
|
| 101 |
+
"Customizer Export/Import plugin."
|
| 102 |
msgstr ""
|
| 103 |
|
| 104 |
#: inc/class-ocdi-helpers.php:449 inc/class-ocdi-helpers.php:471
|
| 208 |
"the import files manually!"
|
| 209 |
msgstr ""
|
| 210 |
|
| 211 |
+
#: one-click-demo-import.php:169
|
| 212 |
msgid "Choose a XML file for content import:"
|
| 213 |
msgstr ""
|
| 214 |
|
| 215 |
+
#: one-click-demo-import.php:173
|
| 216 |
+
msgid "Choose a WIE or JSON file for widget import:"
|
| 217 |
msgstr ""
|
| 218 |
|
| 219 |
+
#: one-click-demo-import.php:173 one-click-demo-import.php:177
|
| 220 |
+
msgid "(*optional)"
|
| 221 |
msgstr ""
|
| 222 |
|
| 223 |
+
#: one-click-demo-import.php:177
|
| 224 |
msgid "Choose a DAT file for customizer import:"
|
| 225 |
msgstr ""
|
| 226 |
|
| 227 |
+
#: one-click-demo-import.php:183
|
| 228 |
+
msgid "Choose which demo you want to import:"
|
| 229 |
+
msgstr ""
|
| 230 |
+
|
| 231 |
+
#: one-click-demo-import.php:205
|
| 232 |
msgid "Import preview:"
|
| 233 |
msgstr ""
|
| 234 |
|
| 235 |
+
#: one-click-demo-import.php:209 one-click-demo-import.php:260
|
| 236 |
msgid "No preview image defined for this import."
|
| 237 |
msgstr ""
|
| 238 |
|
| 239 |
+
#: one-click-demo-import.php:233
|
| 240 |
msgid "Importing, please wait!"
|
| 241 |
msgstr ""
|
| 242 |
|
| 243 |
+
#: one-click-demo-import.php:317
|
| 244 |
msgid "Manually uploaded files"
|
| 245 |
msgstr ""
|
| 246 |
|
| 247 |
+
#: one-click-demo-import.php:334 one-click-demo-import.php:345
|
| 248 |
msgid "Downloaded files"
|
| 249 |
msgstr ""
|
| 250 |
|
| 251 |
+
#: one-click-demo-import.php:341
|
| 252 |
msgid "The import files for: %s were successfully downloaded!"
|
| 253 |
msgstr ""
|
| 254 |
|
| 255 |
+
#: one-click-demo-import.php:351
|
| 256 |
msgid "No import files specified!"
|
| 257 |
msgstr ""
|
| 258 |
|
| 259 |
+
#: one-click-demo-import.php:398
|
| 260 |
msgid ""
|
| 261 |
"%1$s%3$sThat's it, all done!%4$s%2$sThe demo import has finished. Please "
|
| 262 |
"check your page and make sure that everything has imported correctly. If it "
|
| 264 |
"it has done its job.%5$s"
|
| 265 |
msgstr ""
|
| 266 |
|
| 267 |
+
#: one-click-demo-import.php:409
|
| 268 |
msgid ""
|
| 269 |
"%1$sThe demo import has finished, but there were some import "
|
| 270 |
"errors.%2$sMore details about the errors can be found in this %3$s%5$slog "
|
| 271 |
"file%6$s%4$s%7$s"
|
| 272 |
msgstr ""
|
| 273 |
|
| 274 |
+
#: one-click-demo-import.php:465
|
| 275 |
msgid "Importing content"
|
| 276 |
msgstr ""
|
| 277 |
|
| 278 |
+
#: one-click-demo-import.php:504 one-click-demo-import.php:516
|
| 279 |
msgid "Importing widgets"
|
| 280 |
msgstr ""
|
| 281 |
|
| 282 |
+
#: one-click-demo-import.php:538 one-click-demo-import.php:546
|
| 283 |
msgid "Importing customizer settings"
|
| 284 |
msgstr ""
|
| 285 |
|
| 286 |
+
#: one-click-demo-import.php:544
|
| 287 |
msgid "Customizer settings import finished!"
|
| 288 |
msgstr ""
|
| 289 |
|
| 290 |
+
#: one-click-demo-import.php:596
|
| 291 |
msgid "Completed AJAX call number: "
|
| 292 |
msgstr ""
|
| 293 |
|
one-click-demo-import.php
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
Plugin Name: One Click Demo Import
|
| 5 |
Plugin URI: https://wordpress.org/plugins/one-click-demo-import/
|
| 6 |
Description: Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
| 7 |
-
Version: 1.1.
|
| 8 |
Author: ProteusThemes
|
| 9 |
Author URI: http://www.proteusthemes.com
|
| 10 |
License: GPL3
|
|
@@ -20,7 +20,7 @@ define( 'PT_OCDI_PATH', plugin_dir_path( __FILE__ ) );
|
|
| 20 |
define( 'PT_OCDI_URL', plugin_dir_url( __FILE__ ) );
|
| 21 |
|
| 22 |
// Current version of the plugin.
|
| 23 |
-
define( 'PT_OCDI_VERSION', '1.1.
|
| 24 |
|
| 25 |
// Include files.
|
| 26 |
require PT_OCDI_PATH . 'inc/class-ocdi-helpers.php';
|
|
@@ -95,7 +95,7 @@ class PT_One_Click_Demo_Import {
|
|
| 95 |
* Creates the plugin page and a submenu item in WP Appearance menu.
|
| 96 |
*/
|
| 97 |
public function create_plugin_page() {
|
| 98 |
-
$plugin_page_setup = apply_filters( 'pt-ocdi/
|
| 99 |
'parent_slug' => 'themes.php',
|
| 100 |
'page_title' => esc_html__( 'One Click Demo Import' , 'pt-ocdi' ),
|
| 101 |
'menu_title' => esc_html__( 'Import Demo Data' , 'pt-ocdi' ),
|
|
@@ -164,18 +164,23 @@ class PT_One_Click_Demo_Import {
|
|
| 164 |
<?php esc_html_e( 'There are no predefined import files available in this theme. Please upload the import files manually!', 'pt-ocdi' ); ?>
|
| 165 |
</p>
|
| 166 |
</div>
|
| 167 |
-
<
|
| 168 |
-
<
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
<
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
<?php elseif ( 1 < count( $this->import_files ) ) : ?>
|
| 178 |
-
<
|
|
|
|
| 179 |
<select id="ocdi__demo-import-files">
|
| 180 |
<?php foreach ( $this->import_files as $index => $import_file ) : ?>
|
| 181 |
<option value="<?php echo esc_attr( $index ); ?>">
|
|
@@ -183,36 +188,34 @@ class PT_One_Click_Demo_Import {
|
|
| 183 |
</option>
|
| 184 |
<?php endforeach; ?>
|
| 185 |
</select>
|
| 186 |
-
</p>
|
| 187 |
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
|
|
|
| 195 |
}
|
| 196 |
-
}
|
| 197 |
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
|
|
|
|
|
|
| 211 |
</div>
|
| 212 |
-
<?php
|
| 213 |
-
endif;
|
| 214 |
-
endif;
|
| 215 |
-
?>
|
| 216 |
|
| 217 |
<div class="ocdi__demo-import-notice js-ocdi-demo-import-notice">
|
| 218 |
<?php
|
| 4 |
Plugin Name: One Click Demo Import
|
| 5 |
Plugin URI: https://wordpress.org/plugins/one-click-demo-import/
|
| 6 |
Description: Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
| 7 |
+
Version: 1.1.3
|
| 8 |
Author: ProteusThemes
|
| 9 |
Author URI: http://www.proteusthemes.com
|
| 10 |
License: GPL3
|
| 20 |
define( 'PT_OCDI_URL', plugin_dir_url( __FILE__ ) );
|
| 21 |
|
| 22 |
// Current version of the plugin.
|
| 23 |
+
define( 'PT_OCDI_VERSION', '1.1.3' );
|
| 24 |
|
| 25 |
// Include files.
|
| 26 |
require PT_OCDI_PATH . 'inc/class-ocdi-helpers.php';
|
| 95 |
* Creates the plugin page and a submenu item in WP Appearance menu.
|
| 96 |
*/
|
| 97 |
public function create_plugin_page() {
|
| 98 |
+
$plugin_page_setup = apply_filters( 'pt-ocdi/plugin_page_setup', array(
|
| 99 |
'parent_slug' => 'themes.php',
|
| 100 |
'page_title' => esc_html__( 'One Click Demo Import' , 'pt-ocdi' ),
|
| 101 |
'menu_title' => esc_html__( 'Import Demo Data' , 'pt-ocdi' ),
|
| 164 |
<?php esc_html_e( 'There are no predefined import files available in this theme. Please upload the import files manually!', 'pt-ocdi' ); ?>
|
| 165 |
</p>
|
| 166 |
</div>
|
| 167 |
+
<div>
|
| 168 |
+
<div class="ocdi__single-file-upload-container">
|
| 169 |
+
<h3><label for="content-file-upload"><?php esc_html_e( 'Choose a XML file for content import:', 'pt-ocdi' ); ?></label></h3>
|
| 170 |
+
<input id="ocdi__content-file-upload" type="file" name="content-file-upload">
|
| 171 |
+
</div>
|
| 172 |
+
<div class="ocdi__single-file-upload-container">
|
| 173 |
+
<h3><label for="widget-file-upload"><?php esc_html_e( 'Choose a WIE or JSON file for widget import:', 'pt-ocdi' ); ?></label> <span><?php esc_html_e( '(*optional)', 'pt-ocdi' ); ?></span></h3>
|
| 174 |
+
<input id="ocdi__widget-file-upload" type="file" name="widget-file-upload">
|
| 175 |
+
</div>
|
| 176 |
+
<div class="ocdi__single-file-upload-container">
|
| 177 |
+
<h3><label for="customizer-file-upload"><?php esc_html_e( 'Choose a DAT file for customizer import:', 'pt-ocdi' ); ?></label> <span><?php esc_html_e( '(*optional)', 'pt-ocdi' ); ?></span></h3>
|
| 178 |
+
<input id="ocdi__customizer-file-upload" type="file" name="customizer-file-upload">
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
<?php elseif ( 1 < count( $this->import_files ) ) : ?>
|
| 182 |
+
<div class="ocdi__multi-select-import">
|
| 183 |
+
<h3><?php esc_html_e( 'Choose which demo you want to import:', 'pt-ocdi' ); ?></h3>
|
| 184 |
<select id="ocdi__demo-import-files">
|
| 185 |
<?php foreach ( $this->import_files as $index => $import_file ) : ?>
|
| 186 |
<option value="<?php echo esc_attr( $index ); ?>">
|
| 188 |
</option>
|
| 189 |
<?php endforeach; ?>
|
| 190 |
</select>
|
|
|
|
| 191 |
|
| 192 |
+
<?php
|
| 193 |
+
// Check if at least one preview image is defined, so we can prepare the structure for display.
|
| 194 |
+
$preview_image_is_defined = false;
|
| 195 |
+
foreach ( $this->import_files as $import_file ) {
|
| 196 |
+
if ( isset( $import_file['import_preview_image_url'] ) ) {
|
| 197 |
+
$preview_image_is_defined = true;
|
| 198 |
+
break;
|
| 199 |
+
}
|
| 200 |
}
|
|
|
|
| 201 |
|
| 202 |
+
if ( $preview_image_is_defined ) :
|
| 203 |
+
?>
|
| 204 |
+
<div>
|
| 205 |
+
<p><?php esc_html_e( 'Import preview:', 'pt-ocdi' ); ?></p>
|
| 206 |
+
<p class="ocdi__demo-import-preview-image-message js-ocdi-preview-image-message">
|
| 207 |
+
<?php
|
| 208 |
+
if ( ! isset( $this->import_files[0]['import_preview_image_url'] ) ) {
|
| 209 |
+
esc_html_e( 'No preview image defined for this import.', 'pt-ocdi' );
|
| 210 |
+
}
|
| 211 |
+
// Leave the img tag below and the p tag above available for later changes via JS.
|
| 212 |
+
?>
|
| 213 |
+
</p>
|
| 214 |
+
<img id="ocdi__demo-import-preview-image" class="js-ocdi-preview-image" src="<?php echo ! empty( $this->import_files[0]['import_preview_image_url'] ) ? esc_url( $this->import_files[0]['import_preview_image_url'] ) : ''; ?>">
|
| 215 |
+
</div>
|
| 216 |
+
<?php endif; ?>
|
| 217 |
</div>
|
| 218 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
<div class="ocdi__demo-import-notice js-ocdi-demo-import-notice">
|
| 221 |
<?php
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: capuderg, cyman
|
|
| 3 |
Tags: import, content, demo, data, widgets, settings
|
| 4 |
Requires at least: 4.0.0
|
| 5 |
Tested up to: 4.5
|
| 6 |
-
Stable tag: 1.1.
|
| 7 |
License: GPLv3 or later
|
| 8 |
|
| 9 |
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
|
@@ -146,7 +146,7 @@ function ocdi_plugin_page_setup( $default_settings ) {
|
|
| 146 |
|
| 147 |
return $default_settings;
|
| 148 |
}
|
| 149 |
-
add_filter( 'pt-ocdi/
|
| 150 |
`
|
| 151 |
|
| 152 |
= I can't activate the plugin, because of a fatal error, what can I do? =
|
|
@@ -157,8 +157,21 @@ You want to activate the plugin, but this error shows up:
|
|
| 157 |
|
| 158 |
This happens, because your hosting server is using a very old version of PHP. This plugin requires PHP version of at least **5.3.x**, but we recommend version *5.6.x*. Please contact your hosting company and ask them to update the PHP version for your site.
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
== Changelog ==
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
= 1.1.2 =
|
| 163 |
|
| 164 |
*Release Date - 12 June 2016*
|
|
@@ -166,7 +179,7 @@ This happens, because your hosting server is using a very old version of PHP. Th
|
|
| 166 |
* An 'import notice' field has been added to the predefined demo import settings. This notice is displayed above the import button (it also accepts HTML),
|
| 167 |
* Now displays proper error message, if the file-system method is not set to "direct",
|
| 168 |
* This plugin is now compatible with the new [Humanmade content importer plugin](https://github.com/humanmade/WordPress-Importer),
|
| 169 |
-
* Added a filter to the plugin page creation, so that theme authors can now change the location of the plugin page (Demo data import) and some other parameters as well
|
| 170 |
|
| 171 |
|
| 172 |
= 1.1.1 =
|
| 3 |
Tags: import, content, demo, data, widgets, settings
|
| 4 |
Requires at least: 4.0.0
|
| 5 |
Tested up to: 4.5
|
| 6 |
+
Stable tag: 1.1.3
|
| 7 |
License: GPLv3 or later
|
| 8 |
|
| 9 |
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
| 146 |
|
| 147 |
return $default_settings;
|
| 148 |
}
|
| 149 |
+
add_filter( 'pt-ocdi/plugin_page_setup', 'ocdi_plugin_page_setup' );
|
| 150 |
`
|
| 151 |
|
| 152 |
= I can't activate the plugin, because of a fatal error, what can I do? =
|
| 157 |
|
| 158 |
This happens, because your hosting server is using a very old version of PHP. This plugin requires PHP version of at least **5.3.x**, but we recommend version *5.6.x*. Please contact your hosting company and ask them to update the PHP version for your site.
|
| 159 |
|
| 160 |
+
== Screenshots ==
|
| 161 |
+
|
| 162 |
+
1. Example of multiple predefined demo imports, that a user can choose from.
|
| 163 |
+
2. How the import page looks like, when only one demo import is predefined.
|
| 164 |
+
3. Example of how the import page looks like, when no demo imports are predefined a.k.a manual import.
|
| 165 |
+
|
| 166 |
== Changelog ==
|
| 167 |
|
| 168 |
+
= 1.1.3 =
|
| 169 |
+
|
| 170 |
+
*Release Date - 17 June 2016*
|
| 171 |
+
|
| 172 |
+
* Updated plugin design,
|
| 173 |
+
* Changed the plugin page setup filter name from `pt-ocdi/plugin-page-setup` to `pt-ocdi/plugin_page_setup` (mind the underscore characters instead of dashes).
|
| 174 |
+
|
| 175 |
= 1.1.2 =
|
| 176 |
|
| 177 |
*Release Date - 12 June 2016*
|
| 179 |
* An 'import notice' field has been added to the predefined demo import settings. This notice is displayed above the import button (it also accepts HTML),
|
| 180 |
* Now displays proper error message, if the file-system method is not set to "direct",
|
| 181 |
* This plugin is now compatible with the new [Humanmade content importer plugin](https://github.com/humanmade/WordPress-Importer),
|
| 182 |
+
* Added a filter to the plugin page creation, so that theme authors can now change the location of the plugin page (Demo data import) and some other parameters as well.
|
| 183 |
|
| 184 |
|
| 185 |
= 1.1.1 =
|
