• Rinku Y

    (@rinkuyadav999)


    WARNING: file_get_contents was found in the file customizer.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.

    Line 10: $fonts = file_get_contents( get_template_directory() . ‘/json/google-fonts.json’ );

    WordPress Reply:

    The Theme Check plugin / warning is incorrect in this case.

    Please fix this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    This issue will not be fixed, because it is not incorrect.

    We do not allow themes to include the file_get_contents() function.

    Instead of reading the json file and parsing it every time you need it, you should parse the file once into a PHP array, then store it in a PHP file as a PHP variable. You could use var_export and get a PHP version of the final parsed array suitable for exactly this.

    Thread Starter Rinku Y

    (@rinkuyadav999)

    Thank you very much, i got about this plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nice Plugin’ is closed to new replies.