Changeset 62288 for trunk/src/wp-includes/class-wp-connector-registry.php
- Timestamp:
- 04/30/2026 12:16:22 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-connector-registry.php
r62210 r62288 41 41 * }, 42 42 * plugin?: array{ 43 * file: non-empty-string 43 * file: non-empty-string, 44 * is_active?: callable(): bool 44 45 * } 45 46 * } … … 110 111 * Optional. Plugin data for install/activate UI. 111 112 * 112 * @type string $file The plugin's main file path relative to the plugins 113 * directory (e.g. 'my-plugin/my-plugin.php' or 'hello.php'). 113 * @type string $file Optional. The plugin's main file path relative to the 114 * plugins directory (e.g. 'my-plugin/my-plugin.php' or 115 * 'hello.php'). 116 * @type callable $is_active Optional callback to determine whether the plugin 117 * is active. Receives no arguments and must return bool. 118 * Defaults to `__return_true`. 114 119 * } 115 120 * } … … 244 249 } 245 250 246 if ( ! empty( $args['plugin'] ) && is_array( $args['plugin'] ) && ! empty( $args['plugin']['file'] ) ) { 247 $connector['plugin'] = array( 'file' => $args['plugin']['file'] ); 251 $connector['plugin'] = array(); 252 253 if ( ! empty( $args['plugin'] ) && is_array( $args['plugin'] ) ) { 254 if ( ! empty( $args['plugin']['file'] ) ) { 255 $connector['plugin']['file'] = $args['plugin']['file']; 256 } 257 258 if ( isset( $args['plugin']['is_active'] ) ) { 259 if ( ! is_callable( $args['plugin']['is_active'] ) ) { 260 _doing_it_wrong( 261 __METHOD__, 262 /* translators: %s: Connector ID. */ 263 sprintf( __( 'Connector "%s" plugin is_active must be callable.' ), esc_html( $id ) ), 264 '7.0.0' 265 ); 266 return null; 267 } 268 269 $connector['plugin']['is_active'] = $args['plugin']['is_active']; 270 } 271 } 272 273 if ( ! isset( $connector['plugin']['is_active'] ) ) { 274 $connector['plugin']['is_active'] = '__return_true'; 248 275 } 249 276
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)