lp__require( $filename = '', $plugin_name = LP__NAME'' )
This function includes a file by requiring it once within the Launchpad plugins. It uses the lp__get_path function to retrieve the plugin file path based on the given filename and plugin name, and then requires the file using the require_once statement.
Plugin
Namespace
Launchpad
Parameters
string
$file
The file to include
string
$plugin_name
Plugin name to get the file from.
Return
void
Source
File: \includes\lp-utility-functions.php
function lp__require( $file = '', $plugin_name = LP__NAME ) {
/**
* Filter: lp__require_filename
*
* Filter hook to modify the file before including it.
*
* If a modified file path exists, it includes (requires) the file using the
* WordPress require_once function.
*
* @param string $file The file path or filename to include.
* @param string $plugin_name Plugin name to get the file from.
*/
$file = apply_filters("lp__require", $file, $plugin_name);
/**
* Filter: lp__require_filename/{$plugin_name}
*
* Filter hook to modify the file before including it.
*
* If a modified file path exists, it includes (requires) the file using the
* WordPress require_once function.
*
* The dynamic portion of the hook, `$plugin_name`, refers to the specific plugin name
* to allow more granular control over the file inclusion for different plugins.
*
* @param string $file The file path or filename to include.
*/
$file = apply_filters("lp__require/{$plugin_name}", $file);
if( $file ){
require_once lp__get_path( $file, $plugin_name );
}
}