Developer Docs

Multi-site

Disable Multisite Option. Then you can disable it using this code: open the editor wp-config.php file and paste this code.

define( 'NEXT3_MULTI_SITE', false);

Enable WP Cache

To load faster, need to enable WP Cache.

define('WP_CACHE', true);

Disable Next3 Meta Cache

Open the Theme editor functions.php file and paste this code.

// disable meta cache
add_filter('next3_enable_meta_cache', function( $status = true){
   return false;
}); 

Cronjob Filter Hook

Open the Theme editor functions.php file and paste this code.

// disable cron job
add_filter('next3_cron_intervals', function( $status = true){
   return false;
}); 

// time cron job - default 10 secs
add_filter('next3_cron_intervals_time', function( $time = 10){
   return $time;
}); 

Set real server cron: if the cron job is not working

*/1 * * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Or

*/1 * * * * curl https://yourwebsite.com/?next3_cron=1 >/dev/null 2>&1

Set up Public Endpoint for S3 Object Storage

Open the editor wp-config.php file and paste this code.

if( !defined('NEXT3_PUBLIC_ENDPOINT')){
    define( 'NEXT3_PUBLIC_ENDPOINT', 'https://eu2.contabostorage.com/65aafd3f6a554a10aefa275b123c4756'); // example endpoint
}

Add New Cloud Providers Settings Filter Hook

Open the Theme editor functions.php file and paste this code.

add_filter('next3/providers/add', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

Amazon S3 Settings

add_filter('next3/providers/aws', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

Digital Ocean Settings

add_filter('next3/providers/digital', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

Wasabi Settings

add_filter('next3/providers/wasabi', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

BunnyCDN Settings

add_filter('next3/providers/bunny', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

Google Cloud Settings

add_filter('next3/providers/google', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

S3-object storage Settings

add_filter('next3/providers/objects', function( $settings = []){
   // add new settings code here
   
   // end settings code
   return $settings;
}); 

Filter Hook

Credentials Data

Open the Theme editor functions.php file and paste this code.

add_filter('next3/credentials/data', function( $data = []){
   // add new data code here
   
   // end data code
   return $data;
}); 

Allow Mime extension (Exam: .jpg)

Open the Theme editor functions.php file and paste this code.

add_filter('next3_allowed_mime_ext', function( $mime = []){
   // add new mime code here
   
   // end mime code
   return $mime;
}); 

// for gzip
add_filter('next3_gzip_mime_types', function( $mime = []){
   // add new mime code here
   
   // end mime code
   return $mime;
}); 

Allow a maximum size of upload

Open the Theme editor functions.php file and paste this code.

add_filter('next3_allowed_max_image_sizes', function( $sizes = []){
   // add new sizes code here
   
   // end sizes code
   return $sizes;
}); 

Offload count data

Open the Theme editor functions.php file and paste this code.

add_filter('next3_offload_count_data', function( $count = []){
   // add new count code here
   
   // end count code
   return $count;
}); 

Dashboard Action Hook

Open the Theme editor functions.php file and paste this code.

// before menu add in Dashboard
add_action('next3aws/navtab/before', function(){
   //code here..
}); 
// after menu add in Dashboard
add_action('next3aws/navtab/after', function(){
   //code here..
}); 

// before add content in Dashboard
add_action('next3aws/content/before', function(){
   //code here..
}); 
// after add content in Dashboard
add_action('next3aws/content/after', function(){
   //code here..
});  

Offload Settings


// before add content in Dashboard -> Offload Settings
add_action('next3aws-offload-content-before', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2); 

// after add content in Dashboard -> Offload Settings
add_action('next3aws-offload-content-after', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2);

Delivery Settings

// before add content in Dashboard -> Delivery Settings
add_action('next3aws-delivery-content-before', function($settings_options){
   //code here..
}, 10);

// before add content in Dashboard -> Delivery Settings -> into Form
add_action('next3aws-delivery-contentdiv-before', function($settings_options){
   //code here..
}, 10);
 
// after add content in Dashboard -> Delivery Settings
add_action('next3aws-delivery-content-after', function($settings_options){
   //code here..
}, 10); 

// after add content in Dashboard -> Delivery Settings -> into Form
add_action('next3aws-delivery-contentdiv-after', function($settings_options){
   //code here..
}, 10);

Storage Settings

// before add content in Dashboard -> Storage Settings
add_action('next3aws-settings-content-before', function($settings_options){
   //code here..
}, 10);

// before add content in Dashboard -> Storage Settings -> into Form
add_action('next3aws-settings-contentdiv-before', function($settings_options){
   //code here..
}, 10);
 
// after add content in Dashboard -> Storage Settings
add_action('next3aws-settings-content-after', function($settings_options){
   //code here..
}, 10); 

// after add content in Dashboard -> Storage Settings -> into Form
add_action('next3aws-settings-contentdiv-after', function($settings_options){
   //code here..
}, 10);

Optimization Settings

// before add content in Dashboard -> Optimization Settings
add_action('next3aws-optimization-content-before', function($settings_options){
   //code here..
}, 10);

// before add content in Dashboard -> Optimization Settings -> into Form
add_action('next3aws-optimization-contentdiv-before', function($settings_options){
   //code here..
}, 10);
 
// after add content in Dashboard -> Optimization Settings
add_action('next3aws-optimization-content-after', function($settings_options){
   //code here..
}, 10); 

// after add content in Dashboard -> Optimization Settings -> into Form
add_action('next3aws-optimization-contentdiv-after', function($settings_options){
   //code here..
}, 10);

Sync Settings


// before add content in Dashboard -> Sync Settings
add_action('next3aws-sync-content-before', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2); 

// after add content in Dashboard -> Sync Settings
add_action('next3aws-sync-content-after', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2);

Tools


// before add content in Dashboard -> Tools
add_action('next3aws-tools-content-before', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2); 

// after add content in Dashboard -> Tools
add_action('next3aws-tools-content-after', function($settings_options, $offload_data = []){
   //code here..
}, 10, 2);

Others Action/Filter Hook

Open the Theme editor functions.php file and paste this code.

Allow upload in WP Media from content

If you want to automatically upload your hard-coded media URL from page or post content, which is not available in WP Media but stored in your storage.

At first, you need to enable the option from Delivery Settings > Force content rewrite

add_filter('next3_allowed/upload_media/content/url', function( $return){
   return true;
}); 

Leave a Reply