Changeset 2886080
- Timestamp:
- 03/24/2023 01:58:12 AM (3 years ago)
- Location:
- staff-list/trunk
- Files:
-
- 3 edited
-
inc/cnt-mp.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
staff-list.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
staff-list/trunk/inc/cnt-mp.php
r2683032 r2886080 154 154 function abcfsl_cnt_MP_name_builder_spans( $nameParts ){ 155 155 156 // [1] => Array 156 // [1] => Array nameParts 157 157 // ( 158 158 // [pfix] => … … 191 191 case 'sfix': 192 192 // 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; 195 196 $i++; 196 197 break; … … 252 253 function abcfsl_cnt_MP_prefix_space( $pfix ){ 253 254 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). 254 268 if( abcfl_util_starts_with ( $pfix, 'nbsp ' ) ){ 255 269 $pfix = ' ' . substr( $pfix, 5 ); … … 257 271 } 258 272 259 if( abcfl_util_ends_with ( $pfix, ' nbsp' ) ){260 $pfix = substr($pfix, 0, -5) . ' ';261 return $pfix;262 }263 273 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 290 function 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 ''; 264 316 } 265 317 -
staff-list/trunk/readme.txt
r2868388 r2886080 6 6 Tested up to: 6.1 7 7 Requires PHP: 5.6 8 Stable tag: 1. 6.98 Stable tag: 1.7.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 130 130 == Changelog == 131 131 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 133 138 * New: Added support for Rank Math SEO - page title, canonical and og properties. 134 139 * Update: Staff Member Data > Options. Modified links to the documentation. -
staff-list/trunk/staff-list.php
r2852684 r2886080 11 11 Requires at least: 4.9 12 12 Requires PHP: 5.6 13 Version: 1. 6.913 Version: 1.7.0 14 14 ------------------------------------------------------------------------ 15 15 Copyright 2009-2021 abcFolio. … … 39 39 private static $instance; 40 40 public $pluginSlug = 'abcfolio-staff-list'; 41 public $pluginVersion = '1. 6.9';41 public $pluginVersion = '1.7.0'; 42 42 public $prefix = 'abcfsl'; 43 43 … … 121 121 require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-html.php'; 122 122 require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-util.php'; 123 124 //require_once ABCFSL_PLUGIN_DIR . 'deprecated/inc.php'; 123 125 124 126 //if( $this->pluginSlug == 'abcfolio-staff-list' ) { … … 197 199 require_once ABCFSL_PLUGIN_DIR . 'adminf/mbox-tplate-fields.php'; 198 200 //} 199 201 200 202 $mboxCATMenu = new ABCFSL_MBox_CAT_Menu(); 201 203 $mboxAZMenu = new ABCFSL_MBox_AZ_Menu(); … … 419 421 function squirrly_spg_og( $og ) { 420 422 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) ); 433 441 return $og; 434 442 } … … 469 477 //--- Used by all START -------------------------------------------------------------- 470 478 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; } 471 482 472 483 // pp from URL
Note: See TracChangeset
for help on using the changeset viewer.