Changeset 3479600
- Timestamp:
- 03/10/2026 11:07:44 PM (3 weeks ago)
- Location:
- editx
- Files:
-
- 91 added
- 8 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
tags/0.1.1 (added)
-
tags/0.1.1/README.txt (added)
-
tags/0.1.1/build (added)
-
tags/0.1.1/build/i18n-loader.asset.php (added)
-
tags/0.1.1/build/i18n-loader.js (added)
-
tags/0.1.1/build/index-rtl.css (added)
-
tags/0.1.1/build/index.asset.php (added)
-
tags/0.1.1/build/index.css (added)
-
tags/0.1.1/build/index.js (added)
-
tags/0.1.1/build/style-index-rtl.css (added)
-
tags/0.1.1/build/style-index.css (added)
-
tags/0.1.1/composer.json (added)
-
tags/0.1.1/editx.php (added)
-
tags/0.1.1/includes (added)
-
tags/0.1.1/includes/Abstracts (added)
-
tags/0.1.1/includes/Abstracts/RestApi.php (added)
-
tags/0.1.1/includes/Admin (added)
-
tags/0.1.1/includes/Admin/Menu.php (added)
-
tags/0.1.1/includes/Ajax (added)
-
tags/0.1.1/includes/Ajax/Manager.php (added)
-
tags/0.1.1/includes/Api (added)
-
tags/0.1.1/includes/Api/Controller.php (added)
-
tags/0.1.1/includes/Api/Types (added)
-
tags/0.1.1/includes/Api/Types/Action.php (added)
-
tags/0.1.1/includes/Api/Types/Addon.php (added)
-
tags/0.1.1/includes/Api/Types/AdminColumn.php (added)
-
tags/0.1.1/includes/Api/Types/AdminMenu.php (added)
-
tags/0.1.1/includes/Api/Types/Restriction.php (added)
-
tags/0.1.1/includes/Api/Types/Setting.php (added)
-
tags/0.1.1/includes/Assets (added)
-
tags/0.1.1/includes/Assets/Manager.php (added)
-
tags/0.1.1/includes/Helpers (added)
-
tags/0.1.1/includes/Helpers/AdminColumn (added)
-
tags/0.1.1/includes/Helpers/AdminColumn/Fns.php (added)
-
tags/0.1.1/includes/Helpers/AdminColumn/WpListTableFactory.php (added)
-
tags/0.1.1/includes/Helpers/Fns.php (added)
-
tags/0.1.1/includes/Helpers/Keys.php (added)
-
tags/0.1.1/includes/Hooks (added)
-
tags/0.1.1/includes/Hooks/Manager.php (added)
-
tags/0.1.1/includes/Hooks/Types (added)
-
tags/0.1.1/includes/Hooks/Types/Action (added)
-
tags/0.1.1/includes/Hooks/Types/Action/ActionCtrl.php (added)
-
tags/0.1.1/includes/Hooks/Types/Action/Types (added)
-
tags/0.1.1/includes/Hooks/Types/Action/Types/AdminColumn.php (added)
-
tags/0.1.1/includes/Hooks/Types/Action/Types/NavMenu.php (added)
-
tags/0.1.1/includes/Hooks/Types/Filter (added)
-
tags/0.1.1/includes/Hooks/Types/Filter/FilterCtrl.php (added)
-
tags/0.1.1/includes/Hooks/Types/Filter/Types (added)
-
tags/0.1.1/includes/Hooks/Types/Filter/Types/ActionLink.php (added)
-
tags/0.1.1/includes/Hooks/Types/Filter/Types/AdminColumn.php (added)
-
tags/0.1.1/includes/Hooks/Types/Filter/Types/NavMenu.php (added)
-
tags/0.1.1/includes/Models (added)
-
tags/0.1.1/includes/Models/AdminColumn.php (added)
-
tags/0.1.1/includes/Setup (added)
-
tags/0.1.1/includes/Setup/Installer.php (added)
-
tags/0.1.1/includes/Traits (added)
-
tags/0.1.1/includes/Traits/Sanitizer.php (added)
-
tags/0.1.1/includes/Traits/Singleton.php (added)
-
tags/0.1.1/index.php (added)
-
tags/0.1.1/languages (added)
-
tags/0.1.1/languages/editx.pot (added)
-
tags/0.1.1/phpcs.xml (added)
-
tags/0.1.1/templates (added)
-
tags/0.1.1/templates/app.php (added)
-
tags/0.1.1/vendor (added)
-
tags/0.1.1/vendor/autoload.php (added)
-
tags/0.1.1/vendor/composer (added)
-
tags/0.1.1/vendor/composer/ClassLoader.php (added)
-
tags/0.1.1/vendor/composer/InstalledVersions.php (added)
-
tags/0.1.1/vendor/composer/LICENSE (added)
-
tags/0.1.1/vendor/composer/autoload_classmap.php (added)
-
tags/0.1.1/vendor/composer/autoload_namespaces.php (added)
-
tags/0.1.1/vendor/composer/autoload_psr4.php (added)
-
tags/0.1.1/vendor/composer/autoload_real.php (added)
-
tags/0.1.1/vendor/composer/autoload_static.php (added)
-
tags/0.1.1/vendor/composer/installed.json (added)
-
tags/0.1.1/vendor/composer/installed.php (added)
-
tags/0.1.1/vendor/composer/platform_check.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/build (added)
-
trunk/build/i18n-loader.asset.php (added)
-
trunk/build/i18n-loader.js (added)
-
trunk/build/index-rtl.css (added)
-
trunk/build/index.asset.php (added)
-
trunk/build/index.css (added)
-
trunk/build/index.js (added)
-
trunk/build/style-index-rtl.css (added)
-
trunk/build/style-index.css (added)
-
trunk/editx.php (modified) (3 diffs)
-
trunk/includes/Admin/Menu.php (modified) (9 diffs)
-
trunk/includes/Api/Types/AdminColumn.php (modified) (3 diffs)
-
trunk/includes/Api/Types/AdminMenu.php (modified) (2 diffs)
-
trunk/includes/Assets/Manager.php (modified) (2 diffs)
-
trunk/includes/Hooks/Types/Filter/Types/AdminColumn.php (modified) (1 diff)
-
trunk/languages/editx.pot (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
editx/trunk/README.txt
r3478674 r3479600 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 0.1. 07 Stable tag: 0.1.1 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 11 11 Author URI: https://softtent.com 12 12 13 A customization plugin for WordPress 13 Customize your WordPress admin — edit menus, manage table columns, and restrict access by user or role. 14 14 15 15 == Description == 16 EditX is a simple, yet powerful customization plugin for WordPress. It's easy to customize and extend according to your needs. 16 17 EditX gives WordPress administrators full control over the admin experience. Customize the admin menu layout, choose which columns appear in list tables, and restrict access to menu items for specific users or roles — all from a clean, modern interface. 18 19 **Admin Menu Editor** 20 Drag and rearrange admin menu items, hide menus you don't need, and reorder submenus to match your workflow. Changes are stored and applied on every page load. 21 22 **Admin Column Editor** 23 Choose exactly which columns appear in your admin list tables — Posts, Pages, Media, Comments, Users, and all custom post types. Remove clutter and focus on the data that matters. 24 25 **Manage Restrictions** 26 Restrict which admin menu items are visible to specific users or roles. Role-based restrictions apply to everyone in that role; user-level restrictions override role settings for individual users. Administrators are always protected from restriction. 27 28 **Addons** 29 Each feature is a toggleable addon. Enable or disable Admin Menu Editor, Admin Column Editor, and Restrictions independently from the Addons screen. 17 30 18 31 == Installation == 19 1. Upload `editx` to the `/wp-content/plugins/` directory. 20 2. Activate the plugin through the 'Plugins' menu in WordPress. 21 3. Start using the plugin or develop it further as per your requirements. 32 33 1. Upload the `editx` folder to the `/wp-content/plugins/` directory. 34 2. Activate the plugin through the **Plugins** menu in WordPress. 35 3. Navigate to **Dashboard > EditX** to get started. 22 36 23 37 == Frequently Asked Questions == 24 38 25 = How to use this plugin=39 = How do I edit the admin menu? = 26 40 27 * Go to Dashboard > EditX > Admin Menu Editor. 28 * Go to Dashboard > EditX > Admin Column Editor. 41 Go to **Dashboard > EditX > Admin Menu Editor**. You can reorder and customize admin menus from there. 42 43 = How do I customize table columns? = 44 45 Go to **Dashboard > EditX > Admin Column Editor**. Select the screen you want to customize and toggle the columns you need. 46 47 = How do I restrict menu access for a role? = 48 49 Go to **Dashboard > EditX > Manage Restrictions**, choose the **Roles** tab, select a role, and configure which menus they can access. 50 51 = Can I restrict access for a specific user? = 52 53 Yes. Under **Manage Restrictions**, switch to the **Users** tab and configure access for an individual user. User-level settings override role-level settings. 54 55 = Can I disable a feature I don't need? = 56 57 Yes. Go to **Dashboard > EditX > Addons** and toggle any addon on or off. 29 58 30 59 = Where can I find documentation? = 31 For detailed documentation, visit [https://softtent.com](https://softtent.com).32 60 33 = Need Any Help? = 61 Visit [https://softtent.com](https://softtent.com) for full documentation. 34 62 35 * Please mail us at `contact@softtent.com` 63 = Need help? = 64 65 Email us at `contact@softtent.com` 66 67 == Screenshots == 68 69 1. Admin Menu Editor — reorder and customize admin menus 70 2. Admin Column Editor — manage columns in list tables 71 3. Manage Restrictions — restrict menu access by role or user 72 4. Addons — enable or disable individual features 36 73 37 74 == Changelog == 75 76 = 0.1.1 = 77 * Updated: Admin Menu Editor 78 * Updated: Admin Column Editor 79 * Updated: Manage Restrictions 80 38 81 = 0.1.0 = 39 82 * Initial release. 40 83 41 84 == Upgrade Notice == 42 = 0.1.0 =43 This is the first version of EditX.44 85 45 == Screenshots == 46 1. Admin Menu Editor 47 2. Admin Column Editor 86 = 0.1.1 = 87 * Updated: Admin Menu Editor 88 * Updated: Admin Column Editor 89 * Updated: Manage Restrictions 48 90 49 91 == Additional Information == 50 For more information and updates, visit the official website [https://softtent.com](https://softtent.com). 92 93 For more information and updates, visit [https://softtent.com](https://softtent.com). 51 94 52 95 == License == 96 53 97 This plugin is licensed under the GPL-2.0-or-later License. 54 55 == Source Code ==56 The source code for this plugin can be found on [GitHub](https://github.com/softtent/editx). All development instructions are mentioned there. -
editx/trunk/editx.php
r3478674 r3479600 11 11 * Plugin Name: EditX 12 12 * Plugin URI: https://wordpress.org/plugins/editx 13 * Description: A customizationplugin for WordPress14 * Version: 0.1. 013 * Description: A admin menu editor, admin column editor, and admin access control plugin for WordPress 14 * Version: 0.1.1 15 15 * Author: SoftTent 16 16 * Author URI: https://softtent.com … … 131 131 */ 132 132 public function define_constants() { 133 define( 'EDITX_VERSION', '0.1. 0' );133 define( 'EDITX_VERSION', '0.1.1' ); 134 134 define( 'EDITX_SLUG', 'editx' ); 135 135 define( 'EDITX_FILE', __FILE__ ); … … 138 138 define( 'EDITX_URL', plugins_url( '', EDITX_FILE ) ); 139 139 define( 'EDITX_TEMPLATE_PATH', EDITX_PATH . '/templates' ); 140 define( 'EDITX_ASSETS', EDITX_URL . '/ assets' );140 define( 'EDITX_ASSETS', EDITX_URL . '/build' ); 141 141 } 142 142 -
editx/trunk/includes/Admin/Menu.php
r3478674 r3479600 33 33 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 34 34 if ( $pagenow === 'admin.php' && isset( $_GET['page'] ) && sanitize_text_field( wp_unslash( $_GET['page'] ) ) === 'editx' ) { 35 //Save admin menus 35 //Save admin menus (original, before any editor modifications) 36 36 $this->save_admin_menus(); 37 37 38 38 //Save admin columns 39 39 $this->save_admin_columns(); 40 } 41 42 // Apply admin menu editor if addon is active 43 if ( editx()->is_active_addon( 'admin_menu_editor' ) ) { 44 $this->admin_menu_editor(); 40 45 } 41 46 … … 100 105 101 106 /** 107 * Extract a clean menu label from the raw WordPress menu label string. 108 * 109 * WordPress appends notification bubbles as HTML spans to some labels, e.g.: 110 * "Comments <span class="awaiting-mod"><span class="pending-count">5</span>..." 111 * Stripping all tags naively concatenates the inner span text, producing 112 * "Comments 5 Comments in moderation". Instead, we strip everything from the 113 * first <span onwards so only the plain label text remains. 114 * 115 * @since 0.1.0 116 * 117 * @param string $raw_label Raw label HTML from $menu or $submenu. 118 * @return string Clean, plain-text label. 119 */ 120 protected function clean_menu_label( $raw_label ) { 121 // Guard against null labels (e.g. separator menu items). 122 $raw_label = (string) $raw_label; 123 124 // Strip from the first <span (notification bubbles) onwards. 125 $before_span = preg_replace( '/<span[\s\S]*$/i', '', $raw_label ); 126 $clean = trim( wp_strip_all_tags( (string) $before_span ) ); 127 128 // Fallback: if nothing was left, strip all tags and remove stray digits. 129 if ( '' === $clean ) { 130 $clean = trim( preg_replace( '/\d+/', '', wp_strip_all_tags( $raw_label ) ) ); 131 } 132 133 return $clean; 134 } 135 136 /** 102 137 * Save admin menus to option 103 138 * … … 123 158 $modify_menu_item = []; 124 159 125 $clean_label = preg_replace( '/\d+/', '', wp_strip_all_tags( $menu_item[0] ) ); 126 $modify_menu_item['label'] = $clean_label; 160 $modify_menu_item['label'] = $this->clean_menu_label( $menu_item[0] ); 127 161 $modify_menu_item['capability'] = $menu_item[1]; 128 162 $modify_menu_item['url'] = $menu_item[2]; … … 145 179 foreach ( $submenu[ $menu_item[2] ] as $sub_item ) { 146 180 $modify_sub_item = []; 147 $clean_label = preg_replace( '/\d+/', '', wp_strip_all_tags( $sub_item[0] ) ); 148 $modify_sub_item['label'] = $clean_label; 181 $modify_sub_item['label'] = $this->clean_menu_label( $sub_item[0] ); 149 182 $modify_sub_item['capability'] = $sub_item[1]; 150 183 $modify_sub_item['url'] = $sub_item[2]; … … 201 234 $custom_menu = get_option( 'editx_admin_menu_editor', [] ); 202 235 236 // Only apply if custom menu has been saved; avoid wiping menus on fresh install 237 if ( empty( $custom_menu ) ) { 238 return; 239 } 240 241 // Index original menus by their URL/slug (index 2) before clearing 242 $original_menu_by_url = []; 243 foreach ( $menu as $item ) { 244 $url = $item[2] ?? ''; 245 if ( $url ) { 246 $original_menu_by_url[ $url ] = $item; 247 } 248 } 249 250 // Index original submenus by parent slug, then by sub-item URL 251 $original_submenu_by_url = []; 252 foreach ( $submenu as $parent => $sub_items ) { 253 foreach ( $sub_items as $sub_item ) { 254 $sub_url = $sub_item[2] ?? ''; 255 $original_submenu_by_url[ $parent ][ $sub_url ] = $sub_item; 256 } 257 } 258 259 // Save the EditX menu entry to restore after rebuild 260 $editx_menu_entry = $original_menu_by_url[ EDITX_SLUG ] ?? null; 261 $editx_submenu_entries = $submenu[ EDITX_SLUG ] ?? []; 262 203 263 // Remove all existing menus 204 264 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited … … 207 267 $submenu = []; 208 268 209 // Add custom menus 269 // Rebuild menus using original entries in the custom order 270 $position = 1; 210 271 foreach ( $custom_menu as $menu_item ) { 211 if ( isset( $menu_item['classes'] ) && $menu_item['classes'] === 'wp-menu-separator' ) { 212 // Add separator 272 // Skip hidden top-level menu items 273 if ( ! empty( $menu_item['hidden'] ) ) { 274 continue; 275 } 276 277 $is_separator = ( 278 ( isset( $menu_item['classes'] ) && false !== strpos( $menu_item['classes'], 'wp-menu-separator' ) ) || 279 ( isset( $menu_item['url'] ) && 0 === strpos( (string) $menu_item['url'], 'separator' ) ) 280 ); 281 282 if ( $is_separator ) { 283 // Restore separator 213 284 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 214 $menu[ ] = [ '', 'read', $menu_item['url'], '', 'wp-menu-separator' ];285 $menu[ $position ] = [ '', 'read', 'separator' . $position, '', 'wp-menu-separator' ]; 215 286 } else { 216 // Add menu page 217 add_menu_page( 218 $menu_item['label'], 219 $menu_item['label'], 220 $menu_item['capability'], 221 $menu_item['url'], 222 '', 223 $menu_item['icon'], 224 null 225 ); 226 227 // Add submenu items if any 228 if ( isset( $menu_item['submenu'] ) && is_array( $menu_item['submenu'] ) ) { 229 foreach ( $menu_item['submenu'] as $submenu_item ) { 230 add_submenu_page( 231 $menu_item['url'], 232 $submenu_item['label'], 233 $submenu_item['label'], 234 $submenu_item['capability'], 235 $submenu_item['url'], 236 '' 237 ); 287 $url = (string) ( $menu_item['url'] ?? '' ); 288 if ( isset( $original_menu_by_url[ $url ] ) ) { 289 // Restore original menu entry at new position (preserves URL, callbacks, hooks) 290 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 291 $menu[ $position ] = $original_menu_by_url[ $url ]; 292 293 // Apply custom label if set 294 if ( ! empty( $menu_item['label'] ) ) { 295 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 296 $menu[ $position ][0] = $menu_item['label']; 297 } 298 299 // Apply custom icon if set 300 if ( ! empty( $menu_item['icon'] ) ) { 301 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 302 $menu[ $position ][6] = $menu_item['icon']; 303 } 304 305 // Rebuild submenu in custom order if specified, skipping hidden subitems 306 if ( isset( $menu_item['submenu'] ) && is_array( $menu_item['submenu'] ) && isset( $original_submenu_by_url[ $url ] ) ) { 307 foreach ( $menu_item['submenu'] as $sub_item ) { 308 if ( ! empty( $sub_item['hidden'] ) ) { 309 continue; // Skip hidden subitems 310 } 311 $sub_url = (string) ( $sub_item['url'] ?? '' ); 312 if ( isset( $original_submenu_by_url[ $url ][ $sub_url ] ) ) { 313 $restored_sub = $original_submenu_by_url[ $url ][ $sub_url ]; 314 // Apply custom submenu label if set 315 if ( ! empty( $sub_item['label'] ) ) { 316 $restored_sub[0] = $sub_item['label']; 317 } 318 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 319 $submenu[ $url ][] = $restored_sub; 320 } 321 } 322 } elseif ( isset( $original_submenu_by_url[ $url ] ) ) { 323 // No custom submenu order — keep original 324 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 325 $submenu[ $url ] = array_values( $original_submenu_by_url[ $url ] ); 238 326 } 239 327 } 240 328 } 329 $position += 2; 330 } 331 332 // Always restore the EditX menu so the plugin remains accessible in the sidebar 333 if ( $editx_menu_entry ) { 334 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 335 $menu[ $position ] = $editx_menu_entry; 336 if ( ! empty( $editx_submenu_entries ) ) { 337 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited 338 $submenu[ EDITX_SLUG ] = $editx_submenu_entries; 339 } 241 340 } 242 341 } … … 254 353 $user_roles = $current_user->roles; // Get the roles of the current user 255 354 256 $current_user_role = $user_roles[0];355 // User-specific restriction takes highest priority 257 356 $current_user_admin_menu = get_user_meta( $current_user->ID, '_editx_admin_menu', true ); 258 $current_role_admin_menu = get_option( 'editx_admin_menu_role_' . $current_user_role );259 357 if ( $current_user_admin_menu ) { 260 358 $this->check_restrict_menu( $current_user_admin_menu ); 261 } elseif ( $current_role_admin_menu ) { 262 $this->check_restrict_menu( $current_role_admin_menu ); 359 return; 360 } 361 362 // Fall back to role-based restriction; check all roles, use first match 363 foreach ( $user_roles as $role ) { 364 $current_role_admin_menu = get_option( 'editx_admin_menu_role_' . $role ); 365 if ( $current_role_admin_menu ) { 366 $this->check_restrict_menu( $current_role_admin_menu ); 367 return; 368 } 263 369 } 264 370 } … … 276 382 foreach ( $admin_menu as $menu ) { 277 383 if ( $menu['submenu'] ) { 278 foreach ( $menu['submenu'] as $submenu ) { 279 if ( array_key_exists( $menu['url'], $restrict_menu ) ) { 384 if ( ! array_key_exists( $menu['url'], $restrict_menu ) ) { 385 // Parent not allowed at all — remove parent once (not once per submenu) 386 $this->remove_admin_url_access( $menu['url'] ); 387 } else { 388 // Parent allowed — check each submenu item individually 389 foreach ( $menu['submenu'] as $submenu ) { 280 390 if ( ! in_array( $submenu['url'], $restrict_menu[ $menu['url'] ], true ) ) { 281 391 $this->remove_admin_url_access( $menu['url'], $submenu['url'] ); 282 392 } 283 } else {284 $this->remove_admin_url_access( $menu['url'] );285 393 } 286 394 } 287 395 } elseif ( ! array_key_exists( $menu['url'], $restrict_menu ) ) { 288 $this->remove_admin_url_access( $menu['url'] );396 $this->remove_admin_url_access( $menu['url'] ); 289 397 } 290 398 } … … 310 418 if ( $url_to_hide === $pagenow || $url_to_hide === $parent_file ) { 311 419 do_action( 'editx_admin_page_access_denied' ); 312 wp_die( esc_html__( 'Sorry, you are not allowed to access this page.', 'editx' ), 403);420 wp_die( esc_html__( 'Sorry, you are not allowed to access this page.', 'editx' ), '', [ 'response' => 403 ] ); 313 421 } 314 422 } -
editx/trunk/includes/Api/Types/AdminColumn.php
r3478674 r3479600 31 31 32 32 register_rest_route( 33 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9_ ]+)',33 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9_-]+)', 34 34 [ 35 35 'methods' => 'GET', … … 47 47 48 48 register_rest_route( 49 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9_ ]+)',49 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9_-]+)', 50 50 [ 51 51 'methods' => 'PUT', … … 63 63 64 64 register_rest_route( 65 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9 ,]+)',65 $this->namespace, '/' . $this->base . '/(?P<id>[a-z0-9_,-]+)', 66 66 [ 67 67 'methods' => 'DELETE', -
editx/trunk/includes/Api/Types/AdminMenu.php
r3478674 r3479600 46 46 'methods' => 'PUT', 47 47 'callback' => [ $this, 'update' ], 48 'permission_callback' => [ $this, 'permission' ], 49 ] 50 ); 51 52 register_rest_route( 53 $this->namespace, '/' . $this->base . '/reset', 54 [ 55 'methods' => 'DELETE', 56 'callback' => [ $this, 'delete' ], 48 57 'permission_callback' => [ $this, 'permission' ], 49 58 ] … … 97 106 98 107 /** 108 * Delete request — resets menu editor to default 109 * 110 * @since 0.1.0 111 * 112 * @return WP_REST_Response 113 */ 114 public function delete() { 115 delete_option( 'editx_admin_menu_editor' ); 116 return new \WP_REST_Response( 117 [ 118 'success' => true, 119 'data' => null, 120 ], 200 121 ); 122 } 123 124 /** 99 125 * Update request 100 126 * -
editx/trunk/includes/Assets/Manager.php
r3478674 r3479600 101 101 public function global_scripts(): array 102 102 { 103 $dependency = require_once EDITX_DIR . '/ assets/i18n-loader.asset.php';103 $dependency = require_once EDITX_DIR . '/build/i18n-loader.asset.php'; 104 104 105 105 return [ … … 122 122 public function get_scripts(): array 123 123 { 124 $dependency = require_once EDITX_DIR . '/ assets/index.asset.php';124 $dependency = require_once EDITX_DIR . '/build/index.asset.php'; 125 125 126 126 return [ -
editx/trunk/includes/Hooks/Types/Filter/Types/AdminColumn.php
r3478674 r3479600 72 72 73 73 foreach ( $get_columns as $value ) { 74 $custom_column[ $value['id'] ] = $value['label']; 74 if ( ! empty( $value['hidden'] ) ) { 75 continue; // Skip hidden columns 76 } 77 $custom_column[ (string) ( $value['id'] ?? '' ) ] = (string) ( $value['label'] ?? '' ); 75 78 } 76 79 -
editx/trunk/languages/editx.pot
r3478674 r3479600 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: EditX 0.1. 0\n"4 "Project-Id-Version: EditX 0.1.1\n" 5 5 "Report-Msgid-Bugs-To: https://github.com/softtent/editx/issues\n" 6 "Last-Translator: contact@ softtent.com\n"6 "Last-Translator: contact@nurency.com\n" 7 7 "Language-Team: LANGUAGE <LL@li.org>\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "POT-Creation-Date: 2026-03-10T 01:31:49+00:00\n"11 "POT-Creation-Date: 2026-03-10T13:11:36+00:00\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "X-Generator: WP-CLI 2.11.0\n" … … 16 16 #. Plugin Name of the plugin 17 17 #: editx.php 18 #: includes/Admin/Menu.php:6 019 #: includes/Admin/Menu.php:6 118 #: includes/Admin/Menu.php:65 19 #: includes/Admin/Menu.php:66 20 20 msgid "EditX" 21 21 msgstr "" … … 28 28 #. Description of the plugin 29 29 #: editx.php 30 msgid "A customizationplugin for WordPress"30 msgid "A admin menu editor, admin column editor, and admin access control plugin for WordPress" 31 31 msgstr "" 32 32 … … 45 45 msgstr "" 46 46 47 #: includes/Admin/Menu.php:7 447 #: includes/Admin/Menu.php:79 48 48 #: includes/Api/Types/Addon.php:78 49 #: build/index.js:1 49 50 msgid "Admin Menu Editor" 50 51 msgstr "" 51 52 52 #: includes/Admin/Menu.php: 7953 #: includes/Admin/Menu.php:84 53 54 #: includes/Api/Types/Addon.php:84 55 #: build/index.js:1 54 56 msgid "Admin Column Editor" 55 57 msgstr "" 56 58 57 #: includes/Admin/Menu.php:8 459 #: includes/Admin/Menu.php:89 58 60 msgid "Manage Restrictions" 59 61 msgstr "" 60 62 61 #: includes/Admin/Menu.php:88 63 #: includes/Admin/Menu.php:93 64 #: build/index.js:1 62 65 msgid "Addons" 63 66 msgstr "" 64 67 65 #: includes/Admin/Menu.php: 31268 #: includes/Admin/Menu.php:420 66 69 msgid "Sorry, you are not allowed to access this page." 67 70 msgstr "" … … 80 83 81 84 #: includes/Api/Types/Addon.php:90 85 #: build/index.js:1 82 86 msgid "Restriction" 83 87 msgstr "" … … 106 110 #: includes/Api/Types/Restriction.php:152 107 111 #: includes/Api/Types/Restriction.php:401 112 #: build/index.js:1 108 113 msgid "Please Select User" 109 114 msgstr "" … … 111 116 #: includes/Api/Types/Restriction.php:157 112 117 #: includes/Api/Types/Restriction.php:406 118 #: build/index.js:1 113 119 msgid "Please Select Role" 114 120 msgstr "" … … 179 185 #: includes/Models/AdminColumn.php:54 180 186 #: includes/Models/AdminColumn.php:57 187 #: build/index.js:1 181 188 msgid "Users" 182 189 msgstr "" … … 185 192 msgid "Loading..." 186 193 msgstr "" 194 195 #: build/index.js:1 196 msgid "Reorder, rename, hide or add custom items to the WordPress admin sidebar menu." 197 msgstr "" 198 199 #: build/index.js:1 200 msgid "Customize, reorder and resize columns in WordPress list tables for any post type." 201 msgstr "" 202 203 #: build/index.js:1 204 msgid "Menu Restrictions" 205 msgstr "" 206 207 #: build/index.js:1 208 msgid "Control which admin menu items are visible to specific users or user roles." 209 msgstr "" 210 211 #: build/index.js:1 212 msgid "Enable or disable EditX feature modules to match your workflow needs." 213 msgstr "" 214 215 #: build/index.js:1 216 msgid "Edit" 217 msgstr "" 218 219 #: build/index.js:1 220 msgid "Unhide" 221 msgstr "" 222 223 #: build/index.js:1 224 msgid "Hide" 225 msgstr "" 226 227 #: build/index.js:1 228 msgid "Add New Submenu" 229 msgstr "" 230 231 #: build/index.js:1 232 msgid "separator" 233 msgstr "" 234 235 #: build/index.js:1 236 msgid "hidden" 237 msgstr "" 238 239 #: build/index.js:1 240 msgid "Add New Menu" 241 msgstr "" 242 243 #: build/index.js:1 244 msgid "Edit Menu" 245 msgstr "" 246 247 #: build/index.js:1 248 msgid "Save" 249 msgstr "" 250 251 #: build/index.js:1 252 msgid "Apply" 253 msgstr "" 254 255 #: build/index.js:1 256 msgid "Select" 257 msgstr "" 258 259 #: build/index.js:1 260 msgid "Add New Column" 261 msgstr "" 262 263 #: build/index.js:1 264 msgid "Edit Column" 265 msgstr "" 266 267 #: build/index.js:1 268 msgid "Successfully Updated" 269 msgstr "" 270 271 #: build/index.js:1 272 msgid "Columns reset to default" 273 msgstr "" 274 275 #: build/index.js:1 276 msgid "Save Changes" 277 msgstr "" 278 279 #: build/index.js:1 280 msgid "Reset to Default" 281 msgstr "" 282 283 #: build/index.js:1 284 msgid "Screen" 285 msgstr "" 286 287 #: build/index.js:1 288 msgid "View" 289 msgstr "" 290 291 #: build/index.js:1 292 msgid "ID" 293 msgstr "" 294 295 #: build/index.js:1 296 msgid "Name" 297 msgstr "" 298 299 #: build/index.js:1 300 msgid "Email" 301 msgstr "" 302 303 #: build/index.js:1 304 msgid "Label" 305 msgstr "" 306 307 #: build/index.js:1 308 msgid "Actions" 309 msgstr "" 310 311 #: build/index.js:1 312 msgid "Delete" 313 msgstr "" 314 315 #: build/index.js:1 316 msgid "Successfully Added" 317 msgstr "" 318 319 #: build/index.js:1 320 msgid "Restrict" 321 msgstr "" 322 323 #: build/index.js:1 324 msgid "User" 325 msgstr "" 326 327 #: build/index.js:1 328 msgid "Role" 329 msgstr "" 330 331 #: build/index.js:1 332 msgid "Please Select Menu" 333 msgstr "" 334 335 #: build/index.js:1 336 msgid "Updating…" 337 msgstr "" 338 339 #: build/index.js:1 340 msgid "Submitting…" 341 msgstr "" 342 343 #: build/index.js:1 344 msgid "Update" 345 msgstr "" 346 347 #: build/index.js:1 348 msgid "Submit" 349 msgstr "" 350 351 #: build/index.js:1 352 msgid "Back to" 353 msgstr "" 354 355 #: build/index.js:1 356 msgid "Roles" 357 msgstr "" 358 359 #: build/index.js:1 360 msgid "Menu Access" 361 msgstr "" 362 363 #: build/index.js:1 364 msgid "Select the menu items you want to allow for this" 365 msgstr "" 366 367 #: build/index.js:1 368 msgid "user" 369 msgstr "" 370 371 #: build/index.js:1 372 msgid "role" 373 msgstr "" 374 375 #: build/index.js:1 376 msgid "Active" 377 msgstr "" 378 379 #: build/index.js:1 380 msgid "Inactive" 381 msgstr "" 382 383 #: build/index.js:1 384 msgid "Page Not Found" 385 msgstr "" 386 387 #: build/index.js:1 388 msgid "The page you are looking for does not exist." 389 msgstr "" 390 391 #: build/index.js:1 392 msgid "Customize your WordPress admin experience — edit menus, columns and restrict access." 393 msgstr "" 394 395 #: build/index.js:1 396 msgid "Menus reset to default" 397 msgstr "" 398 399 #: build/index.js:1 400 msgid "Submenu Name" 401 msgstr "" 402 403 #: build/index.js:1 404 msgid "Menu Name" 405 msgstr "" 406 407 #: build/index.js:1 408 msgid "No restrictions yet" 409 msgstr "" 410 411 #: build/index.js:1 412 msgid "No restrictions set for any" 413 msgstr "" 414 415 #: build/index.js:1 416 msgid "yet." 417 msgstr "" 418 419 #: build/index.js:1 420 msgid "Restrict a" 421 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.