Plugin Directory

Changeset 3252610


Ignore:
Timestamp:
03/08/2025 08:05:40 PM (13 months ago)
Author:
codeadapted
Message:

Release version 1.1.0

Location:
multisite-author-bio
Files:
21 added
3 edited

Legend:

Unmodified
Added
Removed
  • multisite-author-bio/trunk/classes/mab-frontend.php

    r3158266 r3252610  
    5050    private function mab_get_current_site_slug() {
    5151
    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 ) ) {
    5460
    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;
    5774
    5875    }
     76   
    5977
    6078}
  • multisite-author-bio/trunk/multisite-author-bio.php

    r3199686 r3252610  
    33* Plugin Name:  Multisite Author Bio
    44* Description:  Allows you to add unique user biographical information for each Multisite instance.
    5 * Version:      1.0.4
     5* Version:      1.1.0
    66* Author:       CodeAdapted
    77* Author URI:   https://codeadapted.com
     
    3030
    3131        /** @var string The plugin version number. */
    32         var $version = '1.0.4';
     32        var $version = '1.1.0';
    3333
    3434        /** @var string Shortcuts. */
  • multisite-author-bio/trunk/readme.txt

    r3199686 r3252610  
    44Requires at least: 5.0
    55Tested up to: 6.7.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7171== Changelog ==
    7272
     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
    7378= 1.0.4 =
    7479* Fix missing text domain issues.
Note: See TracChangeset for help on using the changeset viewer.