Changeset 3349006
- Timestamp:
- 08/23/2025 02:51:47 PM (7 months ago)
- Location:
- bulk-content-toolkit
- Files:
-
- 12 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from bulk-content-toolkit/trunk)
-
tags/1.1.0/bulk-content-toolkit.php (modified) (1 diff)
-
tags/1.1.0/css/admin.css (modified) (6 diffs)
-
tags/1.1.0/css/user.css (modified) (2 diffs)
-
tags/1.1.0/includes/admin/quick-edit.php (modified) (2 diffs)
-
tags/1.1.0/includes/api/ajax-handlers.php (modified) (5 diffs)
-
tags/1.1.0/readme.txt (modified) (2 diffs)
-
trunk/bulk-content-toolkit.php (modified) (1 diff)
-
trunk/css/admin.css (modified) (6 diffs)
-
trunk/css/user.css (modified) (2 diffs)
-
trunk/includes/admin/quick-edit.php (modified) (2 diffs)
-
trunk/includes/api/ajax-handlers.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bulk-content-toolkit/tags/1.1.0/bulk-content-toolkit.php
r3290986 r3349006 3 3 Plugin Name: Bulk Content Toolkit 4 4 Description: A comprehensive toolkit for efficiently managing bulk actions on various types of content in WordPress, including posts, pages, and custom post types. 5 Version: 1. 0.55 Version: 1.1 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 -
bulk-content-toolkit/tags/1.1.0/css/admin.css
r3188505 r3349006 1 /* Ajoutez ici le style pour rendre votre interface utilisateur plus agréable */ 2 /*.wrap form { 3 background: #fff; 4 padding: 20px; 5 margin-top: 20px; 6 box-shadow: 0 1px 3px rgba(0,0,0,0.13); 7 } 8 9 .wrap form input[type="text"], .wrap form select { 10 width: 100%; 11 max-width: 500px; 12 padding: 10px; 13 margin-top: 10px; 14 }*/ 1 /* Admin styling: modern with subtle neon glow inspired by user.css */ 15 2 .wrap { 16 3 font-family: 'Arial', sans-serif; … … 21 8 border-radius: 4px; 22 9 } 23 24 10 h1 { 25 11 color: #23282d; 26 12 margin-bottom: 20px; 27 13 } 28 29 14 form { 30 15 width: 100%; 31 16 max-width: 800px; 32 17 } 33 34 18 #post_type, #field_name, #new_field_name { 35 19 width: 100%; 36 20 padding: 10px; 37 21 margin: 10px 0; 38 border: 1px solid #ddd;39 border-radius: 4px; 22 border: none; /* Remove solid border */ 23 border-radius: 4px; /* Matches user.css */ 40 24 box-sizing: border-box; 41 25 font-size: 16px; 26 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */ 27 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow contour */ 28 transition: box-shadow 0.3s ease, transform 0.2s ease; 42 29 } 43 30 #post_type:hover, #field_name:hover, #new_field_name:hover { 31 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */ 32 transform: translateY(-1px); /* Slight lift */ 33 } 34 #post_type:focus, #field_name:focus, #new_field_name:focus { 35 box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */ 36 outline: none; 37 } 44 38 #field_name_container { 45 39 margin-top: 20px; 46 40 } 47 48 41 label { 49 42 display: block; … … 51 44 font-weight: bold; 52 45 } 53 54 46 input[type="submit"] { 55 background -color: #0073aa;56 border: none; 47 background: linear-gradient(90deg, #0073aa, #00b7ff); /* Gradient inspired by user.css neon */ 48 border: none; /* Remove solid border */ 57 49 color: white; 58 50 padding: 15px 32px; … … 64 56 cursor: pointer; 65 57 border-radius: 4px; 66 transition: background-color 0.3s ease; 58 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 59 transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 67 60 } 68 69 61 input[type="submit"]:hover { 70 background-color: #005177; 62 background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */ 63 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */ 64 transform: translateY(-1px); 71 65 } 72 73 66 input[type="text"] { 74 67 width: 100%; 75 68 max-width: 400px; 76 69 } 77 78 70 select { 79 background: white;71 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */ 80 72 cursor: pointer; 81 73 } 82 83 /* Pour rendre le formulaire responsive */84 74 @media (max-width: 782px) { 85 75 .wrap { 86 76 margin-right: 10px; 87 77 } 88 89 78 input[type="text"], select { 90 79 width: 100%; 91 80 } 92 81 } 93 94 82 #field-selection-container { 95 83 display: flex; 96 84 justify-content: space-between; 97 align-items: flex-start; /* Pour s'assurer que les éléments sont alignés en haut si leur hauteur diffère */85 align-items: flex-start; 98 86 margin-top: 20px; 99 87 } 100 101 88 .field-list { 102 width: calc(50% - 40px); /* Réduit la largeur pour tenir compte de l'espace entre les deux listes et des flèches */103 border: 1px solid #ddd;89 width: calc(50% - 40px); 90 border: none; /* Remove solid border */ 104 91 padding: 10px; 105 92 height: 300px; 106 93 overflow-y: auto; 107 box-sizing: border-box; /* S'assure que le padding ne s'ajoute pas à la largeur */ 94 box-sizing: border-box; 95 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 108 96 } 109 110 97 .field-list ul { 111 98 list-style-type: none; … … 113 100 margin: 0; 114 101 } 115 116 102 .field-list li { 117 border: 1px solid #ddd;118 margin-top: -1px; /* Pour supprimer l'espace double entre les éléments */103 border: none; /* Remove solid border */ 104 margin-top: -1px; 119 105 background-color: #f6f6f6; 120 106 padding: 12px; 121 107 text-decoration: none; 122 108 font-size: 18px; 123 color: black;109 color: #1a1a1a; 124 110 display: block; 125 111 cursor: pointer; 112 transition: background 0.3s ease, box-shadow 0.3s ease; 113 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 126 114 } 127 128 115 .field-list li:hover { 129 background-color: #ddd; 116 background-color: #e0e0e0; 117 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */ 130 118 } 131 132 119 .field-list li.selected { 133 background-color: #b3d4fc; 120 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient */ 121 color: #fff; 122 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger neon glow */ 134 123 } 135 136 124 .arrows { 137 125 display: flex; 138 126 flex-direction: column; 139 127 justify-content: center; 140 margin: 0 20px; /* Ajoute un peu de marge autour des flèches */128 margin: 0 20px; 141 129 } 142 143 130 .arrow-btn { 144 131 margin: 10px 0; … … 146 133 font-size: 24px; 147 134 cursor: pointer; 148 background -color: #0073aa;135 background: linear-gradient(90deg, #0073aa, #00b7ff); /* Neon gradient */ 149 136 color: #fff; 150 border: none; 151 border-radius: 5px; 152 transition: background-color 0.3s; 137 border: none; /* Remove solid border */ 138 border-radius: 4px; 139 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 140 transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 153 141 } 154 155 142 .arrow-btn:hover { 156 background-color: #005177; 143 background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */ 144 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */ 145 transform: translateY(-1px); 157 146 } 158 159 147 .arrow-btn:focus { 148 box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */ 160 149 outline: none; 161 box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);162 150 } -
bulk-content-toolkit/tags/1.1.0/css/user.css
r3188505 r3349006 1 /* Switch styling: rounded rectangle, neon, glowing knob with soft blue border */ 1 2 .bulk-edit-switch, .bulk-edit-checkbox { 2 3 position: relative; 3 4 display: inline-block; 4 width: 60px; 5 height: 34px; 5 width: 50px; /* Bold and compact */ 6 height: 26px; /* Slim for elegance */ 7 margin: 10px 0 10px 10px; /* Spacing to separate from label */ 6 8 } 7 8 .bulk-edit-switch input, .bulk-edit-checkbox input { 9 .bulk-edit-switch input, .bulk-edit-checkbox input { 9 10 opacity: 0; 10 11 width: 0; 11 12 height: 0; 12 13 } 13 14 14 .slider { 15 15 position: absolute; … … 19 19 right: 0; 20 20 bottom: 0; 21 background-color: #ccc; 22 -webkit-transition: .4s; 23 transition: .4s; 21 background: linear-gradient(90deg, #3a3a3a, #5a5a5a); /* Sleek dark gradient for off state */ 22 transition: background 0.3s ease, box-shadow 0.3s ease; 23 border: 1px solid #00b7ff; /* Soft blue border */ 24 border-radius: 6px; /* Rounded rectangle for modern look */ 25 box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */ 24 26 } 25 26 27 .slider:before { 27 28 position: absolute; 28 29 content: ""; 29 height: 26px; 30 width: 26px; 31 left: 4px; 32 bottom: 4px; 33 background-color: white; 34 -webkit-transition: .4s; 35 transition: .4s; 30 width: 20px; /* Compact knob */ 31 height: 20px; 32 left: 3px; 33 bottom: 2px; 34 background: linear-gradient(90deg, #a0a0a0, #d0d0d0); /* Subtle metallic gradient for off state */ 35 transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease; 36 border: 1px solid #00b7ff; /* Soft blue border for knob */ 37 border-radius: 4px; /* Slightly rounded knob */ 38 box-shadow: 0 2px 6px rgba(0, 183, 255, 0.3); /* Feathered blue glow */ 39 } 40 input:checked + .slider { 41 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Vibrant neon green to blue */ 42 box-shadow: 0 0 12px rgba(0, 255, 136, 0.6); /* Stronger glow */ 43 } 44 input:checked + .slider:before { 45 transform: translateX(24px); /* Adjusted for width */ 46 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient to match slider */ 47 box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); /* Intense glowing effect */ 48 animation: glow-pulse 1.2s infinite ease-in-out; /* Fast, vibrant pulse */ 49 } 50 input:focus + .slider { 51 box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Vibrant focus ring */ 52 } 53 /* Indeterminate state */ 54 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider, 55 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider { 56 background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow gradient */ 57 box-shadow: 0 0 10px rgba(255, 149, 0, 0.6); /* Subtle glow */ 58 } 59 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before, 60 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before { 61 transform: translateX(12px); /* Centered for indeterminate */ 62 background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow to match */ 63 box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); /* Intense glow */ 64 animation: glow-pulse-indeterminate 1.2s infinite ease-in-out; /* Fast pulse */ 65 } 66 /* Hover effect for interactivity */ 67 .slider:hover { 68 box-shadow: 0 0 14px rgba(0, 255, 136, 0.5); /* Stronger hover glow */ 69 } 70 /* Glow pulse animations */ 71 @keyframes glow-pulse { 72 0% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); } 73 50% { box-shadow: 0 0 16px rgba(0, 255, 136, 1), 0 0 22px rgba(0, 255, 136, 0.8); } 74 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); } 75 } 76 @keyframes glow-pulse-indeterminate { 77 0% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); } 78 50% { box-shadow: 0 0 16px rgba(255, 149, 0, 1), 0 0 22px rgba(255, 149, 0, 0.8); } 79 100% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); } 36 80 } 37 81 38 input:checked + .slider { 39 background: linear-gradient(to right, #ff4b2b, #4b88ff); 82 /* Select styling: matching the neon, rounded rectangle aesthetic with soft blue border */ 83 .bulk-edit-select select { 84 width: 100%; 85 max-width: 200px; 86 padding: 8px 12px; 87 border: 1px solid #00b7ff; /* Soft blue border */ 88 border-radius: 4px; /* Slightly rounded for balance */ 89 font-size: 14px; 90 font-weight: 500; /* Bold text for impact */ 91 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient for depth */ 92 color: #1a1a1a; /* Dark text for contrast */ 93 cursor: pointer; 94 transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 95 box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */ 40 96 } 41 42 input:checked + .slider:before { 43 -webkit-transform: translateX(26px); 44 -ms-transform: translateX(26px); 45 transform: translateX(26px); 97 .bulk-edit-select select:hover { 98 box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); /* Hover glow to match switches */ 99 transform: translateY(-1px); /* Slight lift for interactivity */ 46 100 } 47 48 .slider.round { 49 border-radius: 34px; 101 .bulk-edit-select select:focus { 102 border-color: #00ff88; /* Neon green to match on state */ 103 box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Matching focus ring */ 104 outline: none; 50 105 } 51 52 .slider.round:before {53 border-radius: 50%;54 }55 56 .switch-labels {57 display: flex;58 justify-content: space-between;59 width: 60px;60 font-size: 10px;61 position: absolute;62 top: 35px;63 }64 65 .off {66 color: red;67 margin-left: 2px;68 }69 70 .on {71 color: blue;72 margin-right: 2px;73 }74 75 /* Ajoutez ceci pour représenter l'état neutre */76 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,77 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {78 -webkit-transform: translateX(13px);79 -ms-transform: translateX(13px);80 transform: translateX(13px);81 background: #808080; /* Couleur grise ou autre pour indiquer l'état neutre */82 }83 84 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,85 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {86 background: linear-gradient(to right, #ff4b2b, #808080, #4b88ff); /* Gradient ou autre style pour l'état mixte */87 } -
bulk-content-toolkit/tags/1.1.0/includes/admin/quick-edit.php
r3200067 r3349006 85 85 'data-initial-state' => true, 86 86 ), 87 'select' => array( 88 'name' => true, 89 'id' => true, 90 'aria-label' => true, 91 ), 92 'option' => array( 93 'value' => true, 94 'selected' => true, 95 ), 87 96 // Add other tags and attributes as needed 88 97 ); … … 131 140 132 141 function bulkedittoolkit_generate_switch_html($field_name, $context) { 133 return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' . 134 '<!-- Supprimez ou modifiez le label interne -->' . 135 '<div class="slider round"></div>' . 136 '<div class="switch-labels">' . 137 '<span class="off">Off</span>' . 138 '<span class="on">On</span>' . 139 '</div>'; 142 return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' . 143 '<div class="slider"></div>'; 140 144 } 141 145 142 146 function bulkedittoolkit_generate_select_html($field_name, $context) { 143 // Logique pour générer un select 144 return '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '">...</select>'; 147 global $wpdb; 148 149 // Récupérer les valeurs distinctes pour le champ 150 $results = $wpdb->get_results( 151 $wpdb->prepare( 152 "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value != ''", 153 $field_name 154 ) 155 ); 156 157 // Débogage : enregistrer les valeurs récupérées 158 bulkedittoolkit_debug_log("Valeurs récupérées pour $field_name : " . print_r($results, true), $GLOBALS["bulkedittoolkit_is_debug_active"]); 159 160 // Créer le select 161 $html = '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" aria-label="' . esc_attr__('Select value for ', 'bulk-content-toolkit') . esc_html($field_name) . '">'; 162 163 // Ajouter une option par défaut 164 $html .= '<option value="">' . esc_html__('Select a value', 'bulk-content-toolkit') . '</option>'; 165 166 // Ajouter les options 167 foreach ($results as $result) { 168 $value = trim($result->meta_value); 169 if ($value !== '') { 170 $html .= '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; 171 } 172 } 173 174 $html .= '</select>'; 175 176 // Débogage : enregistrer le HTML généré 177 bulkedittoolkit_debug_log("HTML généré pour $field_name : $html", $GLOBALS["bulkedittoolkit_is_debug_active"]); 178 179 return $html; 145 180 } 146 181 -
bulk-content-toolkit/tags/1.1.0/includes/api/ajax-handlers.php
r3200067 r3349006 192 192 } 193 193 194 $distinct_count = count(array_unique(array_column($results, 'meta_value'))); 194 // Calculer le nombre total de valeurs et de valeurs distinctes 195 $total_count = count($results); 196 $distinct_values = array_unique(array_column($results, 'meta_value')); 197 $distinct_count = count($distinct_values); 198 195 199 $potential_types = []; 196 200 … … 252 256 return filter_var($value, FILTER_VALIDATE_URL); 253 257 }; 258 259 // Vérification pour un champ de type select 260 $isSelect = function($distinct_count, $total_count, $distinct_values) { 261 // Critères pour un select : 262 // 1. Nombre de valeurs distinctes raisonnable (par exemple, entre 2 et 20) 263 // 2. Les valeurs doivent être répétées (distinct_count < total_count) 264 // 3. Les valeurs ne doivent pas être trop longues (moins de 50 caractères) 265 // 4. Les valeurs ne doivent pas correspondre à un autre type spécifique 266 if ($distinct_count >= 2 && $distinct_count <= 20 && $distinct_count < $total_count) { 267 foreach ($distinct_values as $value) { 268 if (strlen($value) > 50) { 269 return false; // Les valeurs longues suggèrent un text, pas un select 270 } 271 } 272 return true; 273 } 274 return false; 275 }; 254 276 255 277 // Analyse des valeurs … … 267 289 } elseif ($isDateTime($value)) { 268 290 $potential_types['datetime'] = true; 269 } 270 271 if ($isNumber($value)) { 291 } elseif ($isEmail($value)) { 292 $potential_types['email'] = true; 293 } elseif ($isUrl($value)) { 294 $potential_types['url'] = true; 295 } elseif ($isNumber($value)) { 272 296 if (!isset($potential_types['number']) && !isset($potential_types['range'])) { 273 297 $potential_types[strpos($value, '.') === false ? 'number' : 'range'] = true; // Distinguer entre int et float pour number vs range … … 275 299 } 276 300 277 if ($isEmail($value)) {278 $potential_types['email'] = true;279 } elseif ($isUrl($value)) {280 $potential_types['url'] = true;281 }282 283 301 // Si la longueur de la valeur est importante, on pourrait suggérer un textarea 284 302 if (strlen($value) > 255) { … … 286 304 } 287 305 } 306 307 // Vérifier si c'est un select (après les autres types pour éviter les conflits) 308 if ($isSelect($distinct_count, $total_count, $distinct_values)) { 309 $potential_types['select'] = true; 310 } 288 311 289 312 // Décision basée sur les types potentiels 290 $type_priority = ['checkbox', ' select', 'date', 'datetime', 'email', 'url', 'number', 'range', 'textarea', 'text'];313 $type_priority = ['checkbox', 'date', 'datetime', 'email', 'url', 'number', 'range', 'select', 'textarea', 'text']; 291 314 foreach ($type_priority as $type) { 292 315 if (isset($potential_types[$type])) { -
bulk-content-toolkit/tags/1.1.0/readme.txt
r3290986 r3349006 4 4 Tags: bulk edit, content management, wordpress plugin, bulk actions 5 5 Requires at least: 5.0 6 Tested up to: 6.8 .16 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable Tag: 1. 0.58 Stable Tag: 1.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 12 A WordPress plugin for bulk editing posts, pages, and custom post types with quick actions and custom fields. 11 13 12 14 == Description == … … 45 47 == Changelog == 46 48 49 = 1.1 = 50 - Improved: Enhanced styling for switches and select fields with a subtle neon glow effect, removing solid borders for a cleaner, modern look. 51 - Improved: Added spacing to switches in quick edit to prevent overlap with labels. 52 - Fixed: Corrected rendering of select fields in quick edit to properly display options instead of concatenated values. 53 - Updated: Admin interface styling to align with the neon aesthetic of the quick edit interface. 54 - Tested: Verified compatibility with WordPress 6.8.1. 55 47 56 = 1.0.5 = 48 57 - Vérification et confirmation de la compatibilité avec WordPress 6.8.1. -
bulk-content-toolkit/trunk/bulk-content-toolkit.php
r3290986 r3349006 3 3 Plugin Name: Bulk Content Toolkit 4 4 Description: A comprehensive toolkit for efficiently managing bulk actions on various types of content in WordPress, including posts, pages, and custom post types. 5 Version: 1. 0.55 Version: 1.1 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 -
bulk-content-toolkit/trunk/css/admin.css
r3188505 r3349006 1 /* Ajoutez ici le style pour rendre votre interface utilisateur plus agréable */ 2 /*.wrap form { 3 background: #fff; 4 padding: 20px; 5 margin-top: 20px; 6 box-shadow: 0 1px 3px rgba(0,0,0,0.13); 7 } 8 9 .wrap form input[type="text"], .wrap form select { 10 width: 100%; 11 max-width: 500px; 12 padding: 10px; 13 margin-top: 10px; 14 }*/ 1 /* Admin styling: modern with subtle neon glow inspired by user.css */ 15 2 .wrap { 16 3 font-family: 'Arial', sans-serif; … … 21 8 border-radius: 4px; 22 9 } 23 24 10 h1 { 25 11 color: #23282d; 26 12 margin-bottom: 20px; 27 13 } 28 29 14 form { 30 15 width: 100%; 31 16 max-width: 800px; 32 17 } 33 34 18 #post_type, #field_name, #new_field_name { 35 19 width: 100%; 36 20 padding: 10px; 37 21 margin: 10px 0; 38 border: 1px solid #ddd;39 border-radius: 4px; 22 border: none; /* Remove solid border */ 23 border-radius: 4px; /* Matches user.css */ 40 24 box-sizing: border-box; 41 25 font-size: 16px; 26 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */ 27 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow contour */ 28 transition: box-shadow 0.3s ease, transform 0.2s ease; 42 29 } 43 30 #post_type:hover, #field_name:hover, #new_field_name:hover { 31 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */ 32 transform: translateY(-1px); /* Slight lift */ 33 } 34 #post_type:focus, #field_name:focus, #new_field_name:focus { 35 box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */ 36 outline: none; 37 } 44 38 #field_name_container { 45 39 margin-top: 20px; 46 40 } 47 48 41 label { 49 42 display: block; … … 51 44 font-weight: bold; 52 45 } 53 54 46 input[type="submit"] { 55 background -color: #0073aa;56 border: none; 47 background: linear-gradient(90deg, #0073aa, #00b7ff); /* Gradient inspired by user.css neon */ 48 border: none; /* Remove solid border */ 57 49 color: white; 58 50 padding: 15px 32px; … … 64 56 cursor: pointer; 65 57 border-radius: 4px; 66 transition: background-color 0.3s ease; 58 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 59 transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 67 60 } 68 69 61 input[type="submit"]:hover { 70 background-color: #005177; 62 background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */ 63 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */ 64 transform: translateY(-1px); 71 65 } 72 73 66 input[type="text"] { 74 67 width: 100%; 75 68 max-width: 400px; 76 69 } 77 78 70 select { 79 background: white;71 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */ 80 72 cursor: pointer; 81 73 } 82 83 /* Pour rendre le formulaire responsive */84 74 @media (max-width: 782px) { 85 75 .wrap { 86 76 margin-right: 10px; 87 77 } 88 89 78 input[type="text"], select { 90 79 width: 100%; 91 80 } 92 81 } 93 94 82 #field-selection-container { 95 83 display: flex; 96 84 justify-content: space-between; 97 align-items: flex-start; /* Pour s'assurer que les éléments sont alignés en haut si leur hauteur diffère */85 align-items: flex-start; 98 86 margin-top: 20px; 99 87 } 100 101 88 .field-list { 102 width: calc(50% - 40px); /* Réduit la largeur pour tenir compte de l'espace entre les deux listes et des flèches */103 border: 1px solid #ddd;89 width: calc(50% - 40px); 90 border: none; /* Remove solid border */ 104 91 padding: 10px; 105 92 height: 300px; 106 93 overflow-y: auto; 107 box-sizing: border-box; /* S'assure que le padding ne s'ajoute pas à la largeur */ 94 box-sizing: border-box; 95 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 108 96 } 109 110 97 .field-list ul { 111 98 list-style-type: none; … … 113 100 margin: 0; 114 101 } 115 116 102 .field-list li { 117 border: 1px solid #ddd;118 margin-top: -1px; /* Pour supprimer l'espace double entre les éléments */103 border: none; /* Remove solid border */ 104 margin-top: -1px; 119 105 background-color: #f6f6f6; 120 106 padding: 12px; 121 107 text-decoration: none; 122 108 font-size: 18px; 123 color: black;109 color: #1a1a1a; 124 110 display: block; 125 111 cursor: pointer; 112 transition: background 0.3s ease, box-shadow 0.3s ease; 113 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 126 114 } 127 128 115 .field-list li:hover { 129 background-color: #ddd; 116 background-color: #e0e0e0; 117 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */ 130 118 } 131 132 119 .field-list li.selected { 133 background-color: #b3d4fc; 120 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient */ 121 color: #fff; 122 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger neon glow */ 134 123 } 135 136 124 .arrows { 137 125 display: flex; 138 126 flex-direction: column; 139 127 justify-content: center; 140 margin: 0 20px; /* Ajoute un peu de marge autour des flèches */128 margin: 0 20px; 141 129 } 142 143 130 .arrow-btn { 144 131 margin: 10px 0; … … 146 133 font-size: 24px; 147 134 cursor: pointer; 148 background -color: #0073aa;135 background: linear-gradient(90deg, #0073aa, #00b7ff); /* Neon gradient */ 149 136 color: #fff; 150 border: none; 151 border-radius: 5px; 152 transition: background-color 0.3s; 137 border: none; /* Remove solid border */ 138 border-radius: 4px; 139 box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */ 140 transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 153 141 } 154 155 142 .arrow-btn:hover { 156 background-color: #005177; 143 background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */ 144 box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */ 145 transform: translateY(-1px); 157 146 } 158 159 147 .arrow-btn:focus { 148 box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */ 160 149 outline: none; 161 box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);162 150 } -
bulk-content-toolkit/trunk/css/user.css
r3188505 r3349006 1 /* Switch styling: rounded rectangle, neon, glowing knob with soft blue border */ 1 2 .bulk-edit-switch, .bulk-edit-checkbox { 2 3 position: relative; 3 4 display: inline-block; 4 width: 60px; 5 height: 34px; 5 width: 50px; /* Bold and compact */ 6 height: 26px; /* Slim for elegance */ 7 margin: 10px 0 10px 10px; /* Spacing to separate from label */ 6 8 } 7 8 .bulk-edit-switch input, .bulk-edit-checkbox input { 9 .bulk-edit-switch input, .bulk-edit-checkbox input { 9 10 opacity: 0; 10 11 width: 0; 11 12 height: 0; 12 13 } 13 14 14 .slider { 15 15 position: absolute; … … 19 19 right: 0; 20 20 bottom: 0; 21 background-color: #ccc; 22 -webkit-transition: .4s; 23 transition: .4s; 21 background: linear-gradient(90deg, #3a3a3a, #5a5a5a); /* Sleek dark gradient for off state */ 22 transition: background 0.3s ease, box-shadow 0.3s ease; 23 border: 1px solid #00b7ff; /* Soft blue border */ 24 border-radius: 6px; /* Rounded rectangle for modern look */ 25 box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */ 24 26 } 25 26 27 .slider:before { 27 28 position: absolute; 28 29 content: ""; 29 height: 26px; 30 width: 26px; 31 left: 4px; 32 bottom: 4px; 33 background-color: white; 34 -webkit-transition: .4s; 35 transition: .4s; 30 width: 20px; /* Compact knob */ 31 height: 20px; 32 left: 3px; 33 bottom: 2px; 34 background: linear-gradient(90deg, #a0a0a0, #d0d0d0); /* Subtle metallic gradient for off state */ 35 transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease; 36 border: 1px solid #00b7ff; /* Soft blue border for knob */ 37 border-radius: 4px; /* Slightly rounded knob */ 38 box-shadow: 0 2px 6px rgba(0, 183, 255, 0.3); /* Feathered blue glow */ 39 } 40 input:checked + .slider { 41 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Vibrant neon green to blue */ 42 box-shadow: 0 0 12px rgba(0, 255, 136, 0.6); /* Stronger glow */ 43 } 44 input:checked + .slider:before { 45 transform: translateX(24px); /* Adjusted for width */ 46 background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient to match slider */ 47 box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); /* Intense glowing effect */ 48 animation: glow-pulse 1.2s infinite ease-in-out; /* Fast, vibrant pulse */ 49 } 50 input:focus + .slider { 51 box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Vibrant focus ring */ 52 } 53 /* Indeterminate state */ 54 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider, 55 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider { 56 background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow gradient */ 57 box-shadow: 0 0 10px rgba(255, 149, 0, 0.6); /* Subtle glow */ 58 } 59 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before, 60 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before { 61 transform: translateX(12px); /* Centered for indeterminate */ 62 background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow to match */ 63 box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); /* Intense glow */ 64 animation: glow-pulse-indeterminate 1.2s infinite ease-in-out; /* Fast pulse */ 65 } 66 /* Hover effect for interactivity */ 67 .slider:hover { 68 box-shadow: 0 0 14px rgba(0, 255, 136, 0.5); /* Stronger hover glow */ 69 } 70 /* Glow pulse animations */ 71 @keyframes glow-pulse { 72 0% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); } 73 50% { box-shadow: 0 0 16px rgba(0, 255, 136, 1), 0 0 22px rgba(0, 255, 136, 0.8); } 74 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); } 75 } 76 @keyframes glow-pulse-indeterminate { 77 0% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); } 78 50% { box-shadow: 0 0 16px rgba(255, 149, 0, 1), 0 0 22px rgba(255, 149, 0, 0.8); } 79 100% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); } 36 80 } 37 81 38 input:checked + .slider { 39 background: linear-gradient(to right, #ff4b2b, #4b88ff); 82 /* Select styling: matching the neon, rounded rectangle aesthetic with soft blue border */ 83 .bulk-edit-select select { 84 width: 100%; 85 max-width: 200px; 86 padding: 8px 12px; 87 border: 1px solid #00b7ff; /* Soft blue border */ 88 border-radius: 4px; /* Slightly rounded for balance */ 89 font-size: 14px; 90 font-weight: 500; /* Bold text for impact */ 91 background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient for depth */ 92 color: #1a1a1a; /* Dark text for contrast */ 93 cursor: pointer; 94 transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; 95 box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */ 40 96 } 41 42 input:checked + .slider:before { 43 -webkit-transform: translateX(26px); 44 -ms-transform: translateX(26px); 45 transform: translateX(26px); 97 .bulk-edit-select select:hover { 98 box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); /* Hover glow to match switches */ 99 transform: translateY(-1px); /* Slight lift for interactivity */ 46 100 } 47 48 .slider.round { 49 border-radius: 34px; 101 .bulk-edit-select select:focus { 102 border-color: #00ff88; /* Neon green to match on state */ 103 box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Matching focus ring */ 104 outline: none; 50 105 } 51 52 .slider.round:before {53 border-radius: 50%;54 }55 56 .switch-labels {57 display: flex;58 justify-content: space-between;59 width: 60px;60 font-size: 10px;61 position: absolute;62 top: 35px;63 }64 65 .off {66 color: red;67 margin-left: 2px;68 }69 70 .on {71 color: blue;72 margin-right: 2px;73 }74 75 /* Ajoutez ceci pour représenter l'état neutre */76 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,77 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {78 -webkit-transform: translateX(13px);79 -ms-transform: translateX(13px);80 transform: translateX(13px);81 background: #808080; /* Couleur grise ou autre pour indiquer l'état neutre */82 }83 84 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,85 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {86 background: linear-gradient(to right, #ff4b2b, #808080, #4b88ff); /* Gradient ou autre style pour l'état mixte */87 } -
bulk-content-toolkit/trunk/includes/admin/quick-edit.php
r3200067 r3349006 85 85 'data-initial-state' => true, 86 86 ), 87 'select' => array( 88 'name' => true, 89 'id' => true, 90 'aria-label' => true, 91 ), 92 'option' => array( 93 'value' => true, 94 'selected' => true, 95 ), 87 96 // Add other tags and attributes as needed 88 97 ); … … 131 140 132 141 function bulkedittoolkit_generate_switch_html($field_name, $context) { 133 return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' . 134 '<!-- Supprimez ou modifiez le label interne -->' . 135 '<div class="slider round"></div>' . 136 '<div class="switch-labels">' . 137 '<span class="off">Off</span>' . 138 '<span class="on">On</span>' . 139 '</div>'; 142 return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' . 143 '<div class="slider"></div>'; 140 144 } 141 145 142 146 function bulkedittoolkit_generate_select_html($field_name, $context) { 143 // Logique pour générer un select 144 return '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '">...</select>'; 147 global $wpdb; 148 149 // Récupérer les valeurs distinctes pour le champ 150 $results = $wpdb->get_results( 151 $wpdb->prepare( 152 "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value != ''", 153 $field_name 154 ) 155 ); 156 157 // Débogage : enregistrer les valeurs récupérées 158 bulkedittoolkit_debug_log("Valeurs récupérées pour $field_name : " . print_r($results, true), $GLOBALS["bulkedittoolkit_is_debug_active"]); 159 160 // Créer le select 161 $html = '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" aria-label="' . esc_attr__('Select value for ', 'bulk-content-toolkit') . esc_html($field_name) . '">'; 162 163 // Ajouter une option par défaut 164 $html .= '<option value="">' . esc_html__('Select a value', 'bulk-content-toolkit') . '</option>'; 165 166 // Ajouter les options 167 foreach ($results as $result) { 168 $value = trim($result->meta_value); 169 if ($value !== '') { 170 $html .= '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; 171 } 172 } 173 174 $html .= '</select>'; 175 176 // Débogage : enregistrer le HTML généré 177 bulkedittoolkit_debug_log("HTML généré pour $field_name : $html", $GLOBALS["bulkedittoolkit_is_debug_active"]); 178 179 return $html; 145 180 } 146 181 -
bulk-content-toolkit/trunk/includes/api/ajax-handlers.php
r3200067 r3349006 192 192 } 193 193 194 $distinct_count = count(array_unique(array_column($results, 'meta_value'))); 194 // Calculer le nombre total de valeurs et de valeurs distinctes 195 $total_count = count($results); 196 $distinct_values = array_unique(array_column($results, 'meta_value')); 197 $distinct_count = count($distinct_values); 198 195 199 $potential_types = []; 196 200 … … 252 256 return filter_var($value, FILTER_VALIDATE_URL); 253 257 }; 258 259 // Vérification pour un champ de type select 260 $isSelect = function($distinct_count, $total_count, $distinct_values) { 261 // Critères pour un select : 262 // 1. Nombre de valeurs distinctes raisonnable (par exemple, entre 2 et 20) 263 // 2. Les valeurs doivent être répétées (distinct_count < total_count) 264 // 3. Les valeurs ne doivent pas être trop longues (moins de 50 caractères) 265 // 4. Les valeurs ne doivent pas correspondre à un autre type spécifique 266 if ($distinct_count >= 2 && $distinct_count <= 20 && $distinct_count < $total_count) { 267 foreach ($distinct_values as $value) { 268 if (strlen($value) > 50) { 269 return false; // Les valeurs longues suggèrent un text, pas un select 270 } 271 } 272 return true; 273 } 274 return false; 275 }; 254 276 255 277 // Analyse des valeurs … … 267 289 } elseif ($isDateTime($value)) { 268 290 $potential_types['datetime'] = true; 269 } 270 271 if ($isNumber($value)) { 291 } elseif ($isEmail($value)) { 292 $potential_types['email'] = true; 293 } elseif ($isUrl($value)) { 294 $potential_types['url'] = true; 295 } elseif ($isNumber($value)) { 272 296 if (!isset($potential_types['number']) && !isset($potential_types['range'])) { 273 297 $potential_types[strpos($value, '.') === false ? 'number' : 'range'] = true; // Distinguer entre int et float pour number vs range … … 275 299 } 276 300 277 if ($isEmail($value)) {278 $potential_types['email'] = true;279 } elseif ($isUrl($value)) {280 $potential_types['url'] = true;281 }282 283 301 // Si la longueur de la valeur est importante, on pourrait suggérer un textarea 284 302 if (strlen($value) > 255) { … … 286 304 } 287 305 } 306 307 // Vérifier si c'est un select (après les autres types pour éviter les conflits) 308 if ($isSelect($distinct_count, $total_count, $distinct_values)) { 309 $potential_types['select'] = true; 310 } 288 311 289 312 // Décision basée sur les types potentiels 290 $type_priority = ['checkbox', ' select', 'date', 'datetime', 'email', 'url', 'number', 'range', 'textarea', 'text'];313 $type_priority = ['checkbox', 'date', 'datetime', 'email', 'url', 'number', 'range', 'select', 'textarea', 'text']; 291 314 foreach ($type_priority as $type) { 292 315 if (isset($potential_types[$type])) { -
bulk-content-toolkit/trunk/readme.txt
r3290986 r3349006 4 4 Tags: bulk edit, content management, wordpress plugin, bulk actions 5 5 Requires at least: 5.0 6 Tested up to: 6.8 .16 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable Tag: 1. 0.58 Stable Tag: 1.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 12 A WordPress plugin for bulk editing posts, pages, and custom post types with quick actions and custom fields. 11 13 12 14 == Description == … … 45 47 == Changelog == 46 48 49 = 1.1 = 50 - Improved: Enhanced styling for switches and select fields with a subtle neon glow effect, removing solid borders for a cleaner, modern look. 51 - Improved: Added spacing to switches in quick edit to prevent overlap with labels. 52 - Fixed: Corrected rendering of select fields in quick edit to properly display options instead of concatenated values. 53 - Updated: Admin interface styling to align with the neon aesthetic of the quick edit interface. 54 - Tested: Verified compatibility with WordPress 6.8.1. 55 47 56 = 1.0.5 = 48 57 - Vérification et confirmation de la compatibilité avec WordPress 6.8.1.
Note: See TracChangeset
for help on using the changeset viewer.