• Resolved scottsawyer

    (@scottsawyer)


    I created a couple of custom field types, which are plugins. When activating the plugins, I get warnings like:

    Warning: include_once(): Failed opening '/public/content/plugins/cmb2/includes/CMB2_Field_Link.php' for inclusion (include_path='phar:///usr/local/bin/wp/vendor/phpunit/php-token-stream:phar:///usr/local/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///usr/local/bin/wp/vendor/phpunit/php-code-coverage:phar:///usr/local/bin/wp/vendor/phpunit/phpunit:phar:///usr/local/bin/wp/vendor/symfony/yaml:.:/usr/share/php') in /public/content/plugins/cmb2/includes/helper-functions.php on line 44
    

    The plugin activates, and the new field type works as expected, but if a user encounters this warning, it would be disconcerting.

    Is there some sort of check I need to do in my plugins to register the field types without triggering the warning?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Justin Sternberg

    (@jtsternberg)

    This is likely because you have classes in your plugins which begin with CMB2_*. It is best if you create your own prefix for your classes/functions to clearly indicate it is a 3rd-party thing vs a core CMB2 class, and will prevent this warning.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    @scottsawyer did Justin’s suggestion here solve the issue at all?

    Thread Starter scottsawyer

    (@scottsawyer)

    Hey Guys,

    Thanks for the response, sorry it’s taken so long to get back, these notifications got lost in email.

    I haven’t had a chance to refactor the class names. I will post back when I get a chance ( probably 2 weeks from now ).

    Plugin Author Justin Sternberg

    (@jtsternberg)

    Marking resolved as there has been no response in over 5 months.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP warnings when activating custom field types.’ is closed to new replies.