Skip to content

switch_to_blog: Change message to reflect WordPress-VIP-Go ruleset and downgrade to "Warning" #643

@rebeccahum

Description

@rebeccahum

This is a two-part issue since I think step #2 will need to be done in 3.x due to it being a breaking change (can you please confirm @jrfnl?)

Step 1
Mentioned in #615, we should change the message in the WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog error code to reflect the one being changed in WordPress-VIP-Go since the current one is outdated.

From:

'message' => '%s() is not something you should ever need to do in a VIP theme context. Instead use an API (XML-RPC, REST) to interact with other sites if needed.',

To:

<message>Switch to blog may not work as expected since it only changes the database context for the blog and does not load the plugins or theme of that site. This means that filters or hooks that the blog you are switching to uses will not run.</message>

Step 2
Downgrade to warning type at sniff level and remove modification in WordPress-VIP-Go ruleset:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions