Changeset 3783089
- Timestamp:
- 11/04/2026 04:43:15 AM (112 minutes ago)
- Location:
- easy-hide-admin-menu-items
- Files:
-
- 27 added
- 8 deleted
- 34 edited
- 1 copied
-
assets/screenshot-1.gif (deleted)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.gif (deleted)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (modified) ( previous)
-
assets/screenshot-4.png (modified) ( previous)
-
assets/screenshot-5.png (added)
-
assets/screenshot-6.png (added)
-
assets/screenshot-7.png (added)
-
tags/1.4.0 (copied) (copied from easy-hide-admin-menu-items/trunk )
-
tags/1.4.0/README.md (deleted)
-
tags/1.4.0/assets/css/style.css (modified) (13 diffs)
-
tags/1.4.0/assets/js/ehami.js (added)
-
tags/1.4.0/assets/js/settings-page.js (deleted)
-
tags/1.4.0/assets/js/user-interface.js (deleted)
-
tags/1.4.0/assets/js/vendor (added)
-
tags/1.4.0/assets/js/vendor/Sortable.LICENSE (added)
-
tags/1.4.0/assets/js/vendor/Sortable.min.js (added)
-
tags/1.4.0/assets/mp4 (added)
-
tags/1.4.0/assets/mp4/child-menu.mp4 (added)
-
tags/1.4.0/assets/mp4/menu-sorting.mp4 (added)
-
tags/1.4.0/assets/mp4/separators.mp4 (added)
-
tags/1.4.0/assets/mp4/sidebar-width.mp4 (added)
-
tags/1.4.0/autoload.php (modified) (1 diff)
-
tags/1.4.0/ehami.php (modified) (1 diff)
-
tags/1.4.0/languages/ehami-ru_RU.mo (modified) ( previous)
-
tags/1.4.0/languages/ehami-ru_RU.po (modified) (8 diffs)
-
tags/1.4.0/languages/ehami-sk_SK.mo (added)
-
tags/1.4.0/languages/ehami-sk_SK.po (added)
-
tags/1.4.0/languages/ehami.pot (modified) (7 diffs)
-
tags/1.4.0/readme.txt (modified) (3 diffs)
-
tags/1.4.0/src/Ajax.php (modified) (6 diffs)
-
tags/1.4.0/src/Assets.php (modified) (1 diff)
-
tags/1.4.0/src/Review.php (modified) (7 diffs)
-
tags/1.4.0/src/Settings.php (modified) (6 diffs)
-
tags/1.4.0/src/Settings_Page.php (modified) (1 diff)
-
tags/1.4.0/src/Switcher.php (modified) (2 diffs)
-
tags/1.4.0/src/Uninstall.php (modified) (1 diff)
-
tags/1.4.0/templates/admin-page-options.php (modified) (5 diffs)
-
tags/1.4.0/templates/switcher.php (modified) (1 diff)
-
trunk/README.md (deleted)
-
trunk/assets/css/style.css (modified) (13 diffs)
-
trunk/assets/js/ehami.js (added)
-
trunk/assets/js/settings-page.js (deleted)
-
trunk/assets/js/user-interface.js (deleted)
-
trunk/assets/js/vendor (added)
-
trunk/assets/js/vendor/Sortable.LICENSE (added)
-
trunk/assets/js/vendor/Sortable.min.js (added)
-
trunk/assets/mp4 (added)
-
trunk/assets/mp4/child-menu.mp4 (added)
-
trunk/assets/mp4/menu-sorting.mp4 (added)
-
trunk/assets/mp4/separators.mp4 (added)
-
trunk/assets/mp4/sidebar-width.mp4 (added)
-
trunk/autoload.php (modified) (1 diff)
-
trunk/ehami.php (modified) (1 diff)
-
trunk/languages/ehami-ru_RU.mo (modified) ( previous)
-
trunk/languages/ehami-ru_RU.po (modified) (8 diffs)
-
trunk/languages/ehami-sk_SK.mo (added)
-
trunk/languages/ehami-sk_SK.po (added)
-
trunk/languages/ehami.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/src/Ajax.php (modified) (6 diffs)
-
trunk/src/Assets.php (modified) (1 diff)
-
trunk/src/Review.php (modified) (7 diffs)
-
trunk/src/Settings.php (modified) (6 diffs)
-
trunk/src/Settings_Page.php (modified) (1 diff)
-
trunk/src/Switcher.php (modified) (2 diffs)
-
trunk/src/Uninstall.php (modified) (1 diff)
-
trunk/templates/admin-page-options.php (modified) (5 diffs)
-
trunk/templates/switcher.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easy-hide-admin-menu-items/tags/1.4.0/assets/css/style.css
r3474229 r3783089 72 72 73 73 #wp-admin-bar-ehami-switch .switch__content { 74 display: none;75 74 position: absolute; 76 75 right: 0; … … 86 85 overflow-x: hidden; 87 86 overflow-y: auto; 87 88 /* CSS-driven show/hide — replaces jQuery slideDown/slideUp. */ 89 visibility: hidden; 90 opacity: 0; 91 pointer-events: none; 92 transition: opacity 0.2s ease, visibility 0.2s ease; 93 } 94 95 #wp-admin-bar-ehami-switch .switch__content.--open { 96 visibility: visible; 97 opacity: 1; 98 pointer-events: auto; 88 99 } 89 100 /* Mozilla Firefox */ … … 167 178 #adminmenu .menu-top .ehami-remove-sub-li:hover { 168 179 transform: scale(1.2); 169 }170 171 .ui-effects-transfer {172 border: 2px dotted #72aee6;173 background: #72aee6;174 z-index: 9999;175 180 } 176 181 … … 234 239 } 235 240 241 /** 242 * Inline save notice — shown near Save button and in the header. 243 * No content jump: elements are always in the DOM, just hidden. 244 * 245 * @since 1.4.0 246 */ 247 248 .ehami-save-row { 249 display: flex; 250 align-items: center; 251 gap: 12px; 252 margin: 1em 0; 253 } 254 255 .ehami-save-row .submit { 256 margin: 0; 257 padding: 0; 258 } 259 260 .ehami-inline-notice { 261 display: inline-flex; 262 align-items: center; 263 gap: 4px; 264 font-size: 13px; 265 line-height: 1.4; 266 opacity: 0; 267 white-space: nowrap; 268 } 269 270 .ehami-inline-notice .dashicons { 271 font-size: 18px; 272 width: 18px; 273 height: 18px; 274 line-height: 18px; 275 } 276 277 .ehami-inline-notice.--success { 278 color: #00a32a; 279 } 280 281 .ehami-inline-notice.--error { 282 color: #d63638; 283 } 284 285 236 286 .ehami-settings-saving { 237 287 position: absolute; … … 290 340 } 291 341 292 .admin-color-light .ui-effects-transfer {293 border: 2px dotted #04a4cc;294 background: #04a4cc;295 }296 297 342 /** 298 343 * Styles themes color .admin-color-modern … … 338 383 } 339 384 340 .admin-color-modern .ui-effects-transfer {341 border: 2px dotted #33f078;342 background: #33f078;343 }344 345 385 /** 346 386 * Styles themes color .admin-color-blue … … 389 429 } 390 430 391 .admin-color-blue .ui-effects-transfer {392 border: 2px dotted #4796b3;393 background: #4796b3;394 }395 396 431 /** 397 432 * Styles themes color .admin-color-coffee … … 440 475 } 441 476 442 .admin-color-coffee .ui-effects-transfer {443 border: 2px dotted #59524c;444 background: #59524c;445 }446 447 477 /** 448 478 * Styles themes color .admin-color-ectoplasm … … 491 521 } 492 522 493 .admin-color-ectoplasm .ui-effects-transfer {494 border: 2px dotted #523f6d;495 background: #523f6d;496 }497 498 523 /** 499 524 * Styles themes color .admin-color-midnight … … 542 567 } 543 568 544 .admin-color-midnight .ui-effects-transfer {545 border: 2px dotted #363b3f;546 background: #363b3f;547 }548 549 569 /** 550 570 * Styles themes color .admin-color-ocean … … 593 613 } 594 614 595 .admin-color-ocean .ui-effects-transfer {596 border: 2px dotted #738e96;597 background: #738e96;598 }599 600 615 /** 601 616 * Styles themes color .admin-color-sunrise … … 643 658 border-left: 2px solid #f7e3d3; 644 659 background-color: #cf4944; 645 }646 647 .admin-color-sunrise .ui-effects-transfer {648 border: 2px dotted #cf4944;649 background: #cf4944;650 660 } 651 661 … … 677 687 color: #eee; 678 688 } 689 690 /** 691 * Experimental badge and separator row 692 */ 693 694 .ehami-settings__experimental-badge { 695 margin-top: 8px; 696 display: flex; 697 align-items: center; 698 gap: 10px; 699 } 700 701 .ehami-badge { 702 display: inline-block; 703 padding: 2px 8px; 704 border-radius: 3px; 705 font-size: 11px; 706 font-weight: 600; 707 line-height: 1.6; 708 text-transform: uppercase; 709 } 710 711 .ehami-badge--experimental { 712 background: #fcf0c3; 713 color: #6e4e00; 714 } 715 716 .ehami-settings__separator-row td { 717 padding: 0; 718 } 719 720 .ehami-settings__separator-row hr { 721 margin: 0; 722 border: none; 723 border-top: 1px solid #ccc; 724 } 725 726 .ehami-settings__reset-order { 727 margin-top: 6px; 728 } 729 730 .ehami-reset-link { 731 color: #b32d2e; 732 text-decoration: none; 733 } 734 735 .ehami-reset-link:hover { 736 color: #a00; 737 } 738 739 .ehami-reset-link .dashicons { 740 font-size: 16px; 741 width: 16px; 742 height: 16px; 743 vertical-align: text-bottom; 744 margin-right: 2px; 745 } 746 747 /** 748 * Menu sorting — SortableJS + drag handle. 749 * Handle icon appears on hover (right side), same animation as hide icon (left side). 750 * 751 * @since 1.4.0 752 */ 753 754 /* Drag handle — hidden by default, slides in from right on hover. 755 Matches WP .wp-menu-image dimensions: 36x34px. */ 756 #adminmenu .menu-top .ehami-sort-handle { 757 position: absolute; 758 top: 0; 759 right: -36px; 760 width: 36px; 761 height: 34px; 762 line-height: 34px; 763 text-align: center; 764 padding: 0; 765 color: #a7aaad; 766 z-index: 9999; 767 background-color: #2c3338; 768 cursor: grab; 769 font-size: 20px; 770 transition: right 0.5s cubic-bezier(0.8, -0.2, 0.55, 1.3) 1s, 771 opacity 0.3s linear 1s; 772 opacity: 0; 773 } 774 775 #adminmenu .menu-top:hover .ehami-sort-handle { 776 right: 0; 777 opacity: 1; 778 } 779 780 #adminmenu .menu-top .ehami-sort-handle:hover { 781 color: #72aee6; 782 } 783 784 /* Separator as drag handle — hover highlight + grab cursor. */ 785 #adminmenu li.wp-menu-separator.ehami-sort-handle { 786 cursor: grab; 787 transition: background 0.2s ease; 788 } 789 790 #adminmenu li.wp-menu-separator.ehami-sort-handle:hover { 791 background: rgba(114, 174, 230, 0.2); 792 } 793 794 #adminmenu li.wp-menu-separator.ehami-sort-handle:hover .separator { 795 background: #72aee6; 796 height: 2px; 797 } 798 799 /** 800 * Folded sidebar + mobile: reposition hide icon and sort handle 801 * as a vertical dropdown below the menu item (36 x 34 px each). 802 * 803 * @since 1.4.0 804 */ 805 806 /* Shared dropdown styles for both folded and mobile contexts. 807 Applied via .folded prefix and duplicated inside @media (max-width: 782px) 808 because mobile WP admin does not always add the .folded class. */ 809 .folded #adminmenu .menu-top .ehami-remove-li, 810 .folded #adminmenu .menu-top .ehami-sort-handle { 811 position: absolute; 812 left: 0; 813 right: auto; 814 width: 36px; 815 height: 34px; 816 padding: 0; 817 z-index: 10003; 818 background-color: #2c3338; 819 box-shadow: inset 4px 0 0 0 #2271b1; 820 opacity: 0; 821 pointer-events: none; 822 transition: opacity 0.18s ease; 823 font-size: 16px; 824 } 825 826 .folded #adminmenu .menu-top .ehami-remove-li { 827 top: 100%; 828 display: flex; 829 align-items: center; 830 justify-content: center; 831 transform: none; 832 } 833 834 .folded #adminmenu .menu-top .ehami-sort-handle { 835 top: calc(100% + 34px); 836 line-height: 34px; 837 } 838 839 .folded #adminmenu .menu-top:hover .ehami-remove-li, 840 .folded #adminmenu .menu-top:hover .ehami-sort-handle, 841 .folded #adminmenu .menu-top.opensub .ehami-remove-li, 842 .folded #adminmenu .menu-top.opensub .ehami-sort-handle { 843 opacity: 1; 844 pointer-events: auto; 845 } 846 847 .folded #adminmenu .menu-top .ehami-remove-li:hover { 848 background-color: #3c4349; 849 transform: none; 850 } 851 852 .folded #adminmenu .menu-top .ehami-sort-handle:hover { 853 background-color: #3c4349; 854 color: #72aee6; 855 } 856 857 /* Mobile (< 782 px): identical dropdown layout. */ 858 @media (max-width: 782px) { 859 #adminmenu .menu-top .ehami-remove-li, 860 #adminmenu .menu-top .ehami-sort-handle { 861 position: absolute; 862 left: 0; 863 right: auto; 864 width: 36px; 865 height: 34px; 866 padding: 0; 867 z-index: 10003; 868 background-color: #2c3338; 869 box-shadow: inset 4px 0 0 0 #2271b1; 870 opacity: 0; 871 pointer-events: none; 872 transition: opacity 0.18s ease; 873 font-size: 16px; 874 } 875 876 #adminmenu .menu-top .ehami-remove-li { 877 top: 100%; 878 display: flex; 879 align-items: center; 880 justify-content: center; 881 transform: none; 882 } 883 884 #adminmenu .menu-top .ehami-sort-handle { 885 top: calc(100% + 34px); 886 line-height: 34px; 887 } 888 889 #adminmenu .menu-top:hover .ehami-remove-li, 890 #adminmenu .menu-top:hover .ehami-sort-handle, 891 #adminmenu .menu-top.opensub .ehami-remove-li, 892 #adminmenu .menu-top.opensub .ehami-sort-handle { 893 opacity: 1; 894 pointer-events: auto; 895 } 896 897 #adminmenu .menu-top .ehami-remove-li:hover { 898 background-color: #3c4349; 899 transform: none; 900 } 901 902 #adminmenu .menu-top .ehami-sort-handle:hover { 903 background-color: #3c4349; 904 color: #72aee6; 905 } 906 } 907 908 /* Ghost: placeholder left in place — shows where the item will land. */ 909 #adminmenu > li.menu-top.ehami-sortable-ghost { 910 background: rgba(114, 174, 230, 0.12) !important; 911 border: 2px dashed #72aee6; 912 border-radius: 3px; 913 height: 36px !important; 914 min-height: 0 !important; 915 overflow: hidden; 916 } 917 918 #adminmenu > li.wp-menu-separator.ehami-sortable-ghost { 919 background: rgba(114, 174, 230, 0.25) !important; 920 border: 1px dashed #72aee6; 921 border-radius: 2px; 922 height: 6px !important; 923 } 924 925 #adminmenu > li.ehami-sortable-ghost > * { 926 visibility: hidden; 927 } 928 929 #adminmenu > li.ehami-sortable-ghost .wp-submenu { 930 display: none !important; 931 } 932 933 /* Drag clone: the floating copy that follows the cursor. 934 Background comes from CSS variable set by JS on drag start — 935 automatically matches any admin color scheme. */ 936 li.ehami-sortable-drag { 937 background: var(--ehami-sidebar-bg, #1d2327) !important; 938 opacity: 0.95 !important; 939 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important; 940 border-radius: 3px; 941 } 942 943 li.ehami-sortable-drag .wp-submenu { 944 display: none !important; 945 } 946 947 /* Separator drag clone — visible bright line so user sees what they're dragging. */ 948 li.wp-menu-separator.ehami-sortable-drag { 949 background: transparent !important; 950 box-shadow: none !important; 951 height: auto !important; 952 padding: 4px 0 !important; 953 } 954 955 li.wp-menu-separator.ehami-sortable-drag .separator { 956 height: 3px !important; 957 background: #72aee6 !important; 958 border-radius: 2px; 959 margin: 0 8px; 960 } 961 962 li.ehami-sortable-drag .ehami-sort-handle, 963 li.ehami-sortable-drag .ehami-remove-li { 964 display: none !important; 965 } 966 967 /* When "Don't display hide icons" is checked — disable all sorting interactions. */ 968 .ehami-icons-hidden #adminmenu .menu-top .ehami-sort-handle { 969 display: none !important; 970 } 971 972 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle { 973 cursor: default; 974 pointer-events: none; 975 } 976 977 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle:hover { 978 background: transparent; 979 } 980 981 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle:hover .separator { 982 background: inherit; 983 height: inherit; 984 } 985 986 /* Prevent text selection while dragging. */ 987 .ehami-sorting-active { 988 user-select: none !important; 989 -webkit-user-select: none !important; 990 cursor: grabbing !important; 991 } 992 993 /* Admin color scheme support for drag handle. */ 994 .admin-color-light #adminmenu .menu-top .ehami-sort-handle { 995 background-color: #fff; 996 color: #999; 997 } 998 999 .admin-color-light #adminmenu .menu-top .ehami-sort-handle:hover { 1000 color: #04a4cc; 1001 } 1002 1003 .admin-color-modern #adminmenu .menu-top .ehami-sort-handle { 1004 background-color: #0c0c0c; 1005 color: #86888a; 1006 } 1007 1008 .admin-color-modern #adminmenu .menu-top .ehami-sort-handle:hover { 1009 color: #33f078; 1010 } 1011 1012 /* Admin color scheme overrides for folded dropdown icons. 1013 @since 1.4.0 */ 1014 .admin-color-light.folded #adminmenu .menu-top .ehami-remove-li, 1015 .admin-color-light.folded #adminmenu .menu-top .ehami-sort-handle { 1016 background-color: #f1f1f1; 1017 box-shadow: inset 4px 0 0 0 #888; 1018 } 1019 1020 .admin-color-modern.folded #adminmenu .menu-top .ehami-remove-li, 1021 .admin-color-modern.folded #adminmenu .menu-top .ehami-sort-handle { 1022 background-color: #1e1e1e; 1023 box-shadow: inset 4px 0 0 0 #3858e9; 1024 } 1025 1026 .admin-color-blue.folded #adminmenu .menu-top .ehami-remove-li, 1027 .admin-color-blue.folded #adminmenu .menu-top .ehami-sort-handle { 1028 background-color: #52accc; 1029 box-shadow: inset 4px 0 0 0 #e2ecf1; 1030 } 1031 1032 .admin-color-coffee.folded #adminmenu .menu-top .ehami-remove-li, 1033 .admin-color-coffee.folded #adminmenu .menu-top .ehami-sort-handle { 1034 background-color: #46403c; 1035 box-shadow: inset 4px 0 0 0 #c7a589; 1036 } 1037 1038 .admin-color-ectoplasm.folded #adminmenu .menu-top .ehami-remove-li, 1039 .admin-color-ectoplasm.folded #adminmenu .menu-top .ehami-sort-handle { 1040 background-color: #413256; 1041 box-shadow: inset 4px 0 0 0 #a3b745; 1042 } 1043 1044 .admin-color-midnight.folded #adminmenu .menu-top .ehami-remove-li, 1045 .admin-color-midnight.folded #adminmenu .menu-top .ehami-sort-handle { 1046 background-color: #26292c; 1047 box-shadow: inset 4px 0 0 0 #e14d43; 1048 } 1049 1050 .admin-color-ocean.folded #adminmenu .menu-top .ehami-remove-li, 1051 .admin-color-ocean.folded #adminmenu .menu-top .ehami-sort-handle { 1052 background-color: #627c83; 1053 box-shadow: inset 4px 0 0 0 #9ebaa0; 1054 } 1055 1056 .admin-color-sunrise.folded #adminmenu .menu-top .ehami-remove-li, 1057 .admin-color-sunrise.folded #adminmenu .menu-top .ehami-sort-handle { 1058 background-color: #be3631; 1059 box-shadow: inset 4px 0 0 0 #dd823b; 1060 } 1061 1062 /** 1063 * Sidebar resize — Notion/Outline-style drag handle. 1064 * 1065 * Invisible grab zone on the right edge of the sidebar. 1066 * On hover a thin vertical line appears at the boundary. 1067 * Drag left/right to resize. Release to save. 1068 * 1069 * @since 1.4.0 1070 */ 1071 1072 /* Grab zone — fixed to viewport, stretches from admin bar to bottom of screen. */ 1073 .ehami-resize-handle { 1074 position: fixed; 1075 top: 32px; 1076 bottom: 0; 1077 width: 2px; 1078 cursor: col-resize; 1079 z-index: 9999; 1080 } 1081 1082 /* Keep the WP menu arrow (triangle) above the resize handle. */ 1083 ul#adminmenu a.wp-has-current-submenu:after, 1084 ul#adminmenu > li.current > a.current:after { 1085 z-index: 10000; 1086 } 1087 1088 /* Vertical line — appears on hover/active. 1089 Color is set via --ehami-resize-color CSS variable by JS (matches admin color scheme). */ 1090 .ehami-resize-handle::after { 1091 content: ""; 1092 position: absolute; 1093 top: 0; 1094 left: 50%; 1095 transform: translateX(-50%); 1096 width: 4px; 1097 height: 100%; 1098 background: transparent; 1099 transition: background 0.15s ease; 1100 } 1101 1102 .ehami-resize-handle:hover::after, 1103 .ehami-resize-handle.ehami-resize-active::after { 1104 background: var(--ehami-resize-color, #2271b1); 1105 } 1106 1107 /* Prevent text selection and pointer events during resize. */ 1108 .ehami-resizing { 1109 user-select: none !important; 1110 -webkit-user-select: none !important; 1111 cursor: col-resize !important; 1112 } 1113 1114 .ehami-resizing iframe { 1115 pointer-events: none; 1116 } 1117 1118 /* Hide resize handle when menu is folded or on mobile. */ 1119 .folded .ehami-resize-handle { 1120 display: none; 1121 } 1122 1123 @media (max-width: 960px) { 1124 .auto-fold .ehami-resize-handle { 1125 display: none; 1126 } 1127 } 1128 1129 @media (max-width: 782px) { 1130 .ehami-resize-handle { 1131 display: none; 1132 } 1133 } 1134 1135 /** 1136 * Video tooltip — play icon next to settings labels. 1137 * On hover shows a small popup with auto-playing video. 1138 * 1139 * @since 1.5.0 1140 */ 1141 1142 .ehami-video-hint { 1143 display: inline-block; 1144 position: relative; 1145 vertical-align: middle; 1146 margin-left: 4px; 1147 cursor: pointer; 1148 } 1149 1150 .ehami-video-hint .dashicons { 1151 font-size: 16px; 1152 width: 16px; 1153 height: 16px; 1154 line-height: 16px; 1155 color: #a7aaad; 1156 transition: color 0.15s ease; 1157 } 1158 1159 .ehami-video-hint:hover .dashicons { 1160 color: #2271b1; 1161 } 1162 1163 /* Tooltip container — anchored to the icon, appears on hover. */ 1164 .ehami-video-tooltip { 1165 position: absolute; 1166 left: 50%; 1167 bottom: calc(100% + 8px); 1168 transform: translateX(-50%); 1169 width: 400px; 1170 background: #1d2327; 1171 border-radius: 6px; 1172 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); 1173 overflow: hidden; 1174 z-index: 100001; 1175 opacity: 0; 1176 visibility: hidden; 1177 transition: opacity 0.2s ease, visibility 0.2s ease; 1178 pointer-events: none; 1179 } 1180 1181 .ehami-video-hint:hover .ehami-video-tooltip { 1182 opacity: 1; 1183 visibility: visible; 1184 pointer-events: auto; 1185 } 1186 1187 /* Arrow pointing down from the tooltip. */ 1188 .ehami-video-tooltip::after { 1189 content: ""; 1190 position: absolute; 1191 left: 50%; 1192 bottom: -6px; 1193 transform: translateX(-50%); 1194 border-left: 6px solid transparent; 1195 border-right: 6px solid transparent; 1196 border-top: 6px solid #1d2327; 1197 } 1198 1199 /* Video element inside the tooltip. */ 1200 .ehami-video-tooltip video { 1201 display: block; 1202 width: 100%; 1203 height: auto; 1204 border-radius: 6px; 1205 } 1206 1207 /* Spinner — shown while video is loading. */ 1208 .ehami-video-tooltip .ehami-video-spinner { 1209 position: absolute; 1210 top: 50%; 1211 left: 50%; 1212 transform: translate(-50%, -50%); 1213 width: 24px; 1214 height: 24px; 1215 border: 3px solid rgba(255, 255, 255, 0.2); 1216 border-top-color: #fff; 1217 border-radius: 50%; 1218 animation: ehami-spin 0.6s linear infinite; 1219 } 1220 1221 .ehami-video-tooltip .ehami-video-spinner.--hidden { 1222 display: none; 1223 } 1224 1225 @keyframes ehami-spin { 1226 to { transform: translate(-50%, -50%) rotate(360deg); } 1227 } 1228 1229 /** 1230 * Fly-to-bar animation — menu item clone flies toward the admin bar toggle. 1231 * 1232 * @since 1.5.0 1233 */ 1234 1235 /* Transfer outline — visible dashed border that flies from sidebar to admin bar. */ 1236 .ehami-fly-clone { 1237 position: fixed; 1238 z-index: 100000; 1239 pointer-events: none; 1240 border: 2px dashed #72aee6; 1241 border-radius: 3px; 1242 background: rgba(114, 174, 230, 0.08); 1243 } 1244 1245 .ehami-fly-clone.--animating { 1246 transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1247 top 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1248 width 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1249 height 0.5s cubic-bezier(0.4, 0, 0.2, 1); 1250 } -
easy-hide-admin-menu-items/tags/1.4.0/autoload.php
r3474229 r3783089 7 7 8 8 spl_autoload_register( 9 static function ( $class ) {10 if ( strpos( $class , __NAMESPACE__ . '\\' ) !== 0 ) {9 static function ( $class_name ) { 10 if ( strpos( $class_name, __NAMESPACE__ . '\\' ) !== 0 ) { 11 11 return; 12 12 } 13 13 14 $path = str_replace( [ __NAMESPACE__, '\\' ], [ __DIR__ . '/src', '/' ], $class );14 $path = str_replace( [ __NAMESPACE__, '\\' ], [ __DIR__ . '/src', '/' ], $class_name ); 15 15 16 16 require_once "$path.php"; -
easy-hide-admin-menu-items/tags/1.4.0/ehami.php
r3474229 r3783089 6 6 * Domain Path: /languages 7 7 * Description: The plugin allows hiding selected admin menu items. 8 * Version: 1. 3.98 * Version: 1.4.0 9 9 * Author: Campusboy, Dan Zakirov, Tkama 10 10 * License: GPL-2.0+ -
easy-hide-admin-menu-items/tags/1.4.0/languages/ehami-ru_RU.po
r3474229 r3783089 1 # Translation of Plugins - Easy Hide Admin Menu Items - Stable (latest release) in Russian 2 # This file is distributed under the same license as the Plugins - Easy Hide Admin Menu Items - Stable (latest release) package. 3 msgid "" 4 msgstr "" 1 # Translation of Easy Hide Admin Menu Items in Russian 2 # This file is distributed under the same license as the Easy Hide Admin Menu Items package. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: Easy Hide Admin Menu Items 1.4.0\n" 5 6 "PO-Revision-Date: 2024-03-06 19:20:09+0000\n" 7 "Language: ru_RU\n" 6 8 "MIME-Version: 1.0\n" 7 9 "Content-Type: text/plain; charset=UTF-8\n" … … 9 11 "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2);\n" 10 12 "X-Generator: GlotPress/4.0.0-rc.1\n" 11 "Language: ru\n"12 "Project-Id-Version: Plugins - Easy Hide Admin Menu Items - Stable (latest release)\n"13 13 14 14 #: templates/switcher.php:36 … … 16 16 msgstr "Отключить иконки скрытия" 17 17 18 #: templates/admin-page-options.php: 12318 #: templates/admin-page-options.php:275 19 19 msgid "Leave a review" 20 20 msgstr "Оставить отзыв" 21 21 22 #: templates/admin-page-options.php:121 23 msgid "Please consider leaving a review for our plugin. Your reviews help us improve and serve you better." 24 msgstr "Пожалуйста, рассмотрите возможность оставить отзыв о нашем плагине. Ваша обратная связь мотивирует нас качественно улучшать сервис." 25 26 #: templates/admin-page-options.php:109 22 #: templates/admin-page-options.php:273 23 msgid "" 24 "Please consider leaving a review for our plugin. Your reviews help us " 25 "improve and serve you better." 26 msgstr "" 27 "Пожалуйста, рассмотрите возможность оставить отзыв о нашем плагине. Ваша " 28 "обратная связь мотивирует нас качественно улучшать сервис." 29 30 #: templates/admin-page-options.php:261 27 31 msgid "contact us here" 28 32 msgstr "обращаться к нам" 29 33 30 #: templates/admin-page-options.php:108 31 msgid "For support, please contact our helpdesk. If you encounter any issues or have any questions, feel free to" 32 msgstr "Для получения поддержки, пожалуйста, обратитесь на форум. Если у вас возникнут проблемы или вопросы, не стесняйтесь" 34 #: templates/admin-page-options.php:260 35 msgid "" 36 "For support, please contact our helpdesk. If you encounter any issues or " 37 "have any questions, feel free to" 38 msgstr "" 39 "Для получения поддержки, пожалуйста, обратитесь на форум. Если у вас " 40 "возникнут проблемы или вопросы, не стесняйтесь" 33 41 34 42 #: src/Review.php:190 … … 50 58 #. translators: %s is a placeholder for the plugin name 51 59 #: src/Review.php:161 52 msgid "We are very pleased that you are using the %s plugin within a few days." 60 #, php-format 61 msgid "" 62 "We are very pleased that you are using the %s plugin within a few days." 53 63 msgstr "Мы очень рады, что вы используете плагин %s уже несколько дней." 54 64 … … 57 67 msgstr "Здравствуйте!" 58 68 59 #. Author of the plugin 60 #: ehami.php 69 #. Author of the plugin/theme 61 70 msgid "Campusboy, Dan Zakirov, Tkama" 62 71 msgstr "Campusboy, Dan Zakirov, Tkama" … … 70 79 msgstr "Скрыть или показать скрытые пункты меню" 71 80 72 #: templates/admin-page-options.php:98 73 msgid "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments are highly valuable to us and will assist us in improving the plugin further." 74 msgstr "Благодарим вас за использование плагина Easy Hide Admin Menu Items! Ваши отзывы и комментарии имеют для нас большую ценность и помогут нам дальше улучшать плагин." 75 76 #: templates/admin-page-options.php:94 81 #: templates/admin-page-options.php:250 82 msgid "" 83 "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments " 84 "are highly valuable to us and will assist us in improving the plugin " 85 "further." 86 msgstr "" 87 "Благодарим вас за использование плагина Easy Hide Admin Menu Items! Ваши " 88 "отзывы и комментарии имеют для нас большую ценность и помогут нам дальше " 89 "улучшать плагин." 90 91 #: templates/admin-page-options.php:246 77 92 msgid "Message From the Author" 78 93 msgstr "Сообщение от авторов" 79 94 80 #: templates/admin-page-options.php: 8495 #: templates/admin-page-options.php:234 81 96 msgid "Save Settings" 82 97 msgstr "Сохранить настройки" 83 98 84 #: templates/admin-page-options.php: 4499 #: templates/admin-page-options.php:52 85 100 msgid "Main Settings" 86 101 msgstr "Основные настройки" 87 102 88 #: templates/admin-page-options.php: 35103 #: templates/admin-page-options.php:43 89 104 msgid "Easy Hide Admin Menu Items Settings" 90 105 msgstr "Настройки Easy Hide Admin Menu Items" 91 106 107 #: templates/admin-page-options.php:29 108 msgid "" 109 "If checked, all data (option and user metadata) will be deleted when the " 110 "plugin is deleted." 111 msgstr "" 112 "Если отмечено, то все данные (опции и метаданные пользователей) будут " 113 "удалены из базы данных при удалении плагина." 114 92 115 #: templates/admin-page-options.php:28 93 msgid "If checked, all data (option and user metadata) will be deleted when the plugin is deleted."94 msgstr "Если отмечено, то все данные (опции и метаданные пользователей) будут удалены из базы данных при удалении плагина."95 96 #: templates/admin-page-options.php:2797 116 msgid "Allow the deletion of all plugin data after it is deleted" 98 117 msgstr "Разрешить удаление всех данных после удаления плагина" 99 118 100 #: templates/admin-page-options.php:2 3119 #: templates/admin-page-options.php:24 101 120 msgid "Uninstall plugin" 102 121 msgstr "Удаление плагина" 103 122 104 123 #: templates/admin-page-options.php:20 105 msgid "If checked, you can hide the child menu. This may be useful when there are too many child menus causing distraction." 106 msgstr "Если отмечено, вы можете скрывать дочерние меню. Это может быть полезно, когда слишком много дочерних меню которыми вы не пользуетесь." 124 msgid "" 125 "If checked, you can hide the child menu. This may be useful when there are " 126 "too many child menus causing distraction." 127 msgstr "" 128 "Если отмечено, вы можете скрывать дочерние меню. Это может быть полезно, " 129 "когда слишком много дочерних меню которыми вы не пользуетесь." 107 130 108 131 #: templates/admin-page-options.php:19 … … 115 138 116 139 #: templates/admin-page-options.php:12 117 msgid "If checked, each user with access to the admin panel can save hidden menu settings individually for their own preferences." 118 msgstr "Если отмечено, каждый пользователь с доступом к административной панели может сохранить скрытые настройки меню индивидуально для своих предпочтений." 140 msgid "" 141 "If checked, each user with access to the admin panel can save hidden menu " 142 "settings individually for their own preferences." 143 msgstr "" 144 "Если отмечено, каждый пользователь с доступом к административной панели " 145 "может сохранить скрытые настройки меню индивидуально для своих предпочтений." 119 146 120 147 #: templates/admin-page-options.php:11 121 148 msgid "Allow other users to set their own preferences." 122 msgstr "Разрешить другим пользователям настраивать меню для себя на своё усмотрение." 149 msgstr "" 150 "Разрешить другим пользователям настраивать меню для себя на своё усмотрение." 123 151 124 152 #: templates/admin-page-options.php:7 … … 134 162 msgstr "Настройки меню администратора" 135 163 136 #: src/Assets.php:3 8164 #: src/Assets.php:35 137 165 msgid "Hide menu" 138 166 msgstr "Скрыть меню" 139 167 140 #: src/Assets.php:3 7templates/switcher.php:26168 #: src/Assets.php:34 templates/switcher.php:26 141 169 msgid "No hidden menu items" 142 170 msgstr "Скрытые меню отсутствуют" 143 171 144 #: src/Ajax.php:23 src/Ajax.php:40 src/Ajax.php:59 src/Ajax.php:79 145 #: src/Ajax.php:98 172 #: src/Ajax.php:27 src/Ajax.php:44 src/Ajax.php:71 src/Ajax.php:91 173 #: src/Ajax.php:110 src/Ajax.php:132 src/Ajax.php:162 src/Ajax.php:184 174 #: src/Ajax.php:208 146 175 msgid "Sorry, you are not allowed to manage options for this site." 147 176 msgstr "Извините, у вас нет прав на управление опциями для этого сайта." 148 177 149 #. Description of the plugin 150 #: ehami.php 178 #. Description of the plugin/theme 151 179 msgid "The plugin allows hiding selected admin menu items." 152 180 msgstr "Плагин позволяет скрывать выбранные пункты меню администратора." 153 181 154 #. Plugin URI of the plugin 155 #: ehami.php 182 #. Plugin URI of the plugin/theme 156 183 msgid "https://github.com/campusboy87/easy-hide-admin-menu-items" 157 184 msgstr "https://github.com/campusboy87/easy-hide-admin-menu-items" 158 185 159 #. Plugin Name of the plugin 160 #: ehami.php 186 #. Plugin Name of the plugin/theme 161 187 msgid "Easy Hide Admin Menu Items" 162 188 msgstr "Easy Hide Admin Menu Items" 189 190 #: src/Assets.php:38 191 msgid "Settings saved." 192 msgstr "Настройки сохранены." 193 194 #: src/Assets.php:39 195 msgid "Error saving settings." 196 msgstr "Не удалось сохранить настройки." 197 198 #: templates/admin-page-options.php:35 199 msgid "No changes (default)" 200 msgstr "Без изменений (по умолчанию)" 201 202 #: templates/admin-page-options.php:36 203 msgid "Hide all separators" 204 msgstr "Скрыть все разделители" 205 206 #: templates/admin-page-options.php:37 207 msgid "Highlight separators" 208 msgstr "Выделить разделители" 209 210 #: templates/admin-page-options.php:102 templates/admin-page-options.php:108 211 msgid "Menu Sorting" 212 msgstr "Сортировка меню" 213 214 #: templates/admin-page-options.php:119 215 msgid "Enable drag-and-drop menu reordering" 216 msgstr "Разрешить изменение порядка пунктов меню перетаскиванием" 217 218 #: templates/admin-page-options.php:128 219 msgid "Drag the handle icon on the right side of menu items to reorder them." 220 msgstr "" 221 "Чтобы изменить порядок пунктов меню, перетащите значок справа от пункта." 222 223 #: templates/admin-page-options.php:131 224 msgid "Note:" 225 msgstr "Примечание:" 226 227 #: templates/admin-page-options.php:132 228 msgid "" 229 "your custom order is preserved even when this option is disabled. Use " 230 "\"Reset menu order\" to restore the default order." 231 msgstr "" 232 "заданный порядок сохраняется даже при отключении этой настройки. Чтобы " 233 "восстановить порядок по умолчанию, нажмите «Сбросить порядок меню»." 234 235 #: templates/admin-page-options.php:135 templates/admin-page-options.php:179 236 #: templates/admin-page-options.php:224 237 msgid "Experimental" 238 msgstr "Экспериментальная функция" 239 240 #: templates/admin-page-options.php:138 241 msgid "Reset menu order" 242 msgstr "Сбросить порядок меню" 243 244 #: templates/admin-page-options.php:150 templates/admin-page-options.php:156 245 msgid "Sidebar Width" 246 msgstr "Ширина боковой панели" 247 248 #: templates/admin-page-options.php:167 249 msgid "Enable sidebar width resize" 250 msgstr "Разрешить изменение ширины боковой панели" 251 252 #: templates/admin-page-options.php:176 253 msgid "Drag the right edge of the sidebar to adjust the menu width." 254 msgstr "Чтобы изменить ширину меню, перетащите правый край боковой панели." 255 256 #: templates/admin-page-options.php:182 257 msgid "Reset sidebar width" 258 msgstr "Сбросить ширину боковой панели" 259 260 #: templates/admin-page-options.php:194 templates/admin-page-options.php:200 261 msgid "Menu Separators" 262 msgstr "Разделители меню" 263 264 #: templates/admin-page-options.php:221 265 msgid "" 266 "Control the visibility of separator lines between menu groups in the admin " 267 "sidebar." 268 msgstr "" 269 "Управляйте отображением линий между группами пунктов меню в боковой панели " 270 "администратора." -
easy-hide-admin-menu-items/tags/1.4.0/languages/ehami.pot
r3474229 r3783089 1 # 1 2 #, fuzzy 2 3 msgid "" 3 4 msgstr "" 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 "Project-Id-Version: Easy Hide Admin Menu Items\n" 5 "Project-Id-Version: Easy Hide Admin Menu Items 1.4.0\n" 6 6 "POT-Creation-Date: 2024-03-07 07:45+0300\n" 7 7 "PO-Revision-Date: 2024-03-07 07:45+0300\n" … … 11 11 "Content-Type: text/plain; charset=UTF-8\n" 12 12 "Content-Transfer-Encoding: 8bit\n" 13 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 13 14 "X-Generator: Poedit 2.0.7\n" 14 15 "X-Poedit-Basepath: ..\n" 15 16 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 "X-Poedit-WPHeader: ehami.php\n" 17 "X-Poedit-SourceCharset: UTF-8\n" 18 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 19 "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 20 "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 17 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 21 18 "X-Poedit-SearchPath-0: .\n" 22 19 "X-Poedit-SearchPathExcluded-0: *.js\n" 23 24 #: src/Ajax.php:23 src/Ajax.php:40 src/Ajax.php:59 src/Ajax.php:79 25 #: src/Ajax.php:98 20 "X-Poedit-SourceCharset: UTF-8\n" 21 "X-Poedit-WPHeader: ehami.php\n" 22 23 #: src/Ajax.php:27 src/Ajax.php:44 src/Ajax.php:71 src/Ajax.php:91 24 #: src/Ajax.php:110 src/Ajax.php:132 src/Ajax.php:162 src/Ajax.php:184 25 #: src/Ajax.php:208 26 26 msgid "Sorry, you are not allowed to manage options for this site." 27 27 msgstr "" 28 28 29 #: src/Assets.php:3 7templates/switcher.php:2629 #: src/Assets.php:34 templates/switcher.php:26 30 30 msgid "No hidden menu items" 31 31 msgstr "" 32 32 33 #: src/Assets.php:35 34 msgid "Hide menu" 35 msgstr "" 36 33 37 #: src/Assets.php:38 34 msgid "Hide menu" 38 msgid "Settings saved." 39 msgstr "" 40 41 #: src/Assets.php:39 42 msgid "Error saving settings." 35 43 msgstr "" 36 44 … … 42 50 #: src/Review.php:161 43 51 #, php-format 44 msgid "We are very pleased that you are using the %s plugin within a few days." 52 msgid "" 53 "We are very pleased that you are using the %s plugin within a few days." 45 54 msgstr "" 46 55 … … 97 106 msgstr "" 98 107 99 #: templates/admin-page-options.php:2 3108 #: templates/admin-page-options.php:24 100 109 msgid "Uninstall plugin" 101 110 msgstr "" 102 111 103 #: templates/admin-page-options.php:2 7112 #: templates/admin-page-options.php:28 104 113 msgid "Allow the deletion of all plugin data after it is deleted" 105 114 msgstr "" 106 115 107 #: templates/admin-page-options.php:2 8116 #: templates/admin-page-options.php:29 108 117 msgid "" 109 118 "If checked, all data (option and user metadata) will be deleted when the " … … 112 121 113 122 #: templates/admin-page-options.php:35 123 msgid "No changes (default)" 124 msgstr "" 125 126 #: templates/admin-page-options.php:36 127 msgid "Hide all separators" 128 msgstr "" 129 130 #: templates/admin-page-options.php:37 131 msgid "Highlight separators" 132 msgstr "" 133 134 #: templates/admin-page-options.php:43 114 135 msgid "Easy Hide Admin Menu Items Settings" 115 136 msgstr "" 116 137 117 #: templates/admin-page-options.php: 44138 #: templates/admin-page-options.php:52 118 139 msgid "Main Settings" 119 140 msgstr "" 120 141 121 #: templates/admin-page-options.php:84 142 #: templates/admin-page-options.php:102 templates/admin-page-options.php:108 143 msgid "Menu Sorting" 144 msgstr "" 145 146 #: templates/admin-page-options.php:119 147 msgid "Enable drag-and-drop menu reordering" 148 msgstr "" 149 150 #: templates/admin-page-options.php:128 151 msgid "Drag the handle icon on the right side of menu items to reorder them." 152 msgstr "" 153 154 #: templates/admin-page-options.php:131 155 msgid "Note:" 156 msgstr "" 157 158 #: templates/admin-page-options.php:132 159 msgid "" 160 "your custom order is preserved even when this option is disabled. Use " 161 "\"Reset menu order\" to restore the default order." 162 msgstr "" 163 164 #: templates/admin-page-options.php:135 templates/admin-page-options.php:179 165 #: templates/admin-page-options.php:224 166 msgid "Experimental" 167 msgstr "" 168 169 #: templates/admin-page-options.php:138 170 msgid "Reset menu order" 171 msgstr "" 172 173 #: templates/admin-page-options.php:150 templates/admin-page-options.php:156 174 msgid "Sidebar Width" 175 msgstr "" 176 177 #: templates/admin-page-options.php:167 178 msgid "Enable sidebar width resize" 179 msgstr "" 180 181 #: templates/admin-page-options.php:176 182 msgid "Drag the right edge of the sidebar to adjust the menu width." 183 msgstr "" 184 185 #: templates/admin-page-options.php:182 186 msgid "Reset sidebar width" 187 msgstr "" 188 189 #: templates/admin-page-options.php:194 templates/admin-page-options.php:200 190 msgid "Menu Separators" 191 msgstr "" 192 193 #: templates/admin-page-options.php:221 194 msgid "" 195 "Control the visibility of separator lines between menu groups in the admin " 196 "sidebar." 197 msgstr "" 198 199 #: templates/admin-page-options.php:234 122 200 msgid "Save Settings" 123 201 msgstr "" 124 202 125 #: templates/admin-page-options.php: 94203 #: templates/admin-page-options.php:246 126 204 msgid "Message From the Author" 127 205 msgstr "" 128 206 129 #: templates/admin-page-options.php: 98207 #: templates/admin-page-options.php:250 130 208 msgid "" 131 209 "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments " 132 "are highly valuable to us and will assist us in improving the plugin further." 133 msgstr "" 134 135 #: templates/admin-page-options.php:108 210 "are highly valuable to us and will assist us in improving the plugin " 211 "further." 212 msgstr "" 213 214 #: templates/admin-page-options.php:260 136 215 msgid "" 137 216 "For support, please contact our helpdesk. If you encounter any issues or " … … 139 218 msgstr "" 140 219 141 #: templates/admin-page-options.php: 109220 #: templates/admin-page-options.php:261 142 221 msgid "contact us here" 143 222 msgstr "" 144 223 145 #: templates/admin-page-options.php: 121224 #: templates/admin-page-options.php:273 146 225 msgid "" 147 226 "Please consider leaving a review for our plugin. Your reviews help us " … … 149 228 msgstr "" 150 229 151 #: templates/admin-page-options.php: 123230 #: templates/admin-page-options.php:275 152 231 msgid "Leave a review" 153 232 msgstr "" -
easy-hide-admin-menu-items/tags/1.4.0/readme.txt
r3474229 r3783089 5 5 Requires at least: 5.9.0 6 6 Tested up to: 6.9 7 Stable tag: 1. 3.97 Stable tag: 1.4.0 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 40 40 41 41 Enhance your WordPress admin panel experience by effortlessly managing menu items and optimizing the interface according to your specific needs. Experience a clutter-free and user-friendly environment with Easy Hide Admin Menu Items. 42 43 ### Experimental Features in 1.4.0 44 45 These features are available under Appearance → Admin Menu Settings. They are marked as experimental and your feedback is welcome. 46 47 * **Menu Sorting:** Drag-and-drop reordering of admin menu items. A handle icon appears on hover — grab it to move items up or down. Your custom order is saved per user or globally depending on your settings. Disabling this option preserves your saved order. 48 * **Menu Separators:** Control the visibility of separator lines between menu groups. Choose to hide them completely or highlight them for better visual separation. 49 * **Sidebar Width:** Resize the expanded desktop menu by dragging its edge or using the width slider. The standard folded and mobile layouts are preserved. 42 50 43 51 == Frequently Asked Questions == … … 76 84 == Screenshots == 77 85 78 1. Hide unnecessary main menus effortlessly with our plugin 79 2. Activate child menu hiding 80 3. Explore and customize your preferences with easy-to-use plugin settings 81 4. Experience a user-friendly admin panel with our plugin's sleek design 86 1. A cleaner WordPress admin menu with hidden entries available from the toolbar. 87 2. Use the eye icon beside a main menu item to hide it. 88 3. Hide a submenu entry without hiding its parent menu. 89 4. Admin Menu Settings lets you switch between shared and personal preferences. 90 5. Experimental sorting lets you reorder menu items by dragging their handles. 91 6. Experimental sidebar resizing saves the width of the expanded desktop menu. 92 7. Experimental separator controls highlight or hide the boundaries between menu groups. 82 93 83 94 == Changelog == 95 96 = 1.4.0 = 97 - Added experimental drag-and-drop sorting for the WordPress admin menu. 98 - Added experimental sidebar resizing for the expanded desktop menu. 99 - Added experimental controls to hide or highlight menu separators. 100 - Added Slovak localization and updated Russian translations. 101 - Restricted shared menu changes to users with the manage_options capability. 102 - Kept personal menu visibility, order, and width separate between users. 103 - Fixed saved sidebar widths overriding the folded and mobile layouts. 104 - Aligned the icons in the review notice buttons. 105 - Updated the WordPress.org gallery with seven screenshots. 106 - Restored PHP 7.0 compatibility and corrected the review AJAX callbacks. 84 107 85 108 = 1.3.9 = -
easy-hide-admin-menu-items/tags/1.4.0/src/Ajax.php
r3474229 r3783089 13 13 add_action( 'wp_ajax_ehami_remove_item', [ $this, 'action_remove_item_from_db' ] ); 14 14 add_action( 'wp_ajax_ehami_hide_icons_disable', [ $this, 'action_hide_icons_disable' ] ); 15 add_action( 'wp_ajax_ehami_save_menu_order', [ $this, 'action_save_menu_order' ] ); 16 add_action( 'wp_ajax_ehami_reset_menu_order', [ $this, 'action_reset_menu_order' ] ); 17 add_action( 'wp_ajax_ehami_save_sidebar_width', [ $this, 'action_save_sidebar_width' ] ); 18 add_action( 'wp_ajax_ehami_reset_sidebar_width', [ $this, 'action_reset_sidebar_width' ] ); 15 19 } 16 20 … … 19 23 check_ajax_referer( self::NONCE_KEY ); 20 24 21 if ( ! current_user_can( 'read' ) ) {22 wp_die( 23 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),25 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 26 wp_die( 27 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 24 28 403 25 29 ); … … 38 42 if ( ! current_user_can( 'manage_options' ) ) { 39 43 wp_die( 40 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),41 403 42 ); 43 } 44 45 plugin()->settings->save_options([44 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 45 403 46 ); 47 } 48 49 $options = [ 46 50 'save_individually' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['save_individually'] ?? false ) ), 47 51 'hide_submenu' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_submenu'] ?? false ) ), 48 52 'remove_all_data_on_uninstall' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['remove_all_data_on_uninstall'] ?? false ) ), 49 ] ); 53 'enable_menu_sorting' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['enable_menu_sorting'] ?? false ) ), 54 'enable_sidebar_resize' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['enable_sidebar_resize'] ?? false ) ), 55 ]; 56 57 if ( isset( $_POST['options']['separators_mode'] ) ) { 58 $options['separators_mode'] = sanitize_text_field( wp_unslash( $_POST['options']['separators_mode'] ) ); 59 } 60 61 plugin()->settings->save_options( $options ); 50 62 51 63 wp_die(); … … 55 67 check_ajax_referer( self::NONCE_KEY ); 56 68 57 if ( ! current_user_can( 'read' ) ) {58 wp_die( 59 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),69 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 70 wp_die( 71 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 60 72 403 61 73 ); … … 75 87 check_ajax_referer( self::NONCE_KEY ); 76 88 77 if ( ! current_user_can( 'read' ) ) {78 wp_die( 79 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),89 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 90 wp_die( 91 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 80 92 403 81 93 ); … … 94 106 check_ajax_referer( self::NONCE_KEY ); 95 107 96 if ( ! current_user_can( 'read' ) ) { 97 wp_die( 98 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ), 99 403 100 ); 101 } 102 103 plugin()->settings->save_options( [ 104 'hide_icons_disable' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_icons_disable'] ?? false ) ) 105 ] ); 106 107 wp_die(); 108 } 109 108 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 109 wp_die( 110 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 111 403 112 ); 113 } 114 115 plugin()->settings->save_options( [ 116 'hide_icons_disable' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_icons_disable'] ?? false ) ), 117 ] ); 118 119 wp_die(); 120 } 121 122 /** 123 * Save menu order via AJAX (called on drag-and-drop end). 124 * 125 * @since 1.4.0 126 */ 127 public function action_save_menu_order() { 128 check_ajax_referer( self::NONCE_KEY ); 129 130 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 131 wp_die( 132 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 133 403 134 ); 135 } 136 137 // Each selector and position is sanitized separately below. 138 $order = isset( $_POST['order'] ) && is_array( $_POST['order'] ) ? wp_unslash( $_POST['order'] ) : []; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 139 140 $sanitized = []; 141 foreach ( $order as $selector => $position ) { 142 $sanitized[ sanitize_text_field( $selector ) ] = absint( $position ); 143 } 144 145 plugin()->settings->save_options( [ 146 'menu_order' => $sanitized, 147 ] ); 148 149 wp_die(); 150 } 151 152 /** 153 * Reset menu order to default (called from settings page). 154 * 155 * @since 1.4.0 156 */ 157 public function action_reset_menu_order() { 158 check_ajax_referer( self::NONCE_KEY ); 159 160 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 161 wp_die( 162 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 163 403 164 ); 165 } 166 167 plugin()->settings->save_options( [ 168 'menu_order' => [], 169 ] ); 170 171 wp_send_json_success(); 172 } 173 174 /** 175 * Save sidebar width via AJAX (called on resize end or range change). 176 * 177 * @since 1.4.0 178 */ 179 public function action_save_sidebar_width() { 180 check_ajax_referer( self::NONCE_KEY ); 181 182 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 183 wp_die( 184 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 185 403 186 ); 187 } 188 189 $width = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 0; 190 191 plugin()->settings->save_options( [ 192 'sidebar_width' => $width, 193 ] ); 194 195 wp_die(); 196 } 197 198 /** 199 * Reset sidebar width to default (called from settings page). 200 * 201 * @since 1.4.0 202 */ 203 public function action_reset_sidebar_width() { 204 check_ajax_referer( self::NONCE_KEY ); 205 206 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 207 wp_die( 208 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 209 403 210 ); 211 } 212 213 plugin()->settings->save_options( [ 214 'sidebar_width' => 0, 215 ] ); 216 217 wp_send_json_success(); 218 } 110 219 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Assets.php
r3474229 r3783089 10 10 11 11 public function enqueue_assets() { 12 wp_enqueue_style( 'ehami-style', plugin()->url . '/assets/css/style.css', [], plugin()->info['version'] ); 12 $version = plugin()->info['version']; 13 $url = plugin()->url; 14 15 wp_enqueue_style( 'ehami-style', $url . '/assets/css/style.css', [], $version ); 13 16 $this->add_inline_style( 'ehami-style' ); 14 17 15 /** 16 * Load the user interface script only if the 'save_individually' option is set to true in the global settings, 17 * or if the current user is an administrator. 18 */ 19 if ( true === plugin()->settings->save_individually || current_user_can( 'administrator' ) ) { 18 // SortableJS — loaded separately because it's a vendor library. 19 wp_enqueue_script( 'sortablejs', $url . '/assets/js/vendor/Sortable.min.js', [], '1.15.7', true ); 20 20 21 wp_enqueue_script( 22 'ehami-user-interface', 23 plugin()->url . '/assets/js/user-interface.js', 24 [ 25 'jquery', 26 'jquery-effects-transfer', 27 ], 28 plugin()->info['version'], 29 true 30 ); 21 // Main script — all EHAMI modules in one file. 22 wp_enqueue_script( 'ehami', $url . '/assets/js/ehami.js', [ 'sortablejs' ], $version, true ); 23 wp_add_inline_script( 'ehami', 'var ehami = ' . wp_json_encode( $this->get_script_data() ), 'before' ); 24 } 31 25 32 } 33 34 wp_enqueue_script( 'ehami-settings-page', plugin()->url . '/assets/js/settings-page.js', [ 'jquery' ], plugin()->info['version'], true ); 35 $data = [ 36 'nonce' => wp_create_nonce( 'ehami-nonce' ), 37 'no_items' => __( 'No hidden menu items', 'ehami' ), 38 'hid' => __( 'Hide menu', 'ehami' ), 39 'count_items' => count( plugin()->settings->items ), 40 'hide_submenu' => plugin()->settings->hide_submenu, 26 /** 27 * Build the data object passed to all JS modules via the `ehami` global. 28 * 29 * @return array 30 */ 31 private function get_script_data(): array { 32 return [ 33 'nonce' => wp_create_nonce( 'ehami-nonce' ), 34 'no_items' => __( 'No hidden menu items', 'ehami' ), 35 'hid' => __( 'Hide menu', 'ehami' ), 36 'count_items' => count( plugin()->settings->items ), 37 'hide_submenu' => plugin()->settings->hide_submenu, 38 'saved' => __( 'Settings saved.', 'ehami' ), 39 'save_error' => __( 'Error saving settings.', 'ehami' ), 40 'enable_menu_sorting' => plugin()->settings->enable_menu_sorting, 41 'can_customize' => plugin()->settings->save_individually || current_user_can( 'manage_options' ), 42 'menu_order' => plugin()->settings->menu_order, 43 'enable_sidebar_resize' => plugin()->settings->enable_sidebar_resize, 44 'sidebar_width' => plugin()->settings->sidebar_width, 45 'video_url' => plugin()->url . '/assets/mp4/', 41 46 ]; 42 wp_add_inline_script( 'ehami-user-interface', 'const ehami = ' . wp_json_encode( $data ), 'before' );43 47 } 44 48 45 49 public function add_inline_style( string $handle ) { 50 $css = ''; 51 52 // Hidden menu items. 46 53 $items = plugin()->settings->items; 47 48 if ( ! $items ) { 49 return; 54 if ( $items ) { 55 foreach ( $items as $id => $text ) { 56 if ( strpos( $id, '.php' ) !== false ) { 57 // for submenu items 58 $css .= sprintf( '.ehami-enable #adminmenu .wp-submenu a[href="%s"] { display: none; }', esc_attr( $id ) ); 59 } elseif ( strpos( $id, '#' ) !== false ) { 60 // for parent menu items 61 $css .= sprintf( '.ehami-enable #adminmenu %s { display: none; }', esc_attr( $id ) ); 62 } 63 } 50 64 } 51 65 52 $css = ''; 53 foreach ( $items as $id => $text ) { 54 if ( str_contains( $id, '.php' ) ) { 55 // for submenu items 56 $css .= sprintf( '.ehami-enable #adminmenu .wp-submenu a[href="%s"] { display: none; }', esc_attr( $id ) ); 57 } elseif ( str_contains( $id, '#' ) ) { 58 // for parent menu items 59 $css .= sprintf( '.ehami-enable #adminmenu %s { display: none; }', esc_attr( $id ) ); 60 } 66 // Sidebar width override. 67 // Apply only to the expanded desktop menu; WordPress folds it on narrower screens. 68 $sidebar_width = plugin()->settings->sidebar_width; 69 if ( plugin()->settings->enable_sidebar_resize && $sidebar_width > 0 ) { 70 $w = (int) $sidebar_width; 71 $css .= sprintf( 72 '@media (min-width: 961px) {' . 73 'body:not(.folded) #adminmenuwrap, body:not(.folded) #adminmenuback, body:not(.folded) #adminmenu { width: %1$dpx; }' . 74 'body:not(.folded) #wpcontent, body:not(.folded) #wpfooter { margin-left: %1$dpx; }' . 75 'body:not(.folded) #adminmenu .wp-not-current-submenu .wp-submenu { left: %1$dpx; }' . 76 'body:not(.folded) #adminmenu .wp-has-current-submenu .wp-submenu { width: 100%%; }' . 77 '}', 78 $w 79 ); 61 80 } 62 wp_add_inline_style( $handle, $css ); 81 82 // Separators mode. 83 $separators_mode = plugin()->settings->separators_mode; 84 if ( $separators_mode === 'hidden' ) { 85 $css .= '#adminmenu li.wp-menu-separator { display: none; }'; 86 } elseif ( $separators_mode === 'highlight' ) { 87 $css .= '#adminmenu li.wp-menu-separator { height: auto; margin: 0; }'; 88 $css .= '#adminmenu li.wp-menu-separator > .separator { height: 2px; margin: 8px 12px; background: rgba(255,255,255,0.08); border: none; }'; 89 } 90 91 if ( $css ) { 92 wp_add_inline_style( $handle, $css ); 93 } 63 94 } 64 65 95 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Review.php
r3474229 r3783089 21 21 22 22 // Check if the condition is met before adding hooks. 23 if ( is_array( $ehami_data_install ) && strtotime( gmdate( 'Y-m-d' ) ) >= strtotime( $ehami_data_install['date'] ) ) {23 if ( is_array( $ehami_data_install ) && isset( $ehami_data_install['date'] ) && strtotime( gmdate( 'Y-m-d' ) ) >= strtotime( $ehami_data_install['date'] ) ) { 24 24 add_action( 'admin_head', [ $this, 'add_admin_inline_style' ] ); 25 25 add_action( 'admin_footer', [ $this, 'add_admin_footer_script' ] ); … … 61 61 gap: 5px; 62 62 } 63 64 .wp-core-ui .button.ehami_review__link .dashicons { 65 line-height: 1; 66 } 63 67 </style> 64 68 <?php … … 147 151 148 152 <img class="ehami_review__img" 149 src="https://ps.w.org/easy-hide-admin-menu-items/assets/icon-128x128.png" alt="">153 src="https://ps.w.org/easy-hide-admin-menu-items/assets/icon-128x128.png" alt=""> 150 154 151 155 </div> … … 185 189 186 190 <a id="ehami_leave_feedback" class="button button-primary ehami_review__link" 187 href="https://wordpress.org/support/plugin/easy-hide-admin-menu-items/reviews/#new-post"188 target="_blank">191 href="https://wordpress.org/support/plugin/easy-hide-admin-menu-items/reviews/#new-post" 192 target="_blank"> 189 193 190 194 <?php echo esc_html__( 'Leave feedback', 'ehami' ); ?> … … 233 237 public function leave_feedback_ajax_callback() { 234 238 $this->review_ajax_callback( 'feedback_submitted', '+5 years' ); 235 wp_die();236 239 } 237 240 … … 241 244 public function remind_ajax_callback() { 242 245 $this->review_ajax_callback( 'remind_submitted', '+1 days' ); 243 wp_die();244 246 } 245 247 … … 249 251 public function already_ajax_callback() { 250 252 $this->review_ajax_callback( 'already_submitted', '+4 years' ); 251 wp_die();252 253 } 253 254 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Settings.php
r3474229 r3783089 4 4 5 5 /** 6 * @property-read array $items 7 * @property-read bool $status 8 * @property-read bool $save_individually 9 * @property-read bool $hide_submenu 10 * @property-read bool $remove_all_data_on_uninstall 11 * @property-read bool $hide_icons_disable 6 * @property-read array $items 7 * @property-read bool $status 8 * @property-read bool $save_individually 9 * @property-read bool $hide_submenu 10 * @property-read bool $remove_all_data_on_uninstall 11 * @property-read bool $hide_icons_disable 12 * @property-read string $separators_mode 13 * @property-read bool $enable_menu_sorting 14 * @property-read array $menu_order 15 * @property-read bool $enable_sidebar_resize 16 * @property-read int $sidebar_width 12 17 */ 13 18 class Settings { … … 23 28 'remove_all_data_on_uninstall' => false, 24 29 'hide_icons_disable' => false, 30 // Experimental features. 31 'enable_menu_sorting' => false, 32 'menu_order' => [], 33 'separators_mode' => 'default', 34 'enable_sidebar_resize' => false, 35 'sidebar_width' => 0, 25 36 ]; 26 37 … … 38 49 39 50 if ( $this->options['save_individually'] ) { 51 if ( metadata_exists( 'user', get_current_user_id(), 'ehami_user_status' ) ) { 52 $this->options['status'] = (bool) get_user_meta( get_current_user_id(), 'ehami_user_status', true ); 53 } 40 54 $this->options['items'] = get_user_meta( get_current_user_id(), self::USER_ITEMS_META_KEY, true ) ?: []; 41 55 $this->options['hide_icons_disable'] = get_user_meta( get_current_user_id(), 'hide_icons_disable', true ) ?: false; 56 $this->options['menu_order'] = get_user_meta( get_current_user_id(), 'ehami_user_menu_order', true ) ?: []; 57 $this->options['sidebar_width'] = (int) get_user_meta( get_current_user_id(), 'ehami_sidebar_width', true ); 42 58 } 43 59 } … … 50 66 $options = $this->sanitize_options( $new_options ); 51 67 52 update_option( self::OPTION_NAME, $options, false ); 68 if ( $options['save_individually'] ) { 69 $global_options = array_merge( self::DEFAULT_OPTIONS, $this->get_db_options() ); 70 $personal_keys = [ 71 'status' => 'ehami_user_status', 72 'items' => self::USER_ITEMS_META_KEY, 73 'hide_icons_disable' => 'hide_icons_disable', 74 'menu_order' => 'ehami_user_menu_order', 75 'sidebar_width' => 'ehami_sidebar_width', 76 ]; 53 77 54 if ( $options['save_individually'] && array_key_exists( 'hide_icons_disable', $options ) ) { 55 update_user_meta( get_current_user_id(), 'hide_icons_disable', $options['hide_icons_disable'] ); 78 foreach ( $personal_keys as $key => $meta_key ) { 79 if ( isset( $new_options[ $key ] ) && ( ! is_array( self::DEFAULT_OPTIONS[ $key ] ) || is_array( $new_options[ $key ] ) ) ) { 80 $value = $key === 'items' ? wp_slash( $options[ $key ] ) : $options[ $key ]; 81 update_user_meta( get_current_user_id(), $meta_key, $value ); 82 } 83 84 $options[ $key ] = $global_options[ $key ]; 85 } 56 86 } 57 87 58 if ( $options['save_individually'] && array_key_exists( 'items', $options ) ) { 59 update_user_meta( get_current_user_id(), self::USER_ITEMS_META_KEY, wp_slash( $options['items'] ) ); 60 } 61 88 update_option( self::OPTION_NAME, $options, false ); 62 89 } 63 90 … … 87 114 if ( isset( $new_options['items'] ) && is_array( $new_options['items'] ) ) { 88 115 $options['items'] = array_map( 'sanitize_text_field', $new_options['items'] ); 116 } 117 118 if ( isset( $new_options['enable_menu_sorting'] ) ) { 119 $options['enable_menu_sorting'] = (bool) $new_options['enable_menu_sorting']; 120 } 121 122 if ( isset( $new_options['menu_order'] ) && is_array( $new_options['menu_order'] ) ) { 123 $sanitized_order = []; 124 foreach ( $new_options['menu_order'] as $selector => $position ) { 125 $sanitized_order[ sanitize_text_field( $selector ) ] = absint( $position ); 126 } 127 $options['menu_order'] = $sanitized_order; 128 } 129 130 if ( isset( $new_options['separators_mode'] ) ) { 131 $allowed_modes = [ 'default', 'hidden', 'highlight' ]; 132 $mode = sanitize_text_field( $new_options['separators_mode'] ); 133 $options['separators_mode'] = in_array( $mode, $allowed_modes, true ) ? $mode : 'default'; 134 } 135 136 if ( isset( $new_options['enable_sidebar_resize'] ) ) { 137 $options['enable_sidebar_resize'] = (bool) $new_options['enable_sidebar_resize']; 138 } 139 140 if ( isset( $new_options['sidebar_width'] ) ) { 141 $width = absint( $new_options['sidebar_width'] ); 142 // Clamp to valid range: 0 (default/unset), or 160–480. 143 if ( $width > 0 ) { 144 $width = max( 160, min( 480, $width ) ); 145 } 146 $options['sidebar_width'] = $width; 89 147 } 90 148 … … 119 177 return ! is_null( $this->{$name} ); 120 178 } 121 122 179 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Settings_Page.php
r3474229 r3783089 41 41 return $actions; 42 42 } 43 44 43 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Switcher.php
r3474229 r3783089 13 13 * If the condition is met, or if the current user is an administrator, initialize the user interface. 14 14 */ 15 if ( true === plugin()->settings->save_individually || current_user_can( 'administrator' ) ) {15 if ( plugin()->settings->save_individually || current_user_can( 'manage_options' ) ) { 16 16 add_action( 'admin_bar_menu', [ $this, 'add_to_admin_bar' ] ); 17 17 } … … 39 39 return plugin()->settings->status ? $classes . ' ehami-enable' : $classes; 40 40 } 41 42 41 } -
easy-hide-admin-menu-items/tags/1.4.0/src/Uninstall.php
r3474229 r3783089 43 43 44 44 private function delete_users_options( $blog_id ) { 45 $meta_key = $this->settings::USER_ITEMS_META_KEY; 45 $meta_keys = [ 46 $this->settings::USER_ITEMS_META_KEY, 47 'hide_icons_disable', 48 'ehami_user_status', 49 'ehami_user_menu_order', 50 'ehami_sidebar_width', 51 ]; 46 52 47 $user_ids = get_users( 48 [ 49 'blog_id' => $blog_id, 50 'fields' => 'ID', 51 'meta_key' => $meta_key, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key 52 'meta_compare' => 'EXISTS', 53 ] 54 ); 53 foreach ( $meta_keys as $meta_key ) { 54 $user_ids = get_users( 55 [ 56 'blog_id' => $blog_id, 57 'fields' => 'ID', 58 'meta_key' => $meta_key, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key 59 'meta_compare' => 'EXISTS', 60 ] 61 ); 55 62 56 foreach ( $user_ids as $user_id ) { 57 delete_user_meta( $user_id, $meta_key ); 63 foreach ( $user_ids as $user_id ) { 64 delete_user_meta( $user_id, $meta_key ); 65 } 58 66 } 59 67 } -
easy-hide-admin-menu-items/tags/1.4.0/templates/admin-page-options.php
r3474229 r3783089 19 19 'description' => __( 'Allow hiding child admin menus', 'ehami' ), 20 20 'help' => __( 'If checked, you can hide the child menu. This may be useful when there are too many child menus causing distraction.', 'ehami' ), 21 'video' => 'child-menu', 21 22 ], 22 23 [ … … 28 29 'help' => __( 'If checked, all data (option and user metadata) will be deleted when the plugin is deleted.', 'ehami' ), 29 30 ], 31 ]; 32 33 $current_separators_mode = plugin()->settings->separators_mode; 34 $separators_options = [ 35 'default' => __( 'No changes (default)', 'ehami' ), 36 'hidden' => __( 'Hide all separators', 'ehami' ), 37 'highlight' => __( 'Highlight separators', 'ehami' ), 30 38 ]; 31 39 ?> … … 70 78 <?php echo esc_html( $field['description'] ); ?> 71 79 </label> 80 <?php if ( ! empty( $field['video'] ) ) : ?> 81 <span class="ehami-video-hint" data-video="<?php echo esc_attr( $field['video'] ); ?>"> 82 <span class="dashicons dashicons-video-alt3"></span> 83 </span> 84 <?php endif; ?> 72 85 </div> 73 86 … … 79 92 </tr> 80 93 <?php } ?> 94 95 <!-- Experimental: Menu Sorting --> 96 <tr class="ehami-settings__separator-row"> 97 <td colspan="2"><hr></td> 98 </tr> 99 <tr> 100 <th scope="row"> 101 <label for="ehami_enable_menu_sorting"> 102 <?php esc_html_e( 'Menu Sorting', 'ehami' ); ?> 103 </label> 104 </th> 105 <td> 106 <fieldset class="ehami-settings__main-fieldset"> 107 <legend class="screen-reader-text"> 108 <span><?php esc_html_e( 'Menu Sorting', 'ehami' ); ?></span> 109 </legend> 110 111 <div class="ehami-settings__main-field"> 112 <label for="ehami_enable_menu_sorting"> 113 <input 114 type="checkbox" 115 id="ehami_enable_menu_sorting" 116 name="enable_menu_sorting" 117 value="1" <?php checked( plugin()->settings->enable_menu_sorting, true ); ?> 118 > 119 <?php esc_html_e( 'Enable drag-and-drop menu reordering', 'ehami' ); ?> 120 </label> 121 <span class="ehami-video-hint" data-video="menu-sorting"> 122 <span class="dashicons dashicons-video-alt3"></span> 123 </span> 124 </div> 125 126 <div class="ehami-settings__main-field-description"> 127 <p class="description"> 128 <?php esc_html_e( 'Drag the handle icon on the right side of menu items to reorder them.', 'ehami' ); ?> 129 </p> 130 <p class="description"> 131 <strong><?php esc_html_e( 'Note:', 'ehami' ); ?></strong> 132 <?php esc_html_e( 'your custom order is preserved even when this option is disabled. Use "Reset menu order" to restore the default order.', 'ehami' ); ?> 133 </p> 134 <p class="ehami-settings__experimental-badge"> 135 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 136 <a href="#" id="ehami-reset-menu-order" class="ehami-reset-link"> 137 <span class="dashicons dashicons-image-rotate"></span> 138 <?php esc_html_e( 'Reset menu order', 'ehami' ); ?> 139 </a> 140 </p> 141 </div> 142 </fieldset> 143 </td> 144 </tr> 145 146 <!-- Experimental: Sidebar Width --> 147 <tr> 148 <th scope="row"> 149 <label for="ehami_enable_sidebar_resize"> 150 <?php esc_html_e( 'Sidebar Width', 'ehami' ); ?> 151 </label> 152 </th> 153 <td> 154 <fieldset class="ehami-settings__main-fieldset"> 155 <legend class="screen-reader-text"> 156 <span><?php esc_html_e( 'Sidebar Width', 'ehami' ); ?></span> 157 </legend> 158 159 <div class="ehami-settings__main-field"> 160 <label for="ehami_enable_sidebar_resize"> 161 <input 162 type="checkbox" 163 id="ehami_enable_sidebar_resize" 164 name="enable_sidebar_resize" 165 value="1" <?php checked( plugin()->settings->enable_sidebar_resize, true ); ?> 166 > 167 <?php esc_html_e( 'Enable sidebar width resize', 'ehami' ); ?> 168 </label> 169 <span class="ehami-video-hint" data-video="sidebar-width"> 170 <span class="dashicons dashicons-video-alt3"></span> 171 </span> 172 </div> 173 174 <div class="ehami-settings__main-field-description"> 175 <p class="description"> 176 <?php esc_html_e( 'Drag the right edge of the sidebar to adjust the menu width.', 'ehami' ); ?> 177 </p> 178 <p class="ehami-settings__experimental-badge"> 179 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 180 <a href="#" id="ehami-reset-sidebar-width" class="ehami-reset-link"> 181 <span class="dashicons dashicons-image-rotate"></span> 182 <?php esc_html_e( 'Reset sidebar width', 'ehami' ); ?> 183 </a> 184 </p> 185 </div> 186 </fieldset> 187 </td> 188 </tr> 189 190 <!-- Experimental: Separators --> 191 <tr> 192 <th scope="row"> 193 <label for="ehami_separators_mode"> 194 <?php esc_html_e( 'Menu Separators', 'ehami' ); ?> 195 </label> 196 </th> 197 <td> 198 <fieldset class="ehami-settings__main-fieldset"> 199 <legend class="screen-reader-text"> 200 <span><?php esc_html_e( 'Menu Separators', 'ehami' ); ?></span> 201 </legend> 202 203 <div class="ehami-settings__main-field"> 204 <select id="ehami_separators_mode" name="separators_mode"> 205 <?php foreach ( $separators_options as $value => $label ) : ?> 206 <option 207 value="<?php echo esc_attr( $value ); ?>" 208 <?php selected( $current_separators_mode, $value ); ?> 209 > 210 <?php echo esc_html( $label ); ?> 211 </option> 212 <?php endforeach; ?> 213 </select> 214 <span class="ehami-video-hint" data-video="separators"> 215 <span class="dashicons dashicons-video-alt3"></span> 216 </span> 217 </div> 218 219 <div class="ehami-settings__main-field-description"> 220 <p class="description"> 221 <?php esc_html_e( 'Control the visibility of separator lines between menu groups in the admin sidebar.', 'ehami' ); ?> 222 </p> 223 <p class="ehami-settings__experimental-badge"> 224 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 225 </p> 226 </div> 227 </fieldset> 228 </td> 229 </tr> 81 230 </tbody> 82 231 </table> 83 232 84 <?php submit_button( esc_html__( 'Save Settings', 'ehami' ), 'primary', 'submit_ehami_settings' ); ?> 233 <div class="ehami-save-row"> 234 <?php submit_button( esc_html__( 'Save Settings', 'ehami' ), 'primary', 'submit_ehami_settings', false ); ?> 235 <span class="ehami-inline-notice" aria-live="polite"></span> 236 </div> 85 237 </div> 86 238 … … 90 242 </div> 91 243 92 <!-- Added a block for the author's message -->244 <!-- Added a block for the author's message --> 93 245 <div id="ehami-author-info" class="stuffbox ehami-settings__author"> 94 246 <h2 class="ehami-settings__author-title"><?php esc_html_e( 'Message From the Author', 'ehami' ); ?></h2> -
easy-hide-admin-menu-items/tags/1.4.0/templates/switcher.php
r3474229 r3783089 30 30 <div class="ehami-block-checkbox"> 31 31 <input type="checkbox" 32 id="hide-icons-checkbox"33 name="hide_icons_disable"32 id="hide-icons-checkbox" 33 name="hide_icons_disable" 34 34 <?php echo $hide_icons_disable ? 'checked' : ''; ?> 35 35 /> -
easy-hide-admin-menu-items/trunk/assets/css/style.css
r3474229 r3783089 72 72 73 73 #wp-admin-bar-ehami-switch .switch__content { 74 display: none;75 74 position: absolute; 76 75 right: 0; … … 86 85 overflow-x: hidden; 87 86 overflow-y: auto; 87 88 /* CSS-driven show/hide — replaces jQuery slideDown/slideUp. */ 89 visibility: hidden; 90 opacity: 0; 91 pointer-events: none; 92 transition: opacity 0.2s ease, visibility 0.2s ease; 93 } 94 95 #wp-admin-bar-ehami-switch .switch__content.--open { 96 visibility: visible; 97 opacity: 1; 98 pointer-events: auto; 88 99 } 89 100 /* Mozilla Firefox */ … … 167 178 #adminmenu .menu-top .ehami-remove-sub-li:hover { 168 179 transform: scale(1.2); 169 }170 171 .ui-effects-transfer {172 border: 2px dotted #72aee6;173 background: #72aee6;174 z-index: 9999;175 180 } 176 181 … … 234 239 } 235 240 241 /** 242 * Inline save notice — shown near Save button and in the header. 243 * No content jump: elements are always in the DOM, just hidden. 244 * 245 * @since 1.4.0 246 */ 247 248 .ehami-save-row { 249 display: flex; 250 align-items: center; 251 gap: 12px; 252 margin: 1em 0; 253 } 254 255 .ehami-save-row .submit { 256 margin: 0; 257 padding: 0; 258 } 259 260 .ehami-inline-notice { 261 display: inline-flex; 262 align-items: center; 263 gap: 4px; 264 font-size: 13px; 265 line-height: 1.4; 266 opacity: 0; 267 white-space: nowrap; 268 } 269 270 .ehami-inline-notice .dashicons { 271 font-size: 18px; 272 width: 18px; 273 height: 18px; 274 line-height: 18px; 275 } 276 277 .ehami-inline-notice.--success { 278 color: #00a32a; 279 } 280 281 .ehami-inline-notice.--error { 282 color: #d63638; 283 } 284 285 236 286 .ehami-settings-saving { 237 287 position: absolute; … … 290 340 } 291 341 292 .admin-color-light .ui-effects-transfer {293 border: 2px dotted #04a4cc;294 background: #04a4cc;295 }296 297 342 /** 298 343 * Styles themes color .admin-color-modern … … 338 383 } 339 384 340 .admin-color-modern .ui-effects-transfer {341 border: 2px dotted #33f078;342 background: #33f078;343 }344 345 385 /** 346 386 * Styles themes color .admin-color-blue … … 389 429 } 390 430 391 .admin-color-blue .ui-effects-transfer {392 border: 2px dotted #4796b3;393 background: #4796b3;394 }395 396 431 /** 397 432 * Styles themes color .admin-color-coffee … … 440 475 } 441 476 442 .admin-color-coffee .ui-effects-transfer {443 border: 2px dotted #59524c;444 background: #59524c;445 }446 447 477 /** 448 478 * Styles themes color .admin-color-ectoplasm … … 491 521 } 492 522 493 .admin-color-ectoplasm .ui-effects-transfer {494 border: 2px dotted #523f6d;495 background: #523f6d;496 }497 498 523 /** 499 524 * Styles themes color .admin-color-midnight … … 542 567 } 543 568 544 .admin-color-midnight .ui-effects-transfer {545 border: 2px dotted #363b3f;546 background: #363b3f;547 }548 549 569 /** 550 570 * Styles themes color .admin-color-ocean … … 593 613 } 594 614 595 .admin-color-ocean .ui-effects-transfer {596 border: 2px dotted #738e96;597 background: #738e96;598 }599 600 615 /** 601 616 * Styles themes color .admin-color-sunrise … … 643 658 border-left: 2px solid #f7e3d3; 644 659 background-color: #cf4944; 645 }646 647 .admin-color-sunrise .ui-effects-transfer {648 border: 2px dotted #cf4944;649 background: #cf4944;650 660 } 651 661 … … 677 687 color: #eee; 678 688 } 689 690 /** 691 * Experimental badge and separator row 692 */ 693 694 .ehami-settings__experimental-badge { 695 margin-top: 8px; 696 display: flex; 697 align-items: center; 698 gap: 10px; 699 } 700 701 .ehami-badge { 702 display: inline-block; 703 padding: 2px 8px; 704 border-radius: 3px; 705 font-size: 11px; 706 font-weight: 600; 707 line-height: 1.6; 708 text-transform: uppercase; 709 } 710 711 .ehami-badge--experimental { 712 background: #fcf0c3; 713 color: #6e4e00; 714 } 715 716 .ehami-settings__separator-row td { 717 padding: 0; 718 } 719 720 .ehami-settings__separator-row hr { 721 margin: 0; 722 border: none; 723 border-top: 1px solid #ccc; 724 } 725 726 .ehami-settings__reset-order { 727 margin-top: 6px; 728 } 729 730 .ehami-reset-link { 731 color: #b32d2e; 732 text-decoration: none; 733 } 734 735 .ehami-reset-link:hover { 736 color: #a00; 737 } 738 739 .ehami-reset-link .dashicons { 740 font-size: 16px; 741 width: 16px; 742 height: 16px; 743 vertical-align: text-bottom; 744 margin-right: 2px; 745 } 746 747 /** 748 * Menu sorting — SortableJS + drag handle. 749 * Handle icon appears on hover (right side), same animation as hide icon (left side). 750 * 751 * @since 1.4.0 752 */ 753 754 /* Drag handle — hidden by default, slides in from right on hover. 755 Matches WP .wp-menu-image dimensions: 36x34px. */ 756 #adminmenu .menu-top .ehami-sort-handle { 757 position: absolute; 758 top: 0; 759 right: -36px; 760 width: 36px; 761 height: 34px; 762 line-height: 34px; 763 text-align: center; 764 padding: 0; 765 color: #a7aaad; 766 z-index: 9999; 767 background-color: #2c3338; 768 cursor: grab; 769 font-size: 20px; 770 transition: right 0.5s cubic-bezier(0.8, -0.2, 0.55, 1.3) 1s, 771 opacity 0.3s linear 1s; 772 opacity: 0; 773 } 774 775 #adminmenu .menu-top:hover .ehami-sort-handle { 776 right: 0; 777 opacity: 1; 778 } 779 780 #adminmenu .menu-top .ehami-sort-handle:hover { 781 color: #72aee6; 782 } 783 784 /* Separator as drag handle — hover highlight + grab cursor. */ 785 #adminmenu li.wp-menu-separator.ehami-sort-handle { 786 cursor: grab; 787 transition: background 0.2s ease; 788 } 789 790 #adminmenu li.wp-menu-separator.ehami-sort-handle:hover { 791 background: rgba(114, 174, 230, 0.2); 792 } 793 794 #adminmenu li.wp-menu-separator.ehami-sort-handle:hover .separator { 795 background: #72aee6; 796 height: 2px; 797 } 798 799 /** 800 * Folded sidebar + mobile: reposition hide icon and sort handle 801 * as a vertical dropdown below the menu item (36 x 34 px each). 802 * 803 * @since 1.4.0 804 */ 805 806 /* Shared dropdown styles for both folded and mobile contexts. 807 Applied via .folded prefix and duplicated inside @media (max-width: 782px) 808 because mobile WP admin does not always add the .folded class. */ 809 .folded #adminmenu .menu-top .ehami-remove-li, 810 .folded #adminmenu .menu-top .ehami-sort-handle { 811 position: absolute; 812 left: 0; 813 right: auto; 814 width: 36px; 815 height: 34px; 816 padding: 0; 817 z-index: 10003; 818 background-color: #2c3338; 819 box-shadow: inset 4px 0 0 0 #2271b1; 820 opacity: 0; 821 pointer-events: none; 822 transition: opacity 0.18s ease; 823 font-size: 16px; 824 } 825 826 .folded #adminmenu .menu-top .ehami-remove-li { 827 top: 100%; 828 display: flex; 829 align-items: center; 830 justify-content: center; 831 transform: none; 832 } 833 834 .folded #adminmenu .menu-top .ehami-sort-handle { 835 top: calc(100% + 34px); 836 line-height: 34px; 837 } 838 839 .folded #adminmenu .menu-top:hover .ehami-remove-li, 840 .folded #adminmenu .menu-top:hover .ehami-sort-handle, 841 .folded #adminmenu .menu-top.opensub .ehami-remove-li, 842 .folded #adminmenu .menu-top.opensub .ehami-sort-handle { 843 opacity: 1; 844 pointer-events: auto; 845 } 846 847 .folded #adminmenu .menu-top .ehami-remove-li:hover { 848 background-color: #3c4349; 849 transform: none; 850 } 851 852 .folded #adminmenu .menu-top .ehami-sort-handle:hover { 853 background-color: #3c4349; 854 color: #72aee6; 855 } 856 857 /* Mobile (< 782 px): identical dropdown layout. */ 858 @media (max-width: 782px) { 859 #adminmenu .menu-top .ehami-remove-li, 860 #adminmenu .menu-top .ehami-sort-handle { 861 position: absolute; 862 left: 0; 863 right: auto; 864 width: 36px; 865 height: 34px; 866 padding: 0; 867 z-index: 10003; 868 background-color: #2c3338; 869 box-shadow: inset 4px 0 0 0 #2271b1; 870 opacity: 0; 871 pointer-events: none; 872 transition: opacity 0.18s ease; 873 font-size: 16px; 874 } 875 876 #adminmenu .menu-top .ehami-remove-li { 877 top: 100%; 878 display: flex; 879 align-items: center; 880 justify-content: center; 881 transform: none; 882 } 883 884 #adminmenu .menu-top .ehami-sort-handle { 885 top: calc(100% + 34px); 886 line-height: 34px; 887 } 888 889 #adminmenu .menu-top:hover .ehami-remove-li, 890 #adminmenu .menu-top:hover .ehami-sort-handle, 891 #adminmenu .menu-top.opensub .ehami-remove-li, 892 #adminmenu .menu-top.opensub .ehami-sort-handle { 893 opacity: 1; 894 pointer-events: auto; 895 } 896 897 #adminmenu .menu-top .ehami-remove-li:hover { 898 background-color: #3c4349; 899 transform: none; 900 } 901 902 #adminmenu .menu-top .ehami-sort-handle:hover { 903 background-color: #3c4349; 904 color: #72aee6; 905 } 906 } 907 908 /* Ghost: placeholder left in place — shows where the item will land. */ 909 #adminmenu > li.menu-top.ehami-sortable-ghost { 910 background: rgba(114, 174, 230, 0.12) !important; 911 border: 2px dashed #72aee6; 912 border-radius: 3px; 913 height: 36px !important; 914 min-height: 0 !important; 915 overflow: hidden; 916 } 917 918 #adminmenu > li.wp-menu-separator.ehami-sortable-ghost { 919 background: rgba(114, 174, 230, 0.25) !important; 920 border: 1px dashed #72aee6; 921 border-radius: 2px; 922 height: 6px !important; 923 } 924 925 #adminmenu > li.ehami-sortable-ghost > * { 926 visibility: hidden; 927 } 928 929 #adminmenu > li.ehami-sortable-ghost .wp-submenu { 930 display: none !important; 931 } 932 933 /* Drag clone: the floating copy that follows the cursor. 934 Background comes from CSS variable set by JS on drag start — 935 automatically matches any admin color scheme. */ 936 li.ehami-sortable-drag { 937 background: var(--ehami-sidebar-bg, #1d2327) !important; 938 opacity: 0.95 !important; 939 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important; 940 border-radius: 3px; 941 } 942 943 li.ehami-sortable-drag .wp-submenu { 944 display: none !important; 945 } 946 947 /* Separator drag clone — visible bright line so user sees what they're dragging. */ 948 li.wp-menu-separator.ehami-sortable-drag { 949 background: transparent !important; 950 box-shadow: none !important; 951 height: auto !important; 952 padding: 4px 0 !important; 953 } 954 955 li.wp-menu-separator.ehami-sortable-drag .separator { 956 height: 3px !important; 957 background: #72aee6 !important; 958 border-radius: 2px; 959 margin: 0 8px; 960 } 961 962 li.ehami-sortable-drag .ehami-sort-handle, 963 li.ehami-sortable-drag .ehami-remove-li { 964 display: none !important; 965 } 966 967 /* When "Don't display hide icons" is checked — disable all sorting interactions. */ 968 .ehami-icons-hidden #adminmenu .menu-top .ehami-sort-handle { 969 display: none !important; 970 } 971 972 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle { 973 cursor: default; 974 pointer-events: none; 975 } 976 977 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle:hover { 978 background: transparent; 979 } 980 981 .ehami-icons-hidden #adminmenu li.wp-menu-separator.ehami-sort-handle:hover .separator { 982 background: inherit; 983 height: inherit; 984 } 985 986 /* Prevent text selection while dragging. */ 987 .ehami-sorting-active { 988 user-select: none !important; 989 -webkit-user-select: none !important; 990 cursor: grabbing !important; 991 } 992 993 /* Admin color scheme support for drag handle. */ 994 .admin-color-light #adminmenu .menu-top .ehami-sort-handle { 995 background-color: #fff; 996 color: #999; 997 } 998 999 .admin-color-light #adminmenu .menu-top .ehami-sort-handle:hover { 1000 color: #04a4cc; 1001 } 1002 1003 .admin-color-modern #adminmenu .menu-top .ehami-sort-handle { 1004 background-color: #0c0c0c; 1005 color: #86888a; 1006 } 1007 1008 .admin-color-modern #adminmenu .menu-top .ehami-sort-handle:hover { 1009 color: #33f078; 1010 } 1011 1012 /* Admin color scheme overrides for folded dropdown icons. 1013 @since 1.4.0 */ 1014 .admin-color-light.folded #adminmenu .menu-top .ehami-remove-li, 1015 .admin-color-light.folded #adminmenu .menu-top .ehami-sort-handle { 1016 background-color: #f1f1f1; 1017 box-shadow: inset 4px 0 0 0 #888; 1018 } 1019 1020 .admin-color-modern.folded #adminmenu .menu-top .ehami-remove-li, 1021 .admin-color-modern.folded #adminmenu .menu-top .ehami-sort-handle { 1022 background-color: #1e1e1e; 1023 box-shadow: inset 4px 0 0 0 #3858e9; 1024 } 1025 1026 .admin-color-blue.folded #adminmenu .menu-top .ehami-remove-li, 1027 .admin-color-blue.folded #adminmenu .menu-top .ehami-sort-handle { 1028 background-color: #52accc; 1029 box-shadow: inset 4px 0 0 0 #e2ecf1; 1030 } 1031 1032 .admin-color-coffee.folded #adminmenu .menu-top .ehami-remove-li, 1033 .admin-color-coffee.folded #adminmenu .menu-top .ehami-sort-handle { 1034 background-color: #46403c; 1035 box-shadow: inset 4px 0 0 0 #c7a589; 1036 } 1037 1038 .admin-color-ectoplasm.folded #adminmenu .menu-top .ehami-remove-li, 1039 .admin-color-ectoplasm.folded #adminmenu .menu-top .ehami-sort-handle { 1040 background-color: #413256; 1041 box-shadow: inset 4px 0 0 0 #a3b745; 1042 } 1043 1044 .admin-color-midnight.folded #adminmenu .menu-top .ehami-remove-li, 1045 .admin-color-midnight.folded #adminmenu .menu-top .ehami-sort-handle { 1046 background-color: #26292c; 1047 box-shadow: inset 4px 0 0 0 #e14d43; 1048 } 1049 1050 .admin-color-ocean.folded #adminmenu .menu-top .ehami-remove-li, 1051 .admin-color-ocean.folded #adminmenu .menu-top .ehami-sort-handle { 1052 background-color: #627c83; 1053 box-shadow: inset 4px 0 0 0 #9ebaa0; 1054 } 1055 1056 .admin-color-sunrise.folded #adminmenu .menu-top .ehami-remove-li, 1057 .admin-color-sunrise.folded #adminmenu .menu-top .ehami-sort-handle { 1058 background-color: #be3631; 1059 box-shadow: inset 4px 0 0 0 #dd823b; 1060 } 1061 1062 /** 1063 * Sidebar resize — Notion/Outline-style drag handle. 1064 * 1065 * Invisible grab zone on the right edge of the sidebar. 1066 * On hover a thin vertical line appears at the boundary. 1067 * Drag left/right to resize. Release to save. 1068 * 1069 * @since 1.4.0 1070 */ 1071 1072 /* Grab zone — fixed to viewport, stretches from admin bar to bottom of screen. */ 1073 .ehami-resize-handle { 1074 position: fixed; 1075 top: 32px; 1076 bottom: 0; 1077 width: 2px; 1078 cursor: col-resize; 1079 z-index: 9999; 1080 } 1081 1082 /* Keep the WP menu arrow (triangle) above the resize handle. */ 1083 ul#adminmenu a.wp-has-current-submenu:after, 1084 ul#adminmenu > li.current > a.current:after { 1085 z-index: 10000; 1086 } 1087 1088 /* Vertical line — appears on hover/active. 1089 Color is set via --ehami-resize-color CSS variable by JS (matches admin color scheme). */ 1090 .ehami-resize-handle::after { 1091 content: ""; 1092 position: absolute; 1093 top: 0; 1094 left: 50%; 1095 transform: translateX(-50%); 1096 width: 4px; 1097 height: 100%; 1098 background: transparent; 1099 transition: background 0.15s ease; 1100 } 1101 1102 .ehami-resize-handle:hover::after, 1103 .ehami-resize-handle.ehami-resize-active::after { 1104 background: var(--ehami-resize-color, #2271b1); 1105 } 1106 1107 /* Prevent text selection and pointer events during resize. */ 1108 .ehami-resizing { 1109 user-select: none !important; 1110 -webkit-user-select: none !important; 1111 cursor: col-resize !important; 1112 } 1113 1114 .ehami-resizing iframe { 1115 pointer-events: none; 1116 } 1117 1118 /* Hide resize handle when menu is folded or on mobile. */ 1119 .folded .ehami-resize-handle { 1120 display: none; 1121 } 1122 1123 @media (max-width: 960px) { 1124 .auto-fold .ehami-resize-handle { 1125 display: none; 1126 } 1127 } 1128 1129 @media (max-width: 782px) { 1130 .ehami-resize-handle { 1131 display: none; 1132 } 1133 } 1134 1135 /** 1136 * Video tooltip — play icon next to settings labels. 1137 * On hover shows a small popup with auto-playing video. 1138 * 1139 * @since 1.5.0 1140 */ 1141 1142 .ehami-video-hint { 1143 display: inline-block; 1144 position: relative; 1145 vertical-align: middle; 1146 margin-left: 4px; 1147 cursor: pointer; 1148 } 1149 1150 .ehami-video-hint .dashicons { 1151 font-size: 16px; 1152 width: 16px; 1153 height: 16px; 1154 line-height: 16px; 1155 color: #a7aaad; 1156 transition: color 0.15s ease; 1157 } 1158 1159 .ehami-video-hint:hover .dashicons { 1160 color: #2271b1; 1161 } 1162 1163 /* Tooltip container — anchored to the icon, appears on hover. */ 1164 .ehami-video-tooltip { 1165 position: absolute; 1166 left: 50%; 1167 bottom: calc(100% + 8px); 1168 transform: translateX(-50%); 1169 width: 400px; 1170 background: #1d2327; 1171 border-radius: 6px; 1172 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); 1173 overflow: hidden; 1174 z-index: 100001; 1175 opacity: 0; 1176 visibility: hidden; 1177 transition: opacity 0.2s ease, visibility 0.2s ease; 1178 pointer-events: none; 1179 } 1180 1181 .ehami-video-hint:hover .ehami-video-tooltip { 1182 opacity: 1; 1183 visibility: visible; 1184 pointer-events: auto; 1185 } 1186 1187 /* Arrow pointing down from the tooltip. */ 1188 .ehami-video-tooltip::after { 1189 content: ""; 1190 position: absolute; 1191 left: 50%; 1192 bottom: -6px; 1193 transform: translateX(-50%); 1194 border-left: 6px solid transparent; 1195 border-right: 6px solid transparent; 1196 border-top: 6px solid #1d2327; 1197 } 1198 1199 /* Video element inside the tooltip. */ 1200 .ehami-video-tooltip video { 1201 display: block; 1202 width: 100%; 1203 height: auto; 1204 border-radius: 6px; 1205 } 1206 1207 /* Spinner — shown while video is loading. */ 1208 .ehami-video-tooltip .ehami-video-spinner { 1209 position: absolute; 1210 top: 50%; 1211 left: 50%; 1212 transform: translate(-50%, -50%); 1213 width: 24px; 1214 height: 24px; 1215 border: 3px solid rgba(255, 255, 255, 0.2); 1216 border-top-color: #fff; 1217 border-radius: 50%; 1218 animation: ehami-spin 0.6s linear infinite; 1219 } 1220 1221 .ehami-video-tooltip .ehami-video-spinner.--hidden { 1222 display: none; 1223 } 1224 1225 @keyframes ehami-spin { 1226 to { transform: translate(-50%, -50%) rotate(360deg); } 1227 } 1228 1229 /** 1230 * Fly-to-bar animation — menu item clone flies toward the admin bar toggle. 1231 * 1232 * @since 1.5.0 1233 */ 1234 1235 /* Transfer outline — visible dashed border that flies from sidebar to admin bar. */ 1236 .ehami-fly-clone { 1237 position: fixed; 1238 z-index: 100000; 1239 pointer-events: none; 1240 border: 2px dashed #72aee6; 1241 border-radius: 3px; 1242 background: rgba(114, 174, 230, 0.08); 1243 } 1244 1245 .ehami-fly-clone.--animating { 1246 transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1247 top 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1248 width 0.5s cubic-bezier(0.4, 0, 0.2, 1), 1249 height 0.5s cubic-bezier(0.4, 0, 0.2, 1); 1250 } -
easy-hide-admin-menu-items/trunk/autoload.php
r3474229 r3783089 7 7 8 8 spl_autoload_register( 9 static function ( $class ) {10 if ( strpos( $class , __NAMESPACE__ . '\\' ) !== 0 ) {9 static function ( $class_name ) { 10 if ( strpos( $class_name, __NAMESPACE__ . '\\' ) !== 0 ) { 11 11 return; 12 12 } 13 13 14 $path = str_replace( [ __NAMESPACE__, '\\' ], [ __DIR__ . '/src', '/' ], $class );14 $path = str_replace( [ __NAMESPACE__, '\\' ], [ __DIR__ . '/src', '/' ], $class_name ); 15 15 16 16 require_once "$path.php"; -
easy-hide-admin-menu-items/trunk/ehami.php
r3474229 r3783089 6 6 * Domain Path: /languages 7 7 * Description: The plugin allows hiding selected admin menu items. 8 * Version: 1. 3.98 * Version: 1.4.0 9 9 * Author: Campusboy, Dan Zakirov, Tkama 10 10 * License: GPL-2.0+ -
easy-hide-admin-menu-items/trunk/languages/ehami-ru_RU.po
r3474229 r3783089 1 # Translation of Plugins - Easy Hide Admin Menu Items - Stable (latest release) in Russian 2 # This file is distributed under the same license as the Plugins - Easy Hide Admin Menu Items - Stable (latest release) package. 3 msgid "" 4 msgstr "" 1 # Translation of Easy Hide Admin Menu Items in Russian 2 # This file is distributed under the same license as the Easy Hide Admin Menu Items package. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: Easy Hide Admin Menu Items 1.4.0\n" 5 6 "PO-Revision-Date: 2024-03-06 19:20:09+0000\n" 7 "Language: ru_RU\n" 6 8 "MIME-Version: 1.0\n" 7 9 "Content-Type: text/plain; charset=UTF-8\n" … … 9 11 "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2);\n" 10 12 "X-Generator: GlotPress/4.0.0-rc.1\n" 11 "Language: ru\n"12 "Project-Id-Version: Plugins - Easy Hide Admin Menu Items - Stable (latest release)\n"13 13 14 14 #: templates/switcher.php:36 … … 16 16 msgstr "Отключить иконки скрытия" 17 17 18 #: templates/admin-page-options.php: 12318 #: templates/admin-page-options.php:275 19 19 msgid "Leave a review" 20 20 msgstr "Оставить отзыв" 21 21 22 #: templates/admin-page-options.php:121 23 msgid "Please consider leaving a review for our plugin. Your reviews help us improve and serve you better." 24 msgstr "Пожалуйста, рассмотрите возможность оставить отзыв о нашем плагине. Ваша обратная связь мотивирует нас качественно улучшать сервис." 25 26 #: templates/admin-page-options.php:109 22 #: templates/admin-page-options.php:273 23 msgid "" 24 "Please consider leaving a review for our plugin. Your reviews help us " 25 "improve and serve you better." 26 msgstr "" 27 "Пожалуйста, рассмотрите возможность оставить отзыв о нашем плагине. Ваша " 28 "обратная связь мотивирует нас качественно улучшать сервис." 29 30 #: templates/admin-page-options.php:261 27 31 msgid "contact us here" 28 32 msgstr "обращаться к нам" 29 33 30 #: templates/admin-page-options.php:108 31 msgid "For support, please contact our helpdesk. If you encounter any issues or have any questions, feel free to" 32 msgstr "Для получения поддержки, пожалуйста, обратитесь на форум. Если у вас возникнут проблемы или вопросы, не стесняйтесь" 34 #: templates/admin-page-options.php:260 35 msgid "" 36 "For support, please contact our helpdesk. If you encounter any issues or " 37 "have any questions, feel free to" 38 msgstr "" 39 "Для получения поддержки, пожалуйста, обратитесь на форум. Если у вас " 40 "возникнут проблемы или вопросы, не стесняйтесь" 33 41 34 42 #: src/Review.php:190 … … 50 58 #. translators: %s is a placeholder for the plugin name 51 59 #: src/Review.php:161 52 msgid "We are very pleased that you are using the %s plugin within a few days." 60 #, php-format 61 msgid "" 62 "We are very pleased that you are using the %s plugin within a few days." 53 63 msgstr "Мы очень рады, что вы используете плагин %s уже несколько дней." 54 64 … … 57 67 msgstr "Здравствуйте!" 58 68 59 #. Author of the plugin 60 #: ehami.php 69 #. Author of the plugin/theme 61 70 msgid "Campusboy, Dan Zakirov, Tkama" 62 71 msgstr "Campusboy, Dan Zakirov, Tkama" … … 70 79 msgstr "Скрыть или показать скрытые пункты меню" 71 80 72 #: templates/admin-page-options.php:98 73 msgid "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments are highly valuable to us and will assist us in improving the plugin further." 74 msgstr "Благодарим вас за использование плагина Easy Hide Admin Menu Items! Ваши отзывы и комментарии имеют для нас большую ценность и помогут нам дальше улучшать плагин." 75 76 #: templates/admin-page-options.php:94 81 #: templates/admin-page-options.php:250 82 msgid "" 83 "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments " 84 "are highly valuable to us and will assist us in improving the plugin " 85 "further." 86 msgstr "" 87 "Благодарим вас за использование плагина Easy Hide Admin Menu Items! Ваши " 88 "отзывы и комментарии имеют для нас большую ценность и помогут нам дальше " 89 "улучшать плагин." 90 91 #: templates/admin-page-options.php:246 77 92 msgid "Message From the Author" 78 93 msgstr "Сообщение от авторов" 79 94 80 #: templates/admin-page-options.php: 8495 #: templates/admin-page-options.php:234 81 96 msgid "Save Settings" 82 97 msgstr "Сохранить настройки" 83 98 84 #: templates/admin-page-options.php: 4499 #: templates/admin-page-options.php:52 85 100 msgid "Main Settings" 86 101 msgstr "Основные настройки" 87 102 88 #: templates/admin-page-options.php: 35103 #: templates/admin-page-options.php:43 89 104 msgid "Easy Hide Admin Menu Items Settings" 90 105 msgstr "Настройки Easy Hide Admin Menu Items" 91 106 107 #: templates/admin-page-options.php:29 108 msgid "" 109 "If checked, all data (option and user metadata) will be deleted when the " 110 "plugin is deleted." 111 msgstr "" 112 "Если отмечено, то все данные (опции и метаданные пользователей) будут " 113 "удалены из базы данных при удалении плагина." 114 92 115 #: templates/admin-page-options.php:28 93 msgid "If checked, all data (option and user metadata) will be deleted when the plugin is deleted."94 msgstr "Если отмечено, то все данные (опции и метаданные пользователей) будут удалены из базы данных при удалении плагина."95 96 #: templates/admin-page-options.php:2797 116 msgid "Allow the deletion of all plugin data after it is deleted" 98 117 msgstr "Разрешить удаление всех данных после удаления плагина" 99 118 100 #: templates/admin-page-options.php:2 3119 #: templates/admin-page-options.php:24 101 120 msgid "Uninstall plugin" 102 121 msgstr "Удаление плагина" 103 122 104 123 #: templates/admin-page-options.php:20 105 msgid "If checked, you can hide the child menu. This may be useful when there are too many child menus causing distraction." 106 msgstr "Если отмечено, вы можете скрывать дочерние меню. Это может быть полезно, когда слишком много дочерних меню которыми вы не пользуетесь." 124 msgid "" 125 "If checked, you can hide the child menu. This may be useful when there are " 126 "too many child menus causing distraction." 127 msgstr "" 128 "Если отмечено, вы можете скрывать дочерние меню. Это может быть полезно, " 129 "когда слишком много дочерних меню которыми вы не пользуетесь." 107 130 108 131 #: templates/admin-page-options.php:19 … … 115 138 116 139 #: templates/admin-page-options.php:12 117 msgid "If checked, each user with access to the admin panel can save hidden menu settings individually for their own preferences." 118 msgstr "Если отмечено, каждый пользователь с доступом к административной панели может сохранить скрытые настройки меню индивидуально для своих предпочтений." 140 msgid "" 141 "If checked, each user with access to the admin panel can save hidden menu " 142 "settings individually for their own preferences." 143 msgstr "" 144 "Если отмечено, каждый пользователь с доступом к административной панели " 145 "может сохранить скрытые настройки меню индивидуально для своих предпочтений." 119 146 120 147 #: templates/admin-page-options.php:11 121 148 msgid "Allow other users to set their own preferences." 122 msgstr "Разрешить другим пользователям настраивать меню для себя на своё усмотрение." 149 msgstr "" 150 "Разрешить другим пользователям настраивать меню для себя на своё усмотрение." 123 151 124 152 #: templates/admin-page-options.php:7 … … 134 162 msgstr "Настройки меню администратора" 135 163 136 #: src/Assets.php:3 8164 #: src/Assets.php:35 137 165 msgid "Hide menu" 138 166 msgstr "Скрыть меню" 139 167 140 #: src/Assets.php:3 7templates/switcher.php:26168 #: src/Assets.php:34 templates/switcher.php:26 141 169 msgid "No hidden menu items" 142 170 msgstr "Скрытые меню отсутствуют" 143 171 144 #: src/Ajax.php:23 src/Ajax.php:40 src/Ajax.php:59 src/Ajax.php:79 145 #: src/Ajax.php:98 172 #: src/Ajax.php:27 src/Ajax.php:44 src/Ajax.php:71 src/Ajax.php:91 173 #: src/Ajax.php:110 src/Ajax.php:132 src/Ajax.php:162 src/Ajax.php:184 174 #: src/Ajax.php:208 146 175 msgid "Sorry, you are not allowed to manage options for this site." 147 176 msgstr "Извините, у вас нет прав на управление опциями для этого сайта." 148 177 149 #. Description of the plugin 150 #: ehami.php 178 #. Description of the plugin/theme 151 179 msgid "The plugin allows hiding selected admin menu items." 152 180 msgstr "Плагин позволяет скрывать выбранные пункты меню администратора." 153 181 154 #. Plugin URI of the plugin 155 #: ehami.php 182 #. Plugin URI of the plugin/theme 156 183 msgid "https://github.com/campusboy87/easy-hide-admin-menu-items" 157 184 msgstr "https://github.com/campusboy87/easy-hide-admin-menu-items" 158 185 159 #. Plugin Name of the plugin 160 #: ehami.php 186 #. Plugin Name of the plugin/theme 161 187 msgid "Easy Hide Admin Menu Items" 162 188 msgstr "Easy Hide Admin Menu Items" 189 190 #: src/Assets.php:38 191 msgid "Settings saved." 192 msgstr "Настройки сохранены." 193 194 #: src/Assets.php:39 195 msgid "Error saving settings." 196 msgstr "Не удалось сохранить настройки." 197 198 #: templates/admin-page-options.php:35 199 msgid "No changes (default)" 200 msgstr "Без изменений (по умолчанию)" 201 202 #: templates/admin-page-options.php:36 203 msgid "Hide all separators" 204 msgstr "Скрыть все разделители" 205 206 #: templates/admin-page-options.php:37 207 msgid "Highlight separators" 208 msgstr "Выделить разделители" 209 210 #: templates/admin-page-options.php:102 templates/admin-page-options.php:108 211 msgid "Menu Sorting" 212 msgstr "Сортировка меню" 213 214 #: templates/admin-page-options.php:119 215 msgid "Enable drag-and-drop menu reordering" 216 msgstr "Разрешить изменение порядка пунктов меню перетаскиванием" 217 218 #: templates/admin-page-options.php:128 219 msgid "Drag the handle icon on the right side of menu items to reorder them." 220 msgstr "" 221 "Чтобы изменить порядок пунктов меню, перетащите значок справа от пункта." 222 223 #: templates/admin-page-options.php:131 224 msgid "Note:" 225 msgstr "Примечание:" 226 227 #: templates/admin-page-options.php:132 228 msgid "" 229 "your custom order is preserved even when this option is disabled. Use " 230 "\"Reset menu order\" to restore the default order." 231 msgstr "" 232 "заданный порядок сохраняется даже при отключении этой настройки. Чтобы " 233 "восстановить порядок по умолчанию, нажмите «Сбросить порядок меню»." 234 235 #: templates/admin-page-options.php:135 templates/admin-page-options.php:179 236 #: templates/admin-page-options.php:224 237 msgid "Experimental" 238 msgstr "Экспериментальная функция" 239 240 #: templates/admin-page-options.php:138 241 msgid "Reset menu order" 242 msgstr "Сбросить порядок меню" 243 244 #: templates/admin-page-options.php:150 templates/admin-page-options.php:156 245 msgid "Sidebar Width" 246 msgstr "Ширина боковой панели" 247 248 #: templates/admin-page-options.php:167 249 msgid "Enable sidebar width resize" 250 msgstr "Разрешить изменение ширины боковой панели" 251 252 #: templates/admin-page-options.php:176 253 msgid "Drag the right edge of the sidebar to adjust the menu width." 254 msgstr "Чтобы изменить ширину меню, перетащите правый край боковой панели." 255 256 #: templates/admin-page-options.php:182 257 msgid "Reset sidebar width" 258 msgstr "Сбросить ширину боковой панели" 259 260 #: templates/admin-page-options.php:194 templates/admin-page-options.php:200 261 msgid "Menu Separators" 262 msgstr "Разделители меню" 263 264 #: templates/admin-page-options.php:221 265 msgid "" 266 "Control the visibility of separator lines between menu groups in the admin " 267 "sidebar." 268 msgstr "" 269 "Управляйте отображением линий между группами пунктов меню в боковой панели " 270 "администратора." -
easy-hide-admin-menu-items/trunk/languages/ehami.pot
r3474229 r3783089 1 # 1 2 #, fuzzy 2 3 msgid "" 3 4 msgstr "" 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 "Project-Id-Version: Easy Hide Admin Menu Items\n" 5 "Project-Id-Version: Easy Hide Admin Menu Items 1.4.0\n" 6 6 "POT-Creation-Date: 2024-03-07 07:45+0300\n" 7 7 "PO-Revision-Date: 2024-03-07 07:45+0300\n" … … 11 11 "Content-Type: text/plain; charset=UTF-8\n" 12 12 "Content-Transfer-Encoding: 8bit\n" 13 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 13 14 "X-Generator: Poedit 2.0.7\n" 14 15 "X-Poedit-Basepath: ..\n" 15 16 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 "X-Poedit-WPHeader: ehami.php\n" 17 "X-Poedit-SourceCharset: UTF-8\n" 18 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 19 "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 20 "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 17 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 21 18 "X-Poedit-SearchPath-0: .\n" 22 19 "X-Poedit-SearchPathExcluded-0: *.js\n" 23 24 #: src/Ajax.php:23 src/Ajax.php:40 src/Ajax.php:59 src/Ajax.php:79 25 #: src/Ajax.php:98 20 "X-Poedit-SourceCharset: UTF-8\n" 21 "X-Poedit-WPHeader: ehami.php\n" 22 23 #: src/Ajax.php:27 src/Ajax.php:44 src/Ajax.php:71 src/Ajax.php:91 24 #: src/Ajax.php:110 src/Ajax.php:132 src/Ajax.php:162 src/Ajax.php:184 25 #: src/Ajax.php:208 26 26 msgid "Sorry, you are not allowed to manage options for this site." 27 27 msgstr "" 28 28 29 #: src/Assets.php:3 7templates/switcher.php:2629 #: src/Assets.php:34 templates/switcher.php:26 30 30 msgid "No hidden menu items" 31 31 msgstr "" 32 32 33 #: src/Assets.php:35 34 msgid "Hide menu" 35 msgstr "" 36 33 37 #: src/Assets.php:38 34 msgid "Hide menu" 38 msgid "Settings saved." 39 msgstr "" 40 41 #: src/Assets.php:39 42 msgid "Error saving settings." 35 43 msgstr "" 36 44 … … 42 50 #: src/Review.php:161 43 51 #, php-format 44 msgid "We are very pleased that you are using the %s plugin within a few days." 52 msgid "" 53 "We are very pleased that you are using the %s plugin within a few days." 45 54 msgstr "" 46 55 … … 97 106 msgstr "" 98 107 99 #: templates/admin-page-options.php:2 3108 #: templates/admin-page-options.php:24 100 109 msgid "Uninstall plugin" 101 110 msgstr "" 102 111 103 #: templates/admin-page-options.php:2 7112 #: templates/admin-page-options.php:28 104 113 msgid "Allow the deletion of all plugin data after it is deleted" 105 114 msgstr "" 106 115 107 #: templates/admin-page-options.php:2 8116 #: templates/admin-page-options.php:29 108 117 msgid "" 109 118 "If checked, all data (option and user metadata) will be deleted when the " … … 112 121 113 122 #: templates/admin-page-options.php:35 123 msgid "No changes (default)" 124 msgstr "" 125 126 #: templates/admin-page-options.php:36 127 msgid "Hide all separators" 128 msgstr "" 129 130 #: templates/admin-page-options.php:37 131 msgid "Highlight separators" 132 msgstr "" 133 134 #: templates/admin-page-options.php:43 114 135 msgid "Easy Hide Admin Menu Items Settings" 115 136 msgstr "" 116 137 117 #: templates/admin-page-options.php: 44138 #: templates/admin-page-options.php:52 118 139 msgid "Main Settings" 119 140 msgstr "" 120 141 121 #: templates/admin-page-options.php:84 142 #: templates/admin-page-options.php:102 templates/admin-page-options.php:108 143 msgid "Menu Sorting" 144 msgstr "" 145 146 #: templates/admin-page-options.php:119 147 msgid "Enable drag-and-drop menu reordering" 148 msgstr "" 149 150 #: templates/admin-page-options.php:128 151 msgid "Drag the handle icon on the right side of menu items to reorder them." 152 msgstr "" 153 154 #: templates/admin-page-options.php:131 155 msgid "Note:" 156 msgstr "" 157 158 #: templates/admin-page-options.php:132 159 msgid "" 160 "your custom order is preserved even when this option is disabled. Use " 161 "\"Reset menu order\" to restore the default order." 162 msgstr "" 163 164 #: templates/admin-page-options.php:135 templates/admin-page-options.php:179 165 #: templates/admin-page-options.php:224 166 msgid "Experimental" 167 msgstr "" 168 169 #: templates/admin-page-options.php:138 170 msgid "Reset menu order" 171 msgstr "" 172 173 #: templates/admin-page-options.php:150 templates/admin-page-options.php:156 174 msgid "Sidebar Width" 175 msgstr "" 176 177 #: templates/admin-page-options.php:167 178 msgid "Enable sidebar width resize" 179 msgstr "" 180 181 #: templates/admin-page-options.php:176 182 msgid "Drag the right edge of the sidebar to adjust the menu width." 183 msgstr "" 184 185 #: templates/admin-page-options.php:182 186 msgid "Reset sidebar width" 187 msgstr "" 188 189 #: templates/admin-page-options.php:194 templates/admin-page-options.php:200 190 msgid "Menu Separators" 191 msgstr "" 192 193 #: templates/admin-page-options.php:221 194 msgid "" 195 "Control the visibility of separator lines between menu groups in the admin " 196 "sidebar." 197 msgstr "" 198 199 #: templates/admin-page-options.php:234 122 200 msgid "Save Settings" 123 201 msgstr "" 124 202 125 #: templates/admin-page-options.php: 94203 #: templates/admin-page-options.php:246 126 204 msgid "Message From the Author" 127 205 msgstr "" 128 206 129 #: templates/admin-page-options.php: 98207 #: templates/admin-page-options.php:250 130 208 msgid "" 131 209 "Thank you for using Easy Hide Admin Menu Items! Your feedback and comments " 132 "are highly valuable to us and will assist us in improving the plugin further." 133 msgstr "" 134 135 #: templates/admin-page-options.php:108 210 "are highly valuable to us and will assist us in improving the plugin " 211 "further." 212 msgstr "" 213 214 #: templates/admin-page-options.php:260 136 215 msgid "" 137 216 "For support, please contact our helpdesk. If you encounter any issues or " … … 139 218 msgstr "" 140 219 141 #: templates/admin-page-options.php: 109220 #: templates/admin-page-options.php:261 142 221 msgid "contact us here" 143 222 msgstr "" 144 223 145 #: templates/admin-page-options.php: 121224 #: templates/admin-page-options.php:273 146 225 msgid "" 147 226 "Please consider leaving a review for our plugin. Your reviews help us " … … 149 228 msgstr "" 150 229 151 #: templates/admin-page-options.php: 123230 #: templates/admin-page-options.php:275 152 231 msgid "Leave a review" 153 232 msgstr "" -
easy-hide-admin-menu-items/trunk/readme.txt
r3474229 r3783089 5 5 Requires at least: 5.9.0 6 6 Tested up to: 6.9 7 Stable tag: 1. 3.97 Stable tag: 1.4.0 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 40 40 41 41 Enhance your WordPress admin panel experience by effortlessly managing menu items and optimizing the interface according to your specific needs. Experience a clutter-free and user-friendly environment with Easy Hide Admin Menu Items. 42 43 ### Experimental Features in 1.4.0 44 45 These features are available under Appearance → Admin Menu Settings. They are marked as experimental and your feedback is welcome. 46 47 * **Menu Sorting:** Drag-and-drop reordering of admin menu items. A handle icon appears on hover — grab it to move items up or down. Your custom order is saved per user or globally depending on your settings. Disabling this option preserves your saved order. 48 * **Menu Separators:** Control the visibility of separator lines between menu groups. Choose to hide them completely or highlight them for better visual separation. 49 * **Sidebar Width:** Resize the expanded desktop menu by dragging its edge or using the width slider. The standard folded and mobile layouts are preserved. 42 50 43 51 == Frequently Asked Questions == … … 76 84 == Screenshots == 77 85 78 1. Hide unnecessary main menus effortlessly with our plugin 79 2. Activate child menu hiding 80 3. Explore and customize your preferences with easy-to-use plugin settings 81 4. Experience a user-friendly admin panel with our plugin's sleek design 86 1. A cleaner WordPress admin menu with hidden entries available from the toolbar. 87 2. Use the eye icon beside a main menu item to hide it. 88 3. Hide a submenu entry without hiding its parent menu. 89 4. Admin Menu Settings lets you switch between shared and personal preferences. 90 5. Experimental sorting lets you reorder menu items by dragging their handles. 91 6. Experimental sidebar resizing saves the width of the expanded desktop menu. 92 7. Experimental separator controls highlight or hide the boundaries between menu groups. 82 93 83 94 == Changelog == 95 96 = 1.4.0 = 97 - Added experimental drag-and-drop sorting for the WordPress admin menu. 98 - Added experimental sidebar resizing for the expanded desktop menu. 99 - Added experimental controls to hide or highlight menu separators. 100 - Added Slovak localization and updated Russian translations. 101 - Restricted shared menu changes to users with the manage_options capability. 102 - Kept personal menu visibility, order, and width separate between users. 103 - Fixed saved sidebar widths overriding the folded and mobile layouts. 104 - Aligned the icons in the review notice buttons. 105 - Updated the WordPress.org gallery with seven screenshots. 106 - Restored PHP 7.0 compatibility and corrected the review AJAX callbacks. 84 107 85 108 = 1.3.9 = -
easy-hide-admin-menu-items/trunk/src/Ajax.php
r3474229 r3783089 13 13 add_action( 'wp_ajax_ehami_remove_item', [ $this, 'action_remove_item_from_db' ] ); 14 14 add_action( 'wp_ajax_ehami_hide_icons_disable', [ $this, 'action_hide_icons_disable' ] ); 15 add_action( 'wp_ajax_ehami_save_menu_order', [ $this, 'action_save_menu_order' ] ); 16 add_action( 'wp_ajax_ehami_reset_menu_order', [ $this, 'action_reset_menu_order' ] ); 17 add_action( 'wp_ajax_ehami_save_sidebar_width', [ $this, 'action_save_sidebar_width' ] ); 18 add_action( 'wp_ajax_ehami_reset_sidebar_width', [ $this, 'action_reset_sidebar_width' ] ); 15 19 } 16 20 … … 19 23 check_ajax_referer( self::NONCE_KEY ); 20 24 21 if ( ! current_user_can( 'read' ) ) {22 wp_die( 23 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),25 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 26 wp_die( 27 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 24 28 403 25 29 ); … … 38 42 if ( ! current_user_can( 'manage_options' ) ) { 39 43 wp_die( 40 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),41 403 42 ); 43 } 44 45 plugin()->settings->save_options([44 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 45 403 46 ); 47 } 48 49 $options = [ 46 50 'save_individually' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['save_individually'] ?? false ) ), 47 51 'hide_submenu' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_submenu'] ?? false ) ), 48 52 'remove_all_data_on_uninstall' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['remove_all_data_on_uninstall'] ?? false ) ), 49 ] ); 53 'enable_menu_sorting' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['enable_menu_sorting'] ?? false ) ), 54 'enable_sidebar_resize' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['enable_sidebar_resize'] ?? false ) ), 55 ]; 56 57 if ( isset( $_POST['options']['separators_mode'] ) ) { 58 $options['separators_mode'] = sanitize_text_field( wp_unslash( $_POST['options']['separators_mode'] ) ); 59 } 60 61 plugin()->settings->save_options( $options ); 50 62 51 63 wp_die(); … … 55 67 check_ajax_referer( self::NONCE_KEY ); 56 68 57 if ( ! current_user_can( 'read' ) ) {58 wp_die( 59 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),69 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 70 wp_die( 71 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 60 72 403 61 73 ); … … 75 87 check_ajax_referer( self::NONCE_KEY ); 76 88 77 if ( ! current_user_can( 'read' ) ) {78 wp_die( 79 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ),89 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 90 wp_die( 91 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 80 92 403 81 93 ); … … 94 106 check_ajax_referer( self::NONCE_KEY ); 95 107 96 if ( ! current_user_can( 'read' ) ) { 97 wp_die( 98 esc_html__( 'Sorry, you are not allowed to manage options for this site.' ), 99 403 100 ); 101 } 102 103 plugin()->settings->save_options( [ 104 'hide_icons_disable' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_icons_disable'] ?? false ) ) 105 ] ); 106 107 wp_die(); 108 } 109 108 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 109 wp_die( 110 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 111 403 112 ); 113 } 114 115 plugin()->settings->save_options( [ 116 'hide_icons_disable' => (bool) sanitize_text_field( wp_unslash( $_POST['options']['hide_icons_disable'] ?? false ) ), 117 ] ); 118 119 wp_die(); 120 } 121 122 /** 123 * Save menu order via AJAX (called on drag-and-drop end). 124 * 125 * @since 1.4.0 126 */ 127 public function action_save_menu_order() { 128 check_ajax_referer( self::NONCE_KEY ); 129 130 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 131 wp_die( 132 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 133 403 134 ); 135 } 136 137 // Each selector and position is sanitized separately below. 138 $order = isset( $_POST['order'] ) && is_array( $_POST['order'] ) ? wp_unslash( $_POST['order'] ) : []; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 139 140 $sanitized = []; 141 foreach ( $order as $selector => $position ) { 142 $sanitized[ sanitize_text_field( $selector ) ] = absint( $position ); 143 } 144 145 plugin()->settings->save_options( [ 146 'menu_order' => $sanitized, 147 ] ); 148 149 wp_die(); 150 } 151 152 /** 153 * Reset menu order to default (called from settings page). 154 * 155 * @since 1.4.0 156 */ 157 public function action_reset_menu_order() { 158 check_ajax_referer( self::NONCE_KEY ); 159 160 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 161 wp_die( 162 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 163 403 164 ); 165 } 166 167 plugin()->settings->save_options( [ 168 'menu_order' => [], 169 ] ); 170 171 wp_send_json_success(); 172 } 173 174 /** 175 * Save sidebar width via AJAX (called on resize end or range change). 176 * 177 * @since 1.4.0 178 */ 179 public function action_save_sidebar_width() { 180 check_ajax_referer( self::NONCE_KEY ); 181 182 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 183 wp_die( 184 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 185 403 186 ); 187 } 188 189 $width = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 0; 190 191 plugin()->settings->save_options( [ 192 'sidebar_width' => $width, 193 ] ); 194 195 wp_die(); 196 } 197 198 /** 199 * Reset sidebar width to default (called from settings page). 200 * 201 * @since 1.4.0 202 */ 203 public function action_reset_sidebar_width() { 204 check_ajax_referer( self::NONCE_KEY ); 205 206 if ( ! current_user_can( plugin()->settings->save_individually ? 'read' : 'manage_options' ) ) { 207 wp_die( 208 esc_html__( 'Sorry, you are not allowed to manage options for this site.', 'ehami' ), 209 403 210 ); 211 } 212 213 plugin()->settings->save_options( [ 214 'sidebar_width' => 0, 215 ] ); 216 217 wp_send_json_success(); 218 } 110 219 } -
easy-hide-admin-menu-items/trunk/src/Assets.php
r3474229 r3783089 10 10 11 11 public function enqueue_assets() { 12 wp_enqueue_style( 'ehami-style', plugin()->url . '/assets/css/style.css', [], plugin()->info['version'] ); 12 $version = plugin()->info['version']; 13 $url = plugin()->url; 14 15 wp_enqueue_style( 'ehami-style', $url . '/assets/css/style.css', [], $version ); 13 16 $this->add_inline_style( 'ehami-style' ); 14 17 15 /** 16 * Load the user interface script only if the 'save_individually' option is set to true in the global settings, 17 * or if the current user is an administrator. 18 */ 19 if ( true === plugin()->settings->save_individually || current_user_can( 'administrator' ) ) { 18 // SortableJS — loaded separately because it's a vendor library. 19 wp_enqueue_script( 'sortablejs', $url . '/assets/js/vendor/Sortable.min.js', [], '1.15.7', true ); 20 20 21 wp_enqueue_script( 22 'ehami-user-interface', 23 plugin()->url . '/assets/js/user-interface.js', 24 [ 25 'jquery', 26 'jquery-effects-transfer', 27 ], 28 plugin()->info['version'], 29 true 30 ); 21 // Main script — all EHAMI modules in one file. 22 wp_enqueue_script( 'ehami', $url . '/assets/js/ehami.js', [ 'sortablejs' ], $version, true ); 23 wp_add_inline_script( 'ehami', 'var ehami = ' . wp_json_encode( $this->get_script_data() ), 'before' ); 24 } 31 25 32 } 33 34 wp_enqueue_script( 'ehami-settings-page', plugin()->url . '/assets/js/settings-page.js', [ 'jquery' ], plugin()->info['version'], true ); 35 $data = [ 36 'nonce' => wp_create_nonce( 'ehami-nonce' ), 37 'no_items' => __( 'No hidden menu items', 'ehami' ), 38 'hid' => __( 'Hide menu', 'ehami' ), 39 'count_items' => count( plugin()->settings->items ), 40 'hide_submenu' => plugin()->settings->hide_submenu, 26 /** 27 * Build the data object passed to all JS modules via the `ehami` global. 28 * 29 * @return array 30 */ 31 private function get_script_data(): array { 32 return [ 33 'nonce' => wp_create_nonce( 'ehami-nonce' ), 34 'no_items' => __( 'No hidden menu items', 'ehami' ), 35 'hid' => __( 'Hide menu', 'ehami' ), 36 'count_items' => count( plugin()->settings->items ), 37 'hide_submenu' => plugin()->settings->hide_submenu, 38 'saved' => __( 'Settings saved.', 'ehami' ), 39 'save_error' => __( 'Error saving settings.', 'ehami' ), 40 'enable_menu_sorting' => plugin()->settings->enable_menu_sorting, 41 'can_customize' => plugin()->settings->save_individually || current_user_can( 'manage_options' ), 42 'menu_order' => plugin()->settings->menu_order, 43 'enable_sidebar_resize' => plugin()->settings->enable_sidebar_resize, 44 'sidebar_width' => plugin()->settings->sidebar_width, 45 'video_url' => plugin()->url . '/assets/mp4/', 41 46 ]; 42 wp_add_inline_script( 'ehami-user-interface', 'const ehami = ' . wp_json_encode( $data ), 'before' );43 47 } 44 48 45 49 public function add_inline_style( string $handle ) { 50 $css = ''; 51 52 // Hidden menu items. 46 53 $items = plugin()->settings->items; 47 48 if ( ! $items ) { 49 return; 54 if ( $items ) { 55 foreach ( $items as $id => $text ) { 56 if ( strpos( $id, '.php' ) !== false ) { 57 // for submenu items 58 $css .= sprintf( '.ehami-enable #adminmenu .wp-submenu a[href="%s"] { display: none; }', esc_attr( $id ) ); 59 } elseif ( strpos( $id, '#' ) !== false ) { 60 // for parent menu items 61 $css .= sprintf( '.ehami-enable #adminmenu %s { display: none; }', esc_attr( $id ) ); 62 } 63 } 50 64 } 51 65 52 $css = ''; 53 foreach ( $items as $id => $text ) { 54 if ( str_contains( $id, '.php' ) ) { 55 // for submenu items 56 $css .= sprintf( '.ehami-enable #adminmenu .wp-submenu a[href="%s"] { display: none; }', esc_attr( $id ) ); 57 } elseif ( str_contains( $id, '#' ) ) { 58 // for parent menu items 59 $css .= sprintf( '.ehami-enable #adminmenu %s { display: none; }', esc_attr( $id ) ); 60 } 66 // Sidebar width override. 67 // Apply only to the expanded desktop menu; WordPress folds it on narrower screens. 68 $sidebar_width = plugin()->settings->sidebar_width; 69 if ( plugin()->settings->enable_sidebar_resize && $sidebar_width > 0 ) { 70 $w = (int) $sidebar_width; 71 $css .= sprintf( 72 '@media (min-width: 961px) {' . 73 'body:not(.folded) #adminmenuwrap, body:not(.folded) #adminmenuback, body:not(.folded) #adminmenu { width: %1$dpx; }' . 74 'body:not(.folded) #wpcontent, body:not(.folded) #wpfooter { margin-left: %1$dpx; }' . 75 'body:not(.folded) #adminmenu .wp-not-current-submenu .wp-submenu { left: %1$dpx; }' . 76 'body:not(.folded) #adminmenu .wp-has-current-submenu .wp-submenu { width: 100%%; }' . 77 '}', 78 $w 79 ); 61 80 } 62 wp_add_inline_style( $handle, $css ); 81 82 // Separators mode. 83 $separators_mode = plugin()->settings->separators_mode; 84 if ( $separators_mode === 'hidden' ) { 85 $css .= '#adminmenu li.wp-menu-separator { display: none; }'; 86 } elseif ( $separators_mode === 'highlight' ) { 87 $css .= '#adminmenu li.wp-menu-separator { height: auto; margin: 0; }'; 88 $css .= '#adminmenu li.wp-menu-separator > .separator { height: 2px; margin: 8px 12px; background: rgba(255,255,255,0.08); border: none; }'; 89 } 90 91 if ( $css ) { 92 wp_add_inline_style( $handle, $css ); 93 } 63 94 } 64 65 95 } -
easy-hide-admin-menu-items/trunk/src/Review.php
r3474229 r3783089 21 21 22 22 // Check if the condition is met before adding hooks. 23 if ( is_array( $ehami_data_install ) && strtotime( gmdate( 'Y-m-d' ) ) >= strtotime( $ehami_data_install['date'] ) ) {23 if ( is_array( $ehami_data_install ) && isset( $ehami_data_install['date'] ) && strtotime( gmdate( 'Y-m-d' ) ) >= strtotime( $ehami_data_install['date'] ) ) { 24 24 add_action( 'admin_head', [ $this, 'add_admin_inline_style' ] ); 25 25 add_action( 'admin_footer', [ $this, 'add_admin_footer_script' ] ); … … 61 61 gap: 5px; 62 62 } 63 64 .wp-core-ui .button.ehami_review__link .dashicons { 65 line-height: 1; 66 } 63 67 </style> 64 68 <?php … … 147 151 148 152 <img class="ehami_review__img" 149 src="https://ps.w.org/easy-hide-admin-menu-items/assets/icon-128x128.png" alt="">153 src="https://ps.w.org/easy-hide-admin-menu-items/assets/icon-128x128.png" alt=""> 150 154 151 155 </div> … … 185 189 186 190 <a id="ehami_leave_feedback" class="button button-primary ehami_review__link" 187 href="https://wordpress.org/support/plugin/easy-hide-admin-menu-items/reviews/#new-post"188 target="_blank">191 href="https://wordpress.org/support/plugin/easy-hide-admin-menu-items/reviews/#new-post" 192 target="_blank"> 189 193 190 194 <?php echo esc_html__( 'Leave feedback', 'ehami' ); ?> … … 233 237 public function leave_feedback_ajax_callback() { 234 238 $this->review_ajax_callback( 'feedback_submitted', '+5 years' ); 235 wp_die();236 239 } 237 240 … … 241 244 public function remind_ajax_callback() { 242 245 $this->review_ajax_callback( 'remind_submitted', '+1 days' ); 243 wp_die();244 246 } 245 247 … … 249 251 public function already_ajax_callback() { 250 252 $this->review_ajax_callback( 'already_submitted', '+4 years' ); 251 wp_die();252 253 } 253 254 } -
easy-hide-admin-menu-items/trunk/src/Settings.php
r3474229 r3783089 4 4 5 5 /** 6 * @property-read array $items 7 * @property-read bool $status 8 * @property-read bool $save_individually 9 * @property-read bool $hide_submenu 10 * @property-read bool $remove_all_data_on_uninstall 11 * @property-read bool $hide_icons_disable 6 * @property-read array $items 7 * @property-read bool $status 8 * @property-read bool $save_individually 9 * @property-read bool $hide_submenu 10 * @property-read bool $remove_all_data_on_uninstall 11 * @property-read bool $hide_icons_disable 12 * @property-read string $separators_mode 13 * @property-read bool $enable_menu_sorting 14 * @property-read array $menu_order 15 * @property-read bool $enable_sidebar_resize 16 * @property-read int $sidebar_width 12 17 */ 13 18 class Settings { … … 23 28 'remove_all_data_on_uninstall' => false, 24 29 'hide_icons_disable' => false, 30 // Experimental features. 31 'enable_menu_sorting' => false, 32 'menu_order' => [], 33 'separators_mode' => 'default', 34 'enable_sidebar_resize' => false, 35 'sidebar_width' => 0, 25 36 ]; 26 37 … … 38 49 39 50 if ( $this->options['save_individually'] ) { 51 if ( metadata_exists( 'user', get_current_user_id(), 'ehami_user_status' ) ) { 52 $this->options['status'] = (bool) get_user_meta( get_current_user_id(), 'ehami_user_status', true ); 53 } 40 54 $this->options['items'] = get_user_meta( get_current_user_id(), self::USER_ITEMS_META_KEY, true ) ?: []; 41 55 $this->options['hide_icons_disable'] = get_user_meta( get_current_user_id(), 'hide_icons_disable', true ) ?: false; 56 $this->options['menu_order'] = get_user_meta( get_current_user_id(), 'ehami_user_menu_order', true ) ?: []; 57 $this->options['sidebar_width'] = (int) get_user_meta( get_current_user_id(), 'ehami_sidebar_width', true ); 42 58 } 43 59 } … … 50 66 $options = $this->sanitize_options( $new_options ); 51 67 52 update_option( self::OPTION_NAME, $options, false ); 68 if ( $options['save_individually'] ) { 69 $global_options = array_merge( self::DEFAULT_OPTIONS, $this->get_db_options() ); 70 $personal_keys = [ 71 'status' => 'ehami_user_status', 72 'items' => self::USER_ITEMS_META_KEY, 73 'hide_icons_disable' => 'hide_icons_disable', 74 'menu_order' => 'ehami_user_menu_order', 75 'sidebar_width' => 'ehami_sidebar_width', 76 ]; 53 77 54 if ( $options['save_individually'] && array_key_exists( 'hide_icons_disable', $options ) ) { 55 update_user_meta( get_current_user_id(), 'hide_icons_disable', $options['hide_icons_disable'] ); 78 foreach ( $personal_keys as $key => $meta_key ) { 79 if ( isset( $new_options[ $key ] ) && ( ! is_array( self::DEFAULT_OPTIONS[ $key ] ) || is_array( $new_options[ $key ] ) ) ) { 80 $value = $key === 'items' ? wp_slash( $options[ $key ] ) : $options[ $key ]; 81 update_user_meta( get_current_user_id(), $meta_key, $value ); 82 } 83 84 $options[ $key ] = $global_options[ $key ]; 85 } 56 86 } 57 87 58 if ( $options['save_individually'] && array_key_exists( 'items', $options ) ) { 59 update_user_meta( get_current_user_id(), self::USER_ITEMS_META_KEY, wp_slash( $options['items'] ) ); 60 } 61 88 update_option( self::OPTION_NAME, $options, false ); 62 89 } 63 90 … … 87 114 if ( isset( $new_options['items'] ) && is_array( $new_options['items'] ) ) { 88 115 $options['items'] = array_map( 'sanitize_text_field', $new_options['items'] ); 116 } 117 118 if ( isset( $new_options['enable_menu_sorting'] ) ) { 119 $options['enable_menu_sorting'] = (bool) $new_options['enable_menu_sorting']; 120 } 121 122 if ( isset( $new_options['menu_order'] ) && is_array( $new_options['menu_order'] ) ) { 123 $sanitized_order = []; 124 foreach ( $new_options['menu_order'] as $selector => $position ) { 125 $sanitized_order[ sanitize_text_field( $selector ) ] = absint( $position ); 126 } 127 $options['menu_order'] = $sanitized_order; 128 } 129 130 if ( isset( $new_options['separators_mode'] ) ) { 131 $allowed_modes = [ 'default', 'hidden', 'highlight' ]; 132 $mode = sanitize_text_field( $new_options['separators_mode'] ); 133 $options['separators_mode'] = in_array( $mode, $allowed_modes, true ) ? $mode : 'default'; 134 } 135 136 if ( isset( $new_options['enable_sidebar_resize'] ) ) { 137 $options['enable_sidebar_resize'] = (bool) $new_options['enable_sidebar_resize']; 138 } 139 140 if ( isset( $new_options['sidebar_width'] ) ) { 141 $width = absint( $new_options['sidebar_width'] ); 142 // Clamp to valid range: 0 (default/unset), or 160–480. 143 if ( $width > 0 ) { 144 $width = max( 160, min( 480, $width ) ); 145 } 146 $options['sidebar_width'] = $width; 89 147 } 90 148 … … 119 177 return ! is_null( $this->{$name} ); 120 178 } 121 122 179 } -
easy-hide-admin-menu-items/trunk/src/Settings_Page.php
r3474229 r3783089 41 41 return $actions; 42 42 } 43 44 43 } -
easy-hide-admin-menu-items/trunk/src/Switcher.php
r3474229 r3783089 13 13 * If the condition is met, or if the current user is an administrator, initialize the user interface. 14 14 */ 15 if ( true === plugin()->settings->save_individually || current_user_can( 'administrator' ) ) {15 if ( plugin()->settings->save_individually || current_user_can( 'manage_options' ) ) { 16 16 add_action( 'admin_bar_menu', [ $this, 'add_to_admin_bar' ] ); 17 17 } … … 39 39 return plugin()->settings->status ? $classes . ' ehami-enable' : $classes; 40 40 } 41 42 41 } -
easy-hide-admin-menu-items/trunk/src/Uninstall.php
r3474229 r3783089 43 43 44 44 private function delete_users_options( $blog_id ) { 45 $meta_key = $this->settings::USER_ITEMS_META_KEY; 45 $meta_keys = [ 46 $this->settings::USER_ITEMS_META_KEY, 47 'hide_icons_disable', 48 'ehami_user_status', 49 'ehami_user_menu_order', 50 'ehami_sidebar_width', 51 ]; 46 52 47 $user_ids = get_users( 48 [ 49 'blog_id' => $blog_id, 50 'fields' => 'ID', 51 'meta_key' => $meta_key, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key 52 'meta_compare' => 'EXISTS', 53 ] 54 ); 53 foreach ( $meta_keys as $meta_key ) { 54 $user_ids = get_users( 55 [ 56 'blog_id' => $blog_id, 57 'fields' => 'ID', 58 'meta_key' => $meta_key, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key 59 'meta_compare' => 'EXISTS', 60 ] 61 ); 55 62 56 foreach ( $user_ids as $user_id ) { 57 delete_user_meta( $user_id, $meta_key ); 63 foreach ( $user_ids as $user_id ) { 64 delete_user_meta( $user_id, $meta_key ); 65 } 58 66 } 59 67 } -
easy-hide-admin-menu-items/trunk/templates/admin-page-options.php
r3474229 r3783089 19 19 'description' => __( 'Allow hiding child admin menus', 'ehami' ), 20 20 'help' => __( 'If checked, you can hide the child menu. This may be useful when there are too many child menus causing distraction.', 'ehami' ), 21 'video' => 'child-menu', 21 22 ], 22 23 [ … … 28 29 'help' => __( 'If checked, all data (option and user metadata) will be deleted when the plugin is deleted.', 'ehami' ), 29 30 ], 31 ]; 32 33 $current_separators_mode = plugin()->settings->separators_mode; 34 $separators_options = [ 35 'default' => __( 'No changes (default)', 'ehami' ), 36 'hidden' => __( 'Hide all separators', 'ehami' ), 37 'highlight' => __( 'Highlight separators', 'ehami' ), 30 38 ]; 31 39 ?> … … 70 78 <?php echo esc_html( $field['description'] ); ?> 71 79 </label> 80 <?php if ( ! empty( $field['video'] ) ) : ?> 81 <span class="ehami-video-hint" data-video="<?php echo esc_attr( $field['video'] ); ?>"> 82 <span class="dashicons dashicons-video-alt3"></span> 83 </span> 84 <?php endif; ?> 72 85 </div> 73 86 … … 79 92 </tr> 80 93 <?php } ?> 94 95 <!-- Experimental: Menu Sorting --> 96 <tr class="ehami-settings__separator-row"> 97 <td colspan="2"><hr></td> 98 </tr> 99 <tr> 100 <th scope="row"> 101 <label for="ehami_enable_menu_sorting"> 102 <?php esc_html_e( 'Menu Sorting', 'ehami' ); ?> 103 </label> 104 </th> 105 <td> 106 <fieldset class="ehami-settings__main-fieldset"> 107 <legend class="screen-reader-text"> 108 <span><?php esc_html_e( 'Menu Sorting', 'ehami' ); ?></span> 109 </legend> 110 111 <div class="ehami-settings__main-field"> 112 <label for="ehami_enable_menu_sorting"> 113 <input 114 type="checkbox" 115 id="ehami_enable_menu_sorting" 116 name="enable_menu_sorting" 117 value="1" <?php checked( plugin()->settings->enable_menu_sorting, true ); ?> 118 > 119 <?php esc_html_e( 'Enable drag-and-drop menu reordering', 'ehami' ); ?> 120 </label> 121 <span class="ehami-video-hint" data-video="menu-sorting"> 122 <span class="dashicons dashicons-video-alt3"></span> 123 </span> 124 </div> 125 126 <div class="ehami-settings__main-field-description"> 127 <p class="description"> 128 <?php esc_html_e( 'Drag the handle icon on the right side of menu items to reorder them.', 'ehami' ); ?> 129 </p> 130 <p class="description"> 131 <strong><?php esc_html_e( 'Note:', 'ehami' ); ?></strong> 132 <?php esc_html_e( 'your custom order is preserved even when this option is disabled. Use "Reset menu order" to restore the default order.', 'ehami' ); ?> 133 </p> 134 <p class="ehami-settings__experimental-badge"> 135 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 136 <a href="#" id="ehami-reset-menu-order" class="ehami-reset-link"> 137 <span class="dashicons dashicons-image-rotate"></span> 138 <?php esc_html_e( 'Reset menu order', 'ehami' ); ?> 139 </a> 140 </p> 141 </div> 142 </fieldset> 143 </td> 144 </tr> 145 146 <!-- Experimental: Sidebar Width --> 147 <tr> 148 <th scope="row"> 149 <label for="ehami_enable_sidebar_resize"> 150 <?php esc_html_e( 'Sidebar Width', 'ehami' ); ?> 151 </label> 152 </th> 153 <td> 154 <fieldset class="ehami-settings__main-fieldset"> 155 <legend class="screen-reader-text"> 156 <span><?php esc_html_e( 'Sidebar Width', 'ehami' ); ?></span> 157 </legend> 158 159 <div class="ehami-settings__main-field"> 160 <label for="ehami_enable_sidebar_resize"> 161 <input 162 type="checkbox" 163 id="ehami_enable_sidebar_resize" 164 name="enable_sidebar_resize" 165 value="1" <?php checked( plugin()->settings->enable_sidebar_resize, true ); ?> 166 > 167 <?php esc_html_e( 'Enable sidebar width resize', 'ehami' ); ?> 168 </label> 169 <span class="ehami-video-hint" data-video="sidebar-width"> 170 <span class="dashicons dashicons-video-alt3"></span> 171 </span> 172 </div> 173 174 <div class="ehami-settings__main-field-description"> 175 <p class="description"> 176 <?php esc_html_e( 'Drag the right edge of the sidebar to adjust the menu width.', 'ehami' ); ?> 177 </p> 178 <p class="ehami-settings__experimental-badge"> 179 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 180 <a href="#" id="ehami-reset-sidebar-width" class="ehami-reset-link"> 181 <span class="dashicons dashicons-image-rotate"></span> 182 <?php esc_html_e( 'Reset sidebar width', 'ehami' ); ?> 183 </a> 184 </p> 185 </div> 186 </fieldset> 187 </td> 188 </tr> 189 190 <!-- Experimental: Separators --> 191 <tr> 192 <th scope="row"> 193 <label for="ehami_separators_mode"> 194 <?php esc_html_e( 'Menu Separators', 'ehami' ); ?> 195 </label> 196 </th> 197 <td> 198 <fieldset class="ehami-settings__main-fieldset"> 199 <legend class="screen-reader-text"> 200 <span><?php esc_html_e( 'Menu Separators', 'ehami' ); ?></span> 201 </legend> 202 203 <div class="ehami-settings__main-field"> 204 <select id="ehami_separators_mode" name="separators_mode"> 205 <?php foreach ( $separators_options as $value => $label ) : ?> 206 <option 207 value="<?php echo esc_attr( $value ); ?>" 208 <?php selected( $current_separators_mode, $value ); ?> 209 > 210 <?php echo esc_html( $label ); ?> 211 </option> 212 <?php endforeach; ?> 213 </select> 214 <span class="ehami-video-hint" data-video="separators"> 215 <span class="dashicons dashicons-video-alt3"></span> 216 </span> 217 </div> 218 219 <div class="ehami-settings__main-field-description"> 220 <p class="description"> 221 <?php esc_html_e( 'Control the visibility of separator lines between menu groups in the admin sidebar.', 'ehami' ); ?> 222 </p> 223 <p class="ehami-settings__experimental-badge"> 224 <span class="ehami-badge ehami-badge--experimental"><?php esc_html_e( 'Experimental', 'ehami' ); ?></span> 225 </p> 226 </div> 227 </fieldset> 228 </td> 229 </tr> 81 230 </tbody> 82 231 </table> 83 232 84 <?php submit_button( esc_html__( 'Save Settings', 'ehami' ), 'primary', 'submit_ehami_settings' ); ?> 233 <div class="ehami-save-row"> 234 <?php submit_button( esc_html__( 'Save Settings', 'ehami' ), 'primary', 'submit_ehami_settings', false ); ?> 235 <span class="ehami-inline-notice" aria-live="polite"></span> 236 </div> 85 237 </div> 86 238 … … 90 242 </div> 91 243 92 <!-- Added a block for the author's message -->244 <!-- Added a block for the author's message --> 93 245 <div id="ehami-author-info" class="stuffbox ehami-settings__author"> 94 246 <h2 class="ehami-settings__author-title"><?php esc_html_e( 'Message From the Author', 'ehami' ); ?></h2> -
easy-hide-admin-menu-items/trunk/templates/switcher.php
r3474229 r3783089 30 30 <div class="ehami-block-checkbox"> 31 31 <input type="checkbox" 32 id="hide-icons-checkbox"33 name="hide_icons_disable"32 id="hide-icons-checkbox" 33 name="hide_icons_disable" 34 34 <?php echo $hide_icons_disable ? 'checked' : ''; ?> 35 35 />
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)