PHP code example of brianhenryie / bh-wp-private-uploads
1. Go to this page and download the library: Download brianhenryie/bh-wp-private-uploads library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
brianhenryie / bh-wp-private-uploads example snippets
$settings = new class() implements \BrianHenryIE\WP_Private_Uploads\Private_Uploads_Settings_Interface {
use \BrianHenryIE\WP_Private_Uploads\Private_Uploads_Settings_Trait;
public function get_plugin_slug(): string {
return 'my-plugin';
}
};
$private_uploads = \BrianHenryIE\WP_Private_Uploads\Private_Uploads::instance( $settings );
$settings = new class() implements \BrianHenryIE\WP_Private_Uploads\API\Private_Uploads_Settings_Interface {
use \BrianHenryIE\WP_Private_Uploads\API\Private_Uploads_Settings_Trait;
public function get_plugin_slug(): string {
return 'my-plugin';
}
/**
* Defaults to the plugin slug when using Private_Uploads_Settings_Trait.
*/
public function get_uploads_subdirectory_name(): string {
return 'email-attachments';
}
};
$private_uploads = \BrianHenryIE\WP_Private_Uploads\Private_Uploads::instance( $settings );
$settings = new class() implements \BrianHenryIE\WP_Private_Uploads\API\Private_Uploads_Settings_Interface {
use \BrianHenryIE\WP_Private_Uploads\API\Private_Uploads_Settings_Trait;
public function get_plugin_slug(): string {
return 'my-plugin';
}
/**
* Defaults to no CLI commands when using Private_Uploads_Settings_Trait.
*/
public function get_cli_base(): ?string {
return 'my-plugin';
}
};
$private_uploads = \BrianHenryIE\WP_Private_Uploads\Private_Uploads::instance( $settings );
$private_uploads = new Private_Uploads( $private_uploads_settings, $logger );
// Add the hooks:
new BH_WP_Private_Uploads( $private_uploads, $private_uploads_settings, $logger );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.