{"id":27,"date":"2022-05-04T16:40:00","date_gmt":"2022-05-04T15:40:00","guid":{"rendered":"https:\/\/sites.askyr.com\/darkmatterplugin\/?p=27"},"modified":"2025-04-30T13:55:58","modified_gmt":"2025-04-30T12:55:58","slug":"release-2-3-0","status":"publish","type":"post","link":"https:\/\/darkmatterplugin.com\/2022\/05\/04\/release-2-3-0\/","title":{"rendered":"Release 2.3.0"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li>Added <code>switch_to_blog()<\/code> support for Media Domains. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/97\">#97<\/a>)\n<ul class=\"wp-block-list\">\n<li>When using the various attachment functions within the <code>switch_to_blog()<\/code> context, it will now respect media domain settings on a per site basis.<\/li>\n\n\n\n<li>Setting media domains through the <code>DM_NETWORK_MEDIA<\/code> constant now works more fully.<\/li>\n\n\n\n<li>It is now possible to controlled media domains through the <code>network_media<\/code> property on <code>DarkMatter_Domains<\/code>, to enable more sophisticated logic in code.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Tweaked the way mapped domains are detected to better support scenarios involving <code>switch_to_blog()<\/code>. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/96\">#96<\/a>)\n<ul class=\"wp-block-list\">\n<li>No longer relies solely on the <code>DOMAIN_MAPPING<\/code> constant, set when a request is processed through a primary domain.<\/li>\n\n\n\n<li>Essentially, if the website handling the request is being viewed through its primary domain, then URLs within a <code>switch_to_blog()<\/code> context will be mapped if applicable (i.e. the blog switched to has an active primary domain).<\/li>\n\n\n\n<li>And vice-versa &#8211; if a request is through the admin domain (&#8220;unmapped&#8221;), then URLs in the <code>switch_to_blog()<\/code> context will be unmapped as well (to prevent cross-domain compatibility issues \/ warnings in browsers).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Fixed an issue where setting and unsetting the Primary Domain would update the database only, and not the cache. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/94\">#94<\/a>)\n<ul class=\"wp-block-list\">\n<li><code>DarkMatter_Domains<\/code> now handles the cache state for both primary and general domain caches.<\/li>\n\n\n\n<li>Also removes some duplicate database update logic.<\/li>\n\n\n\n<li>The third parameter of action hooks <code>darkmatter_primary_set<\/code> and <code>darkmatter_primary_unset<\/code> is now deprecated. It is always <code>true<\/code> as the database is always updated now, therefore it is redundant.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Domains are now ordered alphabetically &#8211; A to Z &#8211; when returned by <code>get_domains_by_type()<\/code>. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/95\">#95<\/a>)<\/li>\n\n\n\n<li>Fixed a typo preventing the cache retrieval for Restricted Domains working properly. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/89\">#89<\/a>)<\/li>\n\n\n\n<li>Fixed a malformed header for the 2.2.3 release in readme.txt file.<\/li>\n\n\n\n<li>First iteration of unit tests added to the project to improve quality assurance of this release and future releases. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/88\">#88<\/a>)\n<ul class=\"wp-block-list\">\n<li>Uses PHP Unit and based on the setup provided by the WP CLI scaffold.<\/li>\n\n\n\n<li>Issues \/ fixes in this release were found by the new unit tests.<\/li>\n\n\n\n<li>Unit tests are not included with the release version of the plugin, and are accessible via Github repository: <a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/\">https:\/\/github.com\/cameronterry\/dark-matter\/<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Updated NPM dependencies to their latest versions.<\/li>\n\n\n\n<li>Tested with WordPress 6.0 RC1.<\/li>\n\n\n\n<li>We have incorporated <a href=\"https:\/\/snyk.io\/\">Snyk<\/a> scanning for dependencies in Composer and NPM. (<a href=\"https:\/\/github.com\/cameronterry\/dark-matter\/pull\/76\">#76<\/a>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-release"],"_links":{"self":[{"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":1,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/posts\/27\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.askyr.com\/darkmatterplugin\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}