Bulk Page Creator - Version 1.1.2

Version Description

Maintenance Version Release

=

Download this release

Release Info

Developer DaganLev
Plugin Icon wp plugin Bulk Page Creator
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Files changed (2) hide show
  1. bulk-page-creator.php +12 -6
  2. readme.txt +4 -1
bulk-page-creator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Bulk Page Creator
4
  Plugin URI: https://solid-code.co.uk/
5
  Description: Allows you to create multiple pages in a batch/bulk manner saving time when initially setting up your WordPress site.
6
- Version: 1.1.1
7
  Author: Dagan Lev
8
  Author URI: https://solid-code.co.uk
9
 
@@ -77,15 +77,21 @@ if (!class_exists("sc_bulk_page_creator")) {
77
 
78
  $pcontent = '';
79
  if($_POST['pcontent']=='2'){
80
- $pcontent = str_ireplace('[pagetitle]','<h1>' . htmlentities($rres[5]) . '</h1>',$_POST['sc-pages-content']);
81
  }
82
 
 
 
 
 
 
 
83
  $params = array(
84
  'post_type' => 'page',
85
- 'post_status' => $_POST['posttype'],
86
  'post_parent' => $parent,
87
- 'post_title' => rtrim($rres[5]),
88
- 'page_template' => rtrim($rres[6]),
89
  'post_content' => $pcontent);
90
 
91
  global $wpdb;
@@ -145,7 +151,7 @@ if (!class_exists("sc_bulk_page_creator")) {
145
  </tr>
146
  </table>
147
 
148
- <form id="sc-add-pages" name="sc-add-pages" method="post" action="?page=<?php echo $_GET['page']; ?>">
149
  <textarea id="sc-pages" name="sc-pages" style="display:none;"></textarea>
150
  <p>When you are ready to commit your changes to the site just click the button below...</p>
151
  <select id="pcontent" name="pcontent">
3
  Plugin Name: Bulk Page Creator
4
  Plugin URI: https://solid-code.co.uk/
5
  Description: Allows you to create multiple pages in a batch/bulk manner saving time when initially setting up your WordPress site.
6
+ Version: 1.1.2
7
  Author: Dagan Lev
8
  Author URI: https://solid-code.co.uk
9
 
77
 
78
  $pcontent = '';
79
  if($_POST['pcontent']=='2'){
80
+ $pcontent = str_ireplace('[pagetitle]','<h1>' . sanitize_text_field(htmlentities($rres[5])) . '</h1>',sanitize_textarea_field($_POST['sc-pages-content']));
81
  }
82
 
83
+ //sanitize type
84
+ $posttype = 'publish';
85
+ if(isset($_POST['posttype']) && preg_match('#^(draft|publish)$#', $_POST['posttype'])){
86
+ $posttype = $_POST['posttype'];
87
+ }
88
+
89
  $params = array(
90
  'post_type' => 'page',
91
+ 'post_status' => $posttype,
92
  'post_parent' => $parent,
93
+ 'post_title' => sanitize_text_field(rtrim($rres[5])),
94
+ 'page_template' => sanitize_text_field(rtrim($rres[6])),
95
  'post_content' => $pcontent);
96
 
97
  global $wpdb;
151
  </tr>
152
  </table>
153
 
154
+ <form id="sc-add-pages" name="sc-add-pages" method="post" action="?page=sc_bpc_page">
155
  <textarea id="sc-pages" name="sc-pages" style="display:none;"></textarea>
156
  <p>When you are ready to commit your changes to the site just click the button below...</p>
157
  <select id="pcontent" name="pcontent">
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: DaganLev
3
  Tags: Solid Code, Dagan Lev, Bulk Page Creator, batch action, add pages, add posts
4
  Requires at least: 3.1
5
- Tested up to: 5.0.0
6
  Stable tag: trunk
7
 
8
  Allows you to create multiple pages in a batch/bulk manner saving time when initially setting up your WordPress site
@@ -55,6 +55,9 @@ Deprecated class constructor for PHP 7 support
55
  = 1.1.1 =
56
  Maintenance Version Release
57
 
 
 
 
58
  == Screenshots ==
59
 
60
  1. View of bulk page creator screen
2
  Contributors: DaganLev
3
  Tags: Solid Code, Dagan Lev, Bulk Page Creator, batch action, add pages, add posts
4
  Requires at least: 3.1
5
+ Tested up to: 5.7.2
6
  Stable tag: trunk
7
 
8
  Allows you to create multiple pages in a batch/bulk manner saving time when initially setting up your WordPress site
55
  = 1.1.1 =
56
  Maintenance Version Release
57
 
58
+ = 1.1.2 =
59
+ Maintenance Version Release
60
+
61
  == Screenshots ==
62
 
63
  1. View of bulk page creator screen