Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for WordPress 4.9.1 and Multisite #88

Closed
bobbingwide opened this issue Oct 21, 2017 · 8 comments
Closed

Support for WordPress 4.9.1 and Multisite #88

bobbingwide opened this issue Oct 21, 2017 · 8 comments
Assignees
Projects
Milestone

Comments

@bobbingwide
Copy link
Owner

WordPress 4.9 is currently under development.
The PHPUnit test suite developed for #9 should support a range of WordPress versions.
Some of the test data files contain the WordPress version used when creating the test cases. e.g. 4.8.2
The tests need to be 'generalised' to convert the current WordPress version e.g. 4.9-beta3--41938-src to something like x.y.z

@bobbingwide bobbingwide self-assigned this Oct 21, 2017
@bobbingwide bobbingwide added this to the oik v3.2.0 milestone Oct 22, 2017
@bobbingwide
Copy link
Owner Author

oik has now been tested with WordPress 4.9-RC2.
It is currently undergoing testing under WordPress MultiSite, with a new routine developed in oik-batch v0.9.3. See https://github.com/bobbingwide/oik-batch

@bobbingwide
Copy link
Owner Author

bobbingwide commented Nov 9, 2017

PHPUnit tests have now been converted to run in the main site of a WordPress Multisite installation. Local site used was qw/wpms. ( url=qw path=wpms).
They're now being run in subsites ( site-2 and phphants ) with a couple of different results to cater for.

@bobbingwide bobbingwide changed the title Support for WordPress 4.9 Support for WordPress 4.9 and multisite Nov 10, 2017
@bobbingwide
Copy link
Owner Author

Note: When testing in WordPress Multisite you may need to use

$_SERVER['REQUEST_URI'] = "/";

somewhere within the test suite.

This is to cater for generated HTML which expects "/" in the hidden field for _wp_http_referer.
If you don't you could get this when path=wpms

<input type="hidden" name="_wp_http_referer" value="/wpms/" />

@bobbingwide
Copy link
Owner Author

bobbingwide commented Nov 13, 2017

For shortcodes that can be used in text widgets or any other area outwith 'content' processing
the logic that depends on the value of $GLOBALS['post'] to obtain the current global post ID will have to be updated to look a little further - obtaining the $GLOBALS['id'].

Not only do we need the global post's ID, some shortcodes also require the global post type.
So if we can't find it from the global $post we'll have to reload the post using the global $id.

I've added a comment to WordPress TRAC 10457.
https://core.trac.wordpress.org/ticket/10457#comment:62

Solution

  • Change bw_global_post_id()
  • Change bw_global_post_type()
  • There is no need to check WordPress version or whether or not we're in a text widget.

These changes are required to correct the output from a number of shortcodes which are affected by the 4.9 changes. The following shortcodes are known to have been affected.

Shortcode Plugin
bw_fields oik-fields
bw_code oik-shortcodes
bw_related oik-fields

@bobbingwide bobbingwide changed the title Support for WordPress 4.9 and multisite Support for WordPress 4.9 and Multisite Nov 13, 2017
@bobbingwide
Copy link
Owner Author

Note: Improvements to the core solution ( implemented in 4.9-RC3-42186 ) have negated the need for the changes to the oik base code.

Additionally, oik should have used the functions that WordPress core uses: get_queried_object() and get_queried_object_id();

@bobbingwide
Copy link
Owner Author

bobbingwide commented Nov 25, 2017

The [caption] and [embed] shortcodes have changed in WordPress 4.9.

caption__example and associated tests need changing for 2 reasons.

  1. Change e.g: to e.g.: - props @GaryJones
  2. Change style="width" to style="max-width" in generated HTML

embed__example and its tests should also be changed

  1. The YouTube embed now works - using an iframe
  2. So it's no longer necessary to say "Note: It's not possible to produce a proper working example due to the way the embed shortcode is handled."

Note: I won't make the tests backward compatible with WordPress 4.8
The tests are implemented in oik-libs

@bobbingwide
Copy link
Owner Author

WordPress 4.9.1 was released on 29th November 2017. Oik v3.2.2 should be tested with this latest version.

@bobbingwide bobbingwide changed the title Support for WordPress 4.9 and Multisite Support for WordPress 4.9.1 and Multisite Nov 30, 2017
@bobbingwide bobbingwide added this to To Do in oik v3.2.2 via automation Dec 1, 2017
@bobbingwide
Copy link
Owner Author

This is superseded by #130. So closing

oik v3.2.2 automation moved this from To Do to Done Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
oik v3.2.2
  
Done
Development

No branches or pull requests

1 participant