• Resolved sprowt

    (@sprowt)


    hello kind GP ppl,

    is the comment //phpcs:ignore is specifically for Theme Check purposes, best practices, or simply a coding courtesy? i see it a lot in GP.

    i read about wp_body_open here:

    wp_body_open

    generatewp.com

    wp 5.2 update

    i’m as of yet unfamiliar with php codesniffer.

    to my self-trained eye, the GP implementation of wp_body_open is an alternative backwards compat w added benefit of using less code.

    if there’s a better place to submit non-support Qs and comments, please advise. i don’t want to be an annoyance, but i really enjoy learning about programming, php and WP using GP theme.

    thank you, L

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    We opted to simply include the action instead of checking for the existence of the function.

    As you can see here, the function simply calls the action like we do: https://developer.ww.wp.xz.cn/reference/functions/wp_body_open/

    We may change this in the future, but for now this works great.

    The phpcs:ignore comment is necessary as phpcs will output an error if a hook is present without the theme prefix (generate_).

    In this case, it’s the correct usage of phpcs:ignore.

    Hope this helps!

    Thread Starter sprowt

    (@sprowt)

    got it, thank you, Tom <3

    Theme Author Tom

    (@edge22)

    No problem! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_body_open and //phpcs:ignore notation’ is closed to new replies.