WordPress.org

Ready to get started?Download WordPress

Forums

Why can't i install plugins in subfolder in mu-plugins??? (4 posts)

  1. DDT
    Member
    Posted 3 years ago #

    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??

  2. David Sader
    Member
    Posted 3 years ago #

    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 );
      	}
      }
    ?>
  3. DDT
    Member
    Posted 3 years ago #

    @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
    
    ?>
  4. 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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags