Changeset 3252610
- Timestamp:
- 03/08/2025 08:05:40 PM (13 months ago)
- Location:
- multisite-author-bio
- Files:
-
- 21 added
- 3 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/admin (added)
-
tags/1.1.0/admin/css (added)
-
tags/1.1.0/admin/css/admin.css (added)
-
tags/1.1.0/admin/css/user-setup.css (added)
-
tags/1.1.0/admin/js (added)
-
tags/1.1.0/admin/js/admin.js (added)
-
tags/1.1.0/admin/js/user-setup.js (added)
-
tags/1.1.0/admin/view.php (added)
-
tags/1.1.0/classes (added)
-
tags/1.1.0/classes/mab-frontend.php (added)
-
tags/1.1.0/classes/mab-plugin.php (added)
-
tags/1.1.0/classes/mab-user-setup.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/multisite-author-bio-es_ES.mo (added)
-
tags/1.1.0/languages/multisite-author-bio-es_ES.po (added)
-
tags/1.1.0/languages/multisite-author-bio-es_MX.mo (added)
-
tags/1.1.0/languages/multisite-author-bio-es_MX.po (added)
-
tags/1.1.0/languages/multisite-author-bio.pot (added)
-
tags/1.1.0/multisite-author-bio.php (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/classes/mab-frontend.php (modified) (1 diff)
-
trunk/multisite-author-bio.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multisite-author-bio/trunk/classes/mab-frontend.php
r3158266 r3252610 50 50 private function mab_get_current_site_slug() { 51 51 52 // Parse the URL and retrieve the hostname 53 $site_url = wp_parse_url( home_url(), PHP_URL_HOST ); 52 // Get the site URL and parse it using wp_parse_url for consistency with WordPress 53 $site_url = get_site_url(); 54 $parsed_url = wp_parse_url( $site_url ); 55 56 $domain = isset( $parsed_url['host'] ) ? $parsed_url['host'] : ''; 57 $path = isset( $parsed_url['path'] ) ? trim( $parsed_url['path'], '/' ) : ''; 58 59 if ( !empty( $path ) ) { 54 60 55 // Sanitize and return the site slug 56 return sanitize_text_field( $site_url ); 61 // For path-based multisites (e.g., testsite.com/es) 62 $slug = sanitize_title( $path ); 63 64 } else { 65 66 // For domain-based multisites (e.g., michaelbox.net or es.testsite.com) 67 $parts = explode( '.', $domain ); 68 $slug = (count( $parts ) > 2) ? sanitize_title( $parts[0] ) : sanitize_title( $parts[0] ); 69 70 } 71 72 // Return the slug 73 return $slug; 57 74 58 75 } 76 59 77 60 78 } -
multisite-author-bio/trunk/multisite-author-bio.php
r3199686 r3252610 3 3 * Plugin Name: Multisite Author Bio 4 4 * Description: Allows you to add unique user biographical information for each Multisite instance. 5 * Version: 1. 0.45 * Version: 1.1.0 6 6 * Author: CodeAdapted 7 7 * Author URI: https://codeadapted.com … … 30 30 31 31 /** @var string The plugin version number. */ 32 var $version = '1. 0.4';32 var $version = '1.1.0'; 33 33 34 34 /** @var string Shortcuts. */ -
multisite-author-bio/trunk/readme.txt
r3199686 r3252610 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7.1 6 Stable tag: 1. 0.46 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 71 71 == Changelog == 72 72 73 = 1.1.0 = 74 * Improved mab_get_current_site_slug() to correctly extract slugs for both domain-based and path-based multisite setups. 75 * Ensured compatibility with multisite networks using unique domains. 76 * Sanitized slugs to prevent database key mismatches. 77 73 78 = 1.0.4 = 74 79 * Fix missing text domain issues.
Note: See TracChangeset
for help on using the changeset viewer.