Plugin Directory

Changeset 2886080


Ignore:
Timestamp:
03/24/2023 01:58:12 AM (3 years ago)
Author:
abcfolio
Message:

Version 1.7.0

Location:
staff-list/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • staff-list/trunk/inc/cnt-mp.php

    r2683032 r2886080  
    154154function abcfsl_cnt_MP_name_builder_spans( $nameParts ){
    155155
    156     // [1] => Array
     156    // [1] => Array nameParts
    157157    //     (
    158158    //         [pfix] =>
     
    191191                case 'sfix':
    192192                    // Hide suffix if rendered as last part.
    193                     if( $arrayIdx < $partsQty ) { $partTxt .= $value; }               
    194                     //$partTxt .= $value;
     193                    //if( $arrayIdx < $partsQty ) { $partTxt .= $value; }
     194                    $value = abcfsl_cnt_MP_suffix_alwas( $value, $arrayIdx, $partsQty );               
     195                    $partTxt .= $value;
    195196                    $i++;
    196197                    break;
     
    252253function abcfsl_cnt_MP_prefix_space( $pfix ){
    253254
     255    // Add space before prefix.
     256    if( abcfl_util_starts_with ( $pfix, 'nbsp' ) ){
     257        $pfix = ' ' . substr( $pfix, 4 );
     258        return $pfix;
     259    }
     260
     261    // Add space after prefix.
     262    if( abcfl_util_ends_with ( $pfix, 'nbsp' ) ){
     263        $pfix = substr($pfix, 0, -4) . ' ';
     264        return $pfix;
     265    }
     266
     267    // Add space before prefix (legacy).
    254268    if( abcfl_util_starts_with ( $pfix, 'nbsp ' ) ){
    255269        $pfix = ' ' . substr( $pfix, 5 );
     
    257271    }
    258272
    259     if( abcfl_util_ends_with ( $pfix, ' nbsp' ) ){
    260         $pfix = substr($pfix, 0, -5) . ' ';
    261         return $pfix;
    262     }
    263273    return $pfix;
     274}
     275
     276// function abcfsl_cnt_MP_prefix_space_OLD( $pfix ){
     277
     278//     if( abcfl_util_starts_with ( $pfix, 'nbsp ' ) ){
     279//         $pfix = ' ' . substr( $pfix, 5 );
     280//         return $pfix;
     281//     }
     282
     283//     if( abcfl_util_ends_with ( $pfix, ' nbsp' ) ){
     284//         $pfix = substr($pfix, 0, -5) . ' ';
     285//         return $pfix;
     286//     }
     287//     return $pfix;
     288// }
     289
     290function abcfsl_cnt_MP_suffix_alwas( $sfix, $arrayIdx, $partsQty ){
     291
     292    // Flag ! is used to alwas show suffix.
     293    if( abcfl_util_starts_with ( $sfix, '!' ) ){
     294
     295        if( abcfl_util_starts_with ( $sfix, '!nbsp' ) ){
     296            $sfix = ' ' .substr( $sfix, 5 );
     297            return $sfix;
     298        }
     299
     300        $sfix = substr( $sfix, 1 );
     301        return $sfix;
     302    }
     303
     304    // Alwas show suffix if it's not the last MP field.
     305    if( $arrayIdx < $partsQty ) {
     306
     307        if( abcfl_util_starts_with ( $sfix, 'nbsp' ) ){
     308            $sfix = ' ' .substr( $sfix, 4 );
     309        }
     310
     311        return $sfix;
     312    }
     313   
     314    // Hide suffix if rendered as last part and no alawys flag.
     315    return '';
    264316}
    265317
  • staff-list/trunk/readme.txt

    r2868388 r2886080  
    66Tested up to:  6.1
    77Requires PHP: 5.6
    8 Stable tag: 1.6.9
     8Stable tag: 1.7.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    130130== Changelog ==
    131131
    132 = 1.6.9 2023
     132= 1.7.0 20230323
     133* Update: Modified MP prefix and suffix section to better handle spaces and other in-line options.
     134* Update: Added check for pretty permalink to filter_spg_wp_title.
     135* Fix: Squirrly SEO og section modified to handle array error.
     136
     137= 1.6.9 20230220
    133138* New: Added support for Rank Math SEO - page title, canonical and og properties.
    134139* Update: Staff Member Data > Options. Modified links to the documentation.
  • staff-list/trunk/staff-list.php

    r2852684 r2886080  
    1111Requires at least: 4.9
    1212Requires PHP: 5.6
    13 Version: 1.6.9
     13Version: 1.7.0
    1414------------------------------------------------------------------------
    1515Copyright 2009-2021 abcFolio.
     
    3939    private static $instance;
    4040    public $pluginSlug = 'abcfolio-staff-list';
    41     public $pluginVersion = '1.6.9';   
     41    public $pluginVersion = '1.7.0';   
    4242    public $prefix = 'abcfsl';
    4343
     
    121121        require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-html.php';
    122122        require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-util.php';
     123
     124        //require_once ABCFSL_PLUGIN_DIR . 'deprecated/inc.php';
    123125
    124126        //if( $this->pluginSlug == 'abcfolio-staff-list' ) {
     
    197199                require_once ABCFSL_PLUGIN_DIR . 'adminf/mbox-tplate-fields.php';
    198200            //}
    199 
     201                           
    200202            $mboxCATMenu = new ABCFSL_MBox_CAT_Menu();
    201203            $mboxAZMenu = new ABCFSL_MBox_AZ_Menu();
     
    419421    function squirrly_spg_og( $og ) {
    420422
    421         if( !array_key_exists('og:image', $og)){
    422             $og += ['og:image' => ''];
    423         }
    424 
    425         $canonical = $this->filter_spg_canonical( $og['og:url'] );
    426         $title = $this->filter_spg_wp_title( $og['og:title'] );
    427         $imgURL = $this->img_url_by_pretty( $og['og:image'] );
    428 
    429         $og['og:url'] = $canonical;
    430         $og['og:title'] = $title;
    431         $og['og:image'] = $imgURL;
    432        
     423        //error_log( print_r( 'squirrly_spg_og', true) );
     424        if( !$this->spg_is_pretty_permalink() ){ return $og; }
     425        //error_log( print_r( $og, true) );
     426
     427        if( !is_array( $og ) ){ $og = array(); }
     428
     429        if( !array_key_exists('og:url', $og)){ $og += ['og:url' => '']; }
     430        if( !array_key_exists('og:title', $og)){ $og += ['og:title' => '']; }
     431        if( !array_key_exists('og:image', $og)){ $og += ['og:image' => '']; }
     432
     433        $og['og:url'] = $this->filter_spg_canonical( $og['og:url'] );
     434        $og['og:title'] = $this->filter_spg_wp_title( $og['og:title'] );
     435        $og['og:image'] = $this->img_url_by_pretty( $og['og:image'] );
     436
     437        // $og['og:url'] = $canonical;
     438        // $og['og:title'] = $title;
     439        // $og['og:image'] = $imgURL;
     440        //error_log( print_r( $og, true) );
    433441        return $og;
    434442    }
     
    469477    //--- Used by all START --------------------------------------------------------------
    470478    function filter_spg_wp_title( $title ) {
     479
     480        //error_log( print_r( 'filter_spg_wp_title', true) );
     481        if( !$this->spg_is_pretty_permalink() ){ return $title; }
    471482
    472483        // pp from URL
Note: See TracChangeset for help on using the changeset viewer.