@@ -63,6 +63,17 @@ public static function load_textdomain() {
6363 private function define_constants () {
6464 define ( 'NEWSPACK_VERSION ' , '0.0.1 ' );
6565 define ( 'NEWSPACK_ABSPATH ' , dirname ( NEWSPACK_PLUGIN_FILE ) . '/ ' );
66+ /**
67+ * Path to Composer's vendor directory. Override to use a shared vendor directory
68+ * across multiple plugins.
69+ *
70+ * @constant NEWSPACK_COMPOSER_ABSPATH
71+ * @type string
72+ * @default Plugin's vendor/ directory
73+ * @status draft
74+ *
75+ * @example define( 'NEWSPACK_COMPOSER_ABSPATH', '/path/to/shared/vendor/' );
76+ */
6677 if ( ! defined ( 'NEWSPACK_COMPOSER_ABSPATH ' ) ) {
6778 define ( 'NEWSPACK_COMPOSER_ABSPATH ' , dirname ( NEWSPACK_PLUGIN_FILE ) . '/vendor/ ' );
6879 }
@@ -331,6 +342,18 @@ public function deactivation_hook() {
331342 * @param WP_Screen $current_screen Current WP_Screen object.
332343 */
333344 public static function restrict_user_access ( $ current_screen ) {
345+ /**
346+ * Array of user IDs allowed to access plugin management screens
347+ * (plugins, plugin-install, plugin-editor). When defined, only listed
348+ * users can access these screens; others are redirected to the dashboard.
349+ *
350+ * @constant NEWSPACK_ALLOWED_PLUGIN_EDITORS
351+ * @type array
352+ * @default All users with appropriate capabilities can access plugin screens
353+ * @status draft
354+ *
355+ * @example define( 'NEWSPACK_ALLOWED_PLUGIN_EDITORS', [ 1, 2, 3 ] );
356+ */
334357 if ( ! defined ( 'NEWSPACK_ALLOWED_PLUGIN_EDITORS ' ) ) {
335358 return ;
336359 }
0 commit comments