[wp-trac] [WordPress Trac] #40279: switch_to_blog() and restore_current_blog() gives a fatal error in a multisite
WordPress Trac
noreply at wordpress.org
Mon Mar 27 21:40:39 UTC 2017
#40279: switch_to_blog() and restore_current_blog() gives a fatal error in a
multisite
--------------------------------+------------------------
Reporter: KestutisIT | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: | Focuses: multisite
--------------------------------+------------------------
Changes (by KestutisIT):
* status: closed => reopened
* resolution: invalid =>
Comment:
Replying to [comment:3 jeremyfelt]:
> Replying to [comment:2 KestutisIT]:
>
> > you SHOULD NOT have to write different code if multisite is enabled
>
> For better or worse, this is the required pattern when developing
something that works in single and multisite configurations. The same
`is_multisite()` check included in the original ticket description is
exactly what WordPress core does throughout its code base.
Please read the BASICS of PHP and coding. Please read why they decided to
create PHP7, what is predefined types, and where PHP is going. You are
wrong, you can't do all your code on IF/ELSE. There is a thing called
design patterns, and we have to follow them. It says that if you have
PUBLIC method (same is everywhere available WordPress function) is has to
be callable, just can be empty by the abstract class inheritance if it is
not defined. That is a BASICS of the code. I'm reopening this for
WordPress Lead developer to review. Please don't close it.
"Object interfaces allow you to create code which specifies which methods
a class must implement, without having to define how these methods are
handled.
Interfaces are defined in the same way as a class, but with the interface
keyword replacing the class keyword and without any of the methods having
their contents defined.
All methods declared in an interface must be public; this is the nature of
an interface."
http://php.net/manual/en/language.oop5.interfaces.php
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40279#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list