Eazyest_Gallery::set_gallery_folder()
-
WP 3.7.1 + EG 0.1.3
If a site is available under multiple server names, e.g. my https://photo.mjsb.eu/blog = https://www.mjsb.eu/blog, then easyest-gallery won’t find the image attachment when invoked under the alias URL. The problem is that the GUIDs for the “attachment” posts contain the canonical server name, but set_gallery_folder() uses HTTP_HOST which is different.
As a quick fix this function to use get_option(‘siteurl’):
--- _ORIG_eazyest-gallery.php 2013-11-01 23:43:42.000000000 +0100 +++ eazyest-gallery.php 2013-11-01 23:53:11.000000000 +0100 @@ -396,6 +396,10 @@ $port = ( $_SERVER["SERVER_PORT"] == '80' ) ? '' : ( ':' . $_SERVER['SERVER_PORT'] ); $this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] . $port ), substr( $this->root, strlen( $this->home_dir() ) ) ) ); + + /**MJ: use WordPress config**/ + $this->address = get_option('siteurl') . "/" . $gallery_folder; + /**MJ**/ } /**
- The topic ‘Eazyest_Gallery::set_gallery_folder()’ is closed to new replies.