WordPress.org

Support

Support » Multisite » Why can't i install plugins in subfolder in mu-plugins???

Why can't i install plugins in subfolder in mu-plugins???

  • Hi,

    I notice you can’t install a mu plugin just by unzipping it and uploading the folder in mu-plugins. It only works when i upload the files directly in folder mu-plugins, am i correct?

    Is there a way to upload in subfolders so it’s more structered??

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t know why it is, only that it is.

    Beside the folder inside “mu-plugins” stick a file with something like the following:

    To include a specific file only:

    <?php
      $my_plugin = glob( dirname( __FILE__ ) . '/my_plugin_folder/my_plugin.php' );
      include_once( $my_plugin );
    ?>

    or to include a bunch of php files inside the first folder:

    <?php
      $my_plugins = glob( dirname( __FILE__ ) . '/my_plugins_folder/*.php');
      if( is_array( $my_plugins ) ) {
      	foreach ( $my_plugins as $my_plugin ) {
      		if( is_file( $my_plugin ) )
      			include_once( $my_plugin );
      	}
      }
    ?>

    @david tx, for the code.

    Another question about mu-plugins do the screenshot-x.png have any function? Or is this just for *offline* reference?

    i created a file called plugin_folders.php and add

    <?php
    /********
    to include Must Use plugins in folders
    ********/
    
    //include ds_wp3_menus plugin
    $ds_wp3_menus_plugins = glob( dirname( __FILE__ ) . '/menus/*.php');
    if( is_array( $ds_wp3_menus_plugins ) ) {
    foreach ( $ds_wp3_menus_plugins as $ds_wp3_menus_plugin ) {
    	if( is_file( $ds_wp3_menus_plugin ) )
    		include_once( $ds_wp3_menus_plugin );
    }
    }
    //include other folder plugin
    
    ?>

    Moderator Andrea Rennick

    @andrea_r

    do the screenshot-x.png have any function? Or is this just for *offline* reference?

    As far as I know, those are just for the repo.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Why can't i install plugins in subfolder in mu-plugins???’ is closed to new replies.