Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CopyFile() {
- $TemplateFileSourceURL = __DIR__ . '/pag-portafolio.php'; // Address to your file in the plugin directory
- $TemplateFileTargetURL = get_stylesheet_directory() . '/page-pag-portafolio.php'; // Note the "page-" prefix, it is necessary for WP to select this file instead of the general "page.php". The name after the prefix must match the slug of the page created in WP.
- if ( !file_exists( $TemplateFileSourceURL ) ) {
- return FALSE;
- }
- $GetTemplate = file_get_contents( $TemplateFileSourceURL );
- if ( !$GetTemplate ) {
- return FALSE;
- }
- $WriteTemplate = file_put_contents( $TemplateFileTargetURL, $GetTemplate );
- if ( !$WriteTemplate ) {
- return FALSE;
- }
- $TemplateFileSourceURL = __DIR__ . '/single-portafolio.php'; // Address to your file in the plugin directory
- $TemplateFileTargetURL = get_stylesheet_directory() . '/page-single-portafolio.php'; // Note the "page-" prefix, it is necessary for WP to select this file instead of the general "page.php". The name after the prefix must match the slug of the page created in WP.
- if ( !file_exists( $TemplateFileSourceURL ) ) {
- return FALSE;
- }
- $GetTemplate = file_get_contents( $TemplateFileSourceURL );
- if ( !$GetTemplate ) {
- return FALSE;
- }
- $WriteTemplate = file_put_contents( $TemplateFileTargetURL, $GetTemplate );
- if ( !$WriteTemplate ) {
- return FALSE;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement