Closed altafhpatel closed 2 years ago
Do you have an error message? That file only has 196 lines
that is empty line when i remove
function block_apifetch_modifications() : void {
$script = <<<SCRIPT
wp.apiFetch.use( function ( options, next ) {
if ( 'method' in options ) {
if ( [ 'PATCH', 'PUT', 'DELETE' ].indexOf( options.method.toUpperCase() ) >= 0 ) {
return new Promise( function( resolve, reject ) {
// Save Data
resolve(data);
} );
}
}
const result = next( options );
return result;
} );
SCRIPT;
wp_add_inline_script( 'wp-api-fetch', $script );
}
then there is no error
@altafhpatel do you have the error message itself? Which version of PHP are you using? That code is necessary so removing it isn't an option
@altafhpatel do you have the error message itself? Which version of PHP are you using? That code is necessary so removing it isn't an option
it's latest PHP version i think 7.4 ... it needs to be rewrite...
@altafhpatel if you put it back in, what is the error message? Is it a syntax error? I need the PHP error message.
Your PHP code changes were rolled back due to an error on line 198 of file wp-content/themes/guten/includes/restrictions.php. Please fix and try saving again.
syntax error, unexpected end of file
Your PHP code changes were rolled back due to an error on line 198 of file wp-content/themes/guten/includes/restrictions.php. Please fix and try saving again.
syntax error, unexpected end of file
it's not the line 198 because i press some enters and comment it that's why it shows line 198... other wise it is the end of file error
@altafhpatel have you been modifying that file via the theme editor? Frontenberg wasn't designed to take modifications, your theme should be identical to what's in github.
What changes were you trying to make that required you to modify that file?
I didn't make any change just some line spaces that is why it shows wrong line number but the end of the file error... i think something is missing
hmmm that's still a modification, does it work if you use the unmodified version? I'm not interested in versions that have been modified, even if it's just whitespace changes or the addition/removal of lines.
If that's what's causing this then the answer to your problem is do not modify the files. I can only see the version here on GitHub, I do not know what the change you have made is, just that when you make it you get syntax errors.
I ran PHPCompatibility PHPCS suite on Frontenberg and no compatibility issues were found. It has been tested with your version of PHP ( 7.4 ), and is running on PHP 8.0 in production.
I do not understand why you would modify Frontenberg via the theme editor in the admin UI. Why would you want to do such a thing? I hope you're not trying to use Frontenberg to create a frontend editor for a client or project! That would be very insecure and unreliable. You should not modify Frontenberg.
Frontenberg is intended as a demonstration to show people the block editor without needing to install WordPress or login. It's locked down for a reason to prevent security issues, Frontenberg is not a frontend editor.
public_html/wp-content/themes/guten/includes/restrictions.php on line 197