Skip to content

Commit 2db5021

Browse files
committed
search added in category and parent list
1 parent dadc7c4 commit 2db5021

7 files changed

Lines changed: 135 additions & 14 deletions

File tree

assets/css/admin.css

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,72 @@
259259
transition: all 0.2s ease;
260260
}
261261

262+
/* --- SlimSelect Geist Overrides --- */
263+
.ss-main {
264+
border-radius: 6px !important;
265+
border: 1px solid var(--wbpg-border) !important;
266+
background-color: var(--wbpg-bg-card) !important;
267+
padding: 0 8px !important;
268+
font-family: inherit !important;
269+
transition: var(--wbpg-transition) !important;
270+
height: 38px;
271+
color: var(--wbpg-text) !important;
272+
}
273+
274+
.ss-main:focus {
275+
border-color: var(--wbpg-accent) !important;
276+
box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1) !important;
277+
}
278+
279+
.ss-content {
280+
background-color: var(--wbpg-bg-card) !important;
281+
border: 1px solid var(--wbpg-border) !important;
282+
border-top: none !important;
283+
border-radius: 0 0 6px 6px !important;
284+
box-shadow: var(--wbpg-shadow) !important;
285+
}
286+
287+
.ss-search input {
288+
background-color: var(--wbpg-bg-page) !important;
289+
border: 1px solid var(--wbpg-border) !important;
290+
border-radius: 4px !important;
291+
color: var(--wbpg-text) !important;
292+
}
293+
294+
.ss-list .ss-option {
295+
padding: 8px 12px !important;
296+
font-size: 13px !important;
297+
color: var(--wbpg-text-muted) !important;
298+
transition: var(--wbpg-transition) !important;
299+
}
300+
301+
.ss-list .ss-option:hover,
302+
.ss-list .ss-option.ss-highlighted {
303+
background-color: var(--wbpg-bg-page) !important;
304+
color: var(--wbpg-text) !important;
305+
}
306+
307+
.ss-list .ss-option.ss-selected {
308+
background-color: rgba(0, 112, 243, 0.1) !important;
309+
color: var(--wbpg-accent) !important;
310+
}
311+
312+
.ss-placeholder {
313+
color: var(--wbpg-text-muted) !important;
314+
}
315+
316+
.ss-arrow path {
317+
stroke: var(--wbpg-text-muted) !important;
318+
}
319+
320+
[data-theme="dark"] .ss-content {
321+
background-color: #111 !important;
322+
}
323+
324+
[data-theme="dark"] .ss-search input {
325+
background-color: #000 !important;
326+
}
327+
262328
.wbpg-setup select {
263329
appearance: none !important;
264330
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%236b7280'%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E") !important;

assets/js/admin.js

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jQuery(document).ready(function ($) {
2323
let currentTaxonomy = '';
2424
let availablePostTypes = {};
2525
let isCreating = false;
26+
let slimSelects = {}; // Track SS instances by row ID
2627
const i18n = wbpgData.i18n;
2728

2829
// Theme Toggle Logic
@@ -187,12 +188,36 @@ jQuery(document).ready(function ($) {
187188
}
188189
}
189190

191+
function initSlimSelect($select, rowId) {
192+
if (typeof SlimSelect !== 'function') return;
193+
194+
// Destroy existing instance if it exists
195+
if (slimSelects[rowId]) {
196+
slimSelects[rowId].destroy();
197+
}
198+
199+
slimSelects[rowId] = new SlimSelect({
200+
select: $select[0],
201+
settings: {
202+
placeholderText: i18n.search || 'Search...',
203+
searchText: i18n.no_results || 'No results found',
204+
searchHighlight: true
205+
}
206+
});
207+
}
208+
190209
function refreshDropdowns() {
191210
$('.wbpg-row .wbpg-row-parent').each(function () {
192211
const $select = $(this);
193-
if ($select.closest('tr').find('.wbpg-status-icon').hasClass('pending')) {
212+
const $row = $select.closest('tr');
213+
const rowId = $row.attr('id');
214+
215+
if ($row.find('.wbpg-status-icon').hasClass('pending')) {
194216
const currentVal = $select.val();
195217
$select.html(parentOptionsHtml).val(currentVal);
218+
219+
// Re-init SlimSelect if hierarchy changed
220+
initSlimSelect($select, rowId);
196221
}
197222
});
198223
}
@@ -218,9 +243,12 @@ jQuery(document).ready(function ($) {
218243
$this.val(currentPostType);
219244
return;
220245
}
221-
$rowsContainer.empty();
222246
$listWrapper.hide();
223247
$summaryBox.hide();
248+
249+
// Clear all SS instances
250+
Object.values(slimSelects).forEach(ss => ss.destroy());
251+
slimSelects = {};
224252
}
225253

226254
currentPostType = val;
@@ -268,6 +296,14 @@ jQuery(document).ready(function ($) {
268296
fragment.appendChild(tempTbody.firstChild);
269297
}
270298
$rowsContainer[0].appendChild(fragment);
299+
300+
// Batch initialize SlimSelect for performance
301+
$rowsContainer.find('.wbpg-row-parent').each(function () {
302+
const $select = $(this);
303+
const rowId = $select.closest('tr').attr('id');
304+
initSlimSelect($select, rowId);
305+
});
306+
271307
initTooltips(); // Re-init for new icons
272308

273309
$listWrapper.show();
@@ -331,7 +367,13 @@ jQuery(document).ready(function ($) {
331367
if (selected.length === 0) return;
332368

333369
if (confirm(i18n.confirm_remove.replace('%d', selected.length))) {
334-
selected.closest('tr').fadeOut(300, function () {
370+
selected.closest('tr').each(function () {
371+
const rowId = $(this).attr('id');
372+
if (slimSelects[rowId]) {
373+
slimSelects[rowId].destroy();
374+
delete slimSelects[rowId];
375+
}
376+
}).fadeOut(300, function () {
335377
$(this).remove();
336378
toggleBulkActions();
337379
if ($('.wbpg-row').length === 0) {
@@ -346,7 +388,14 @@ jQuery(document).ready(function ($) {
346388
$rowsContainer.on('click keydown', '.wbpg-row-remove', function (e) {
347389
if (e.type === 'keydown' && e.key !== 'Enter' && e.key !== ' ') return;
348390

349-
$(this).closest('tr').fadeOut(300, function () {
391+
const $row = $(this).closest('tr');
392+
const rowId = $row.attr('id');
393+
394+
$row.fadeOut(300, function () {
395+
if (slimSelects[rowId]) {
396+
slimSelects[rowId].destroy();
397+
delete slimSelects[rowId];
398+
}
350399
$(this).remove();
351400
toggleBulkActions();
352401
if ($('.wbpg-row').length === 0) {
@@ -528,12 +577,12 @@ jQuery(document).ready(function ($) {
528577
$('#wbpg-results-container').hide();
529578
$('#wbpg-start-over-btn').hide();
530579

531-
// Reset Table
532-
$rowsContainer.empty();
533-
$listWrapper.hide();
534-
$('#wbpg-select-all').prop('checked', false);
535580
$('#wbpg-delete-selected-btn').hide();
536581

582+
// Clear all SS instances
583+
Object.values(slimSelects).forEach(ss => ss.destroy());
584+
slimSelects = {};
585+
537586
// Reset selection
538587
$('#wbpg-post-type').val('');
539588
$('#wbpg-generate-row').hide();

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"name": "WP Bulk Pages Generator",
2828
"applicationCategory": "SEO/BusinessApplication",
2929
"operatingSystem": "WordPress 6.0+",
30-
"softwareVersion": "1.0.0",
30+
"softwareVersion": "1.0.1",
3131
"description": "High-performance bulk page generation engine for WordPress.",
3232
"author": {
3333
"@type": "Person",

includes/class-bulk-pages-admin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ public function enqueue_assets( $hook ) {
7474
wp_enqueue_script( 'wbpg-popper', 'https://unpkg.com/@popperjs/core@2', array(), '2.11.8', true );
7575
wp_enqueue_script( 'wbpg-tippy', 'https://unpkg.com/tippy.js@6', array( 'wbpg-popper' ), '6.3.7', true );
7676

77+
// Enqueue SlimSelect
78+
wp_enqueue_style( 'wbpg-slimselect-css', 'https://unpkg.com/slim-select@2.8.2/dist/slimselect.css', array(), '2.8.2' );
79+
wp_enqueue_script( 'wbpg-slimselect-js', 'https://unpkg.com/slim-select@2.8.2/dist/slimselect.min.js', array(), '2.8.2', true );
80+
7781
wp_enqueue_style( 'wbpg-admin-style', WBPG_PLUGIN_URL . 'assets/css/admin.css', array(), WBPG_VERSION );
78-
wp_enqueue_script( 'wbpg-admin-script', WBPG_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'wbpg-tippy' ), WBPG_VERSION, true );
82+
wp_enqueue_script( 'wbpg-admin-script', WBPG_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'wbpg-tippy', 'wbpg-slimselect-js' ), WBPG_VERSION, true );
7983

8084
// Localize Script
8185
wp_localize_script( 'wbpg-admin-script', 'wbpgData', array(
@@ -123,6 +127,8 @@ public function enqueue_assets( $hook ) {
123127
'generate_btn' => __( 'Generate %ss', 'wp-bulk-pages-generator' ),
124128
'copy' => __( 'Copy', 'wp-bulk-pages-generator' ),
125129
'copied' => __( 'Copied!', 'wp-bulk-pages-generator' ),
130+
'search' => __( 'Search...', 'wp-bulk-pages-generator' ),
131+
'no_results' => __( 'No results found', 'wp-bulk-pages-generator' ),
126132
)
127133
) );
128134
}

includes/class-bulk-pages-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function get_parents( $request ) {
175175
$prefix = '';
176176
$ancestors = get_post_ancestors( $page->ID );
177177
if ( ! empty( $ancestors ) ) {
178-
$prefix = str_repeat( '— ', count( $ancestors ) );
178+
$prefix = str_repeat( '- ', count( $ancestors ) );
179179
}
180180

181181
$results[] = array(

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="https://raw.githubusercontent.com/fortawesome/Font-Awesome/6.x/svgs/solid/rocket.svg" width="100" height="100" alt="WP Bulk Pages Generator Rocket Logo">
33

44
# WP Bulk Pages Generator 🚀
5-
### *The Ultimate Enterprise-Grade Bulk Content Engine for WordPress 2026*
5+
### *The Ultimate Enterprise-Grade Bulk Content Engine for WordPress 2026 (v1.0.1)*
66

77
**Deploy Landing Pages, SEO Silos, and Content Batches in Seconds with the Speed of Geist.**
88

wp-bulk-pages-generator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WP Bulk Pages Generator
44
* Plugin URI: https://github.com/boopathirbk/wp-bulk-pages-generator
55
* Description: A modern, user-friendly plugin to bulk create pages with titles, slugs, parent pages, and block content.
6-
* Version: 1.0.0
6+
* Version: 1.0.1
77
* Author: Boopathi R
88
* Author URI: https://github.com/boopathirbk
99
* Text Domain: wp-bulk-pages-generator
@@ -18,7 +18,7 @@
1818
}
1919

2020
// Define Plugin Constants
21-
define( 'WBPG_VERSION', '1.0.0' );
21+
define( 'WBPG_VERSION', '1.0.1' );
2222
define( 'WBPG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
2323
define( 'WBPG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
2424

0 commit comments

Comments
 (0)