Skip to content

Commit

Permalink
Issue #1 - enable for WordPress Multi Site
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Mar 6, 2019
1 parent b9ae6a7 commit 40d8617
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 11 additions & 6 deletions includes/oik-loader-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@

/**
* Create the oik-loader map file for oik-loader-MU
* in the mu-plugins folder
*
* It can either be a PHP file or a CSV or something
*
* in the mu-plugins folder.
*
* Syntax: oikwp oik-loader.php url=blocks.wp-a2z.org
*
*
*/

function oik_loader_csv_file() {
return WPMU_PLUGIN_DIR . '/oik-loader.csv';
if ( !function_exists( "oik_loader_csv_file") ) {

function oik_loader_csv_file() {
$csv_file = WPMU_PLUGIN_DIR;
$csv_file .= '/oik-loader.';
global $blog_id;
$csv_file .= $blog_id;
$csv_file .= '.csv';
return $csv_file;
}
}
function oik_loader_map() {
$csv = oik_loader_csv_file();
Expand Down
17 changes: 15 additions & 2 deletions includes/oik-loader-mu.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
}

/**
* Builds the lookup index from oik-loader.csv
* Builds the lookup index from oik-loader.blog_id.csv
* @return array|null
*/
function oik_loader_mu_build_index() {
$oik_loader_csv = dirname( __FILE__ ) . "/oik-loader.csv";
$oik_loader_csv = oik_loader_csv_file();
$index = null;
if ( file_exists( $oik_loader_csv) ) {
//echo "File exists";
Expand All @@ -55,6 +55,19 @@ function oik_loader_mu_build_index() {
return $index;
}

//$oik_loader_csv = dirname( __FILE__ ) . "/oik-loader." . $blog_id . ".csv";


function oik_loader_csv_file() {
global $blog_id;
$csv_file = WPMU_PLUGIN_DIR ;
$csv_file .= '/oik-loader.';

$csv_file .= $blog_id;
$csv_file .= '.csv';
return $csv_file;
}

/**
* Builds the lookup index for access by URI or post ID
*
Expand Down

0 comments on commit 40d8617

Please sign in to comment.