Changeset 2852684
- Timestamp:
- 01/23/2023 02:19:08 AM (3 years ago)
- Location:
- staff-list/trunk
- Files:
-
- 7 edited
-
admin/mbox-item-optns.php (modified) (1 diff)
-
admin/txt-admin.php (modified) (1 diff)
-
admin/txt-aurl.php (modified) (2 diffs)
-
inc/cnt-spage.php (modified) (1 diff)
-
inc/db.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
staff-list.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
staff-list/trunk/admin/mbox-item-optns.php
r2426846 r2852684 13 13 echo abcfl_input_checkbox('hideSPgLnk', '', $hideSPgLnk, abcfsl_txta(308), '', '', '', 'abcflMTop10', '', '', '' ); 14 14 //---------------------------------------------------- 15 $lblPretty = abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(231), abcfsl_aurl(60), 'abcflFontWP abcflFontS13 abcflFontW600' ); 16 $lblPgTitle = abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(77), abcfsl_aurl(102), 'abcflFontWP abcflFontS13 abcflFontW600' ); 17 15 18 echo abcfl_input_hline('1', '10'); 16 echo abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(303), abcfsl_aurl(60) ); 17 echo abcfl_input_txt('pretty', '', $pretty, abcfsl_txta(231), abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 19 echo abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(303), abcfsl_aurl(101) ); 20 //echo abcfl_input_txt('pretty', '', $pretty, abcfsl_txta(231), abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 21 echo abcfl_input_txt('pretty', '', $pretty, $lblPretty, abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 22 18 23 //Html Head Title 19 echo abcfl_input_txt('sPgTitle', '', $sPgTitle, abcfsl_txta(77), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 24 //echo abcfl_input_txt('sPgTitle', '', $sPgTitle, abcfsl_txta(77), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 25 echo abcfl_input_txt('sPgTitle', '', $sPgTitle, $lblPgTitle, abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 20 26 //---------------------------------------------------- 21 27 echo abcfl_input_hline('1', '10'); 22 abcfsl_mbox_tplate_field_section_hdr( 0, 367, false);28 abcfsl_mbox_tplate_field_section_hdr( 73, 367, false); 23 29 echo abcfl_input_txt('itemCustCls', '', $itemCustCls, abcfsl_txta(301), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl'); 24 30 echo abcfl_html_tag_end('div'); 25 31 } 26 -
staff-list/trunk/admin/txt-admin.php
r2708631 r2852684 1409 1409 case 458: 1410 1410 $out = __('Changelog', 'staff-list'); 1411 break; 1411 break; 1412 1412 //-------------------------------- 1413 1413 case 500: -
staff-list/trunk/admin/txt-aurl.php
r2708631 r2852684 317 317 case 98: 318 318 $out = $sld . 'admin-months/'; 319 break;319 break; 320 320 case 99: 321 321 $out = $d . 'admin-license-key/'; … … 324 324 case 100: 325 325 $out = $sld . 'changelog/'; 326 break;326 break; 327 327 case 101: 328 $out = $d . ''; 329 break; 328 $out = $d . 'staff-list-seo/#single-pages-seo'; 329 break; 330 case 102: 331 $out = $d . 'staff-list-seo/#seo-page-title'; 332 break; 330 333 331 334 default: -
staff-list/trunk/inc/cnt-spage.php
r2683032 r2852684 7 7 $pversion = $scodeArgs['pversion']; 8 8 $staffID = abcfsl_spg_a_tag_staff_member_id ( $scodeArgs ); 9 10 //error_log( print_r( $tplateID, true) ); 9 11 10 12 //Both qry args are missing. Show blank page. -
staff-list/trunk/inc/db.php
r2801069 r2852684 382 382 383 383 global $wpdb; 384 $ sPgTitle= $wpdb->get_var( $wpdb->prepare(384 $imgURL = $wpdb->get_var( $wpdb->prepare( 385 385 "SELECT meta_value 386 386 FROM $wpdb->postmeta … … 388 388 AND post_id = %d;", $postID ) ); 389 389 390 return $ sPgTitle;390 return $imgURL; 391 391 } 392 392 //-------------------- -
staff-list/trunk/readme.txt
r2814684 r2852684 6 6 Tested up to: 6.1 7 7 Requires PHP: 5.6 8 Stable tag: 1.6. 88 Stable tag: 1.6.9 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 122 122 123 123 == Changelog == 124 125 = 1.6.9 20230112 126 * New: Added support for Rank Math SEO - page title, canonical and og properties. 127 * Update: Staff Member Data > Options. Modified links to documentation. 124 128 125 129 = 1.6.8 20221108 -
staff-list/trunk/staff-list.php
r2814684 r2852684 11 11 Requires at least: 4.9 12 12 Requires PHP: 5.6 13 Version: 1.6. 813 Version: 1.6.9 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. 8';41 public $pluginVersion = '1.6.9'; 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';125 123 126 124 //if( $this->pluginSlug == 'abcfolio-staff-list' ) { … … 211 209 private function setup_actions() { 212 210 213 //error_log( print_r( 'setup_actions', true) );214 215 211 //add_action( 'plugins_loaded', array( $this, 'load_textdomain' )); 216 212 add_action( 'init', array( $this, 'load_textdomain' )); … … 229 225 add_filter('rewrite_rules_array', array( $this, 'filter_rewrite_rules' ), 1 ); 230 226 231 //--- SEO plugins START -- --------------------------------------------------------------227 //--- SEO plugins START -- Yoast SEO, AIOSE All in One SEO, The SEO Framework, Squirrly SEO, Rank Math SEO -------------- 232 228 // Detect plugin. For use on Front End and Back End. Check for plugin using plugin name. 233 229 $pluginActive = false; … … 236 232 237 233 // Yoast SEO 238 if( in_array('wordpress-seo/wp-seo.php', apply_filters('active_plugins', $activePlugins))){234 if( in_array('wordpress-seo/wp-seo.php', apply_filters('active_plugins', $activePlugins))){ 239 235 //error_log( print_r( 'yoast-seo_active', true) ); 240 236 $pluginActive = true; … … 250 246 // add_filter( 'wpseo_opengraph_image_size' , array( $this, 'filter_spg_false'), 20,2 ); 251 247 } 248 249 // AIOSE All in One SEO 250 if( !$pluginActive ){ 251 if( in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', apply_filters('active_plugins', $activePlugins))){ 252 //error_log( print_r( 'all-in-one-seo-pack_active', true) ); 253 $pluginActive = true; 254 add_filter( 'aioseo_title', array( $this, 'filter_spg_wp_title' ), 10, 2); 255 add_filter( 'aioseo_canonical_url', array( $this, 'aioseo_spg_canonical' )); 256 add_filter( 'aioseo_facebook_tags', array( $this, 'aioseo_spg_og' )); 257 add_filter( 'aioseo_twitter_tags', array( $this, 'aioseo_spg_twitter' )); 258 } 259 } 252 260 253 261 // The SEO Framework … … 276 284 } 277 285 } 278 286 287 // Rank Math SEO 288 if( !$pluginActive ){ 289 if(in_array('seo-by-rank-math/rank-math.php', apply_filters('active_plugins', $activePlugins))){ 290 //error_log( print_r( 'rank-math active', true) ); 291 $pluginActive = true; 292 add_filter( 'rank_math/frontend/title', array( $this, 'filter_spg_wp_title' ) ); 293 add_filter( 'rank_math/frontend/canonical', array( $this, 'filter_spg_canonical' )); 294 // Not needed, cannonical URL is ised. 295 //add_filter( 'rank_math/opengraph/url', array( $this, 'filter_spg_canonical' )); 296 add_filter( 'rank_math/opengraph/facebook/image', array( $this, 'img_url_by_pretty')); 297 add_filter( 'rank_math/opengraph/twitter/image', array( $this, 'img_url_by_pretty')); 298 } 299 } 300 279 301 // No SEO plugins. Render custom staff member title using WP filter. 280 302 if( !$pluginActive ){ … … 362 384 'perfil/([^/]+)/?$' => 'index.php?pagename=perfil&staff-name=$matches[1]', 363 385 'profilo/([^/]+)/?$' => 'index.php?pagename=profilo&staff-name=$matches[1]' 364 ); 386 ); 387 365 388 return $newRules + $rules; 366 389 } … … 411 434 } 412 435 413 // function custom_document_title( $title ) { 414 // return 'Here is the new title 2222.'; 415 // } 416 417 418 // Used by all 436 //-- Used by AIOSE START ---------------------------------------------------------------- 437 function aioseo_spg_og( $facebookMeta ) { 438 439 if( !$this->spg_is_pretty_permalink() ){ return $facebookMeta; } 440 441 $title = $this->filter_spg_wp_title( $facebookMeta['og:title'] ); 442 $facebookMeta['og:title'] = $title; 443 $facebookMeta['og:image'] = $this->img_url_by_pretty(); 444 //['og:url'] = cannonical URL is ised; 445 return $facebookMeta; 446 } 447 448 function aioseo_spg_twitter( $twitterMeta ) { 449 450 if( !$this->spg_is_pretty_permalink() ){ return $twitterMeta; } 451 452 $twitterMeta['twitter:image'] = $this->img_url_by_pretty(); 453 return $twitterMeta; 454 } 455 456 function aioseo_spg_canonical( $canonical ) { 457 458 $prettyPermalink = $this->spg_pretty_permalink_staff_name(); 459 if( !empty( $prettyPermalink ) ){ 460 // Called twice for cannonical and og:url. Do not run again when alredy is proper cannonical. 461 if( strpos( $canonical, $prettyPermalink ) === false){ 462 $canonical .= '' . $prettyPermalink . '/'; 463 } 464 } 465 return $canonical; 466 } 467 //-- Used by AIOSE END ---------------------------------------------------------------- 468 469 //--- Used by all START -------------------------------------------------------------- 419 470 function filter_spg_wp_title( $title ) { 420 471 421 472 // pp from URL 422 $prettyPermalink = $this->spg_pretty_permalink(); 473 $prettyPermalink = $this->spg_pretty_permalink_staff_name(); 474 475 //error_log( print_r( 'prettyPermalink', true) ); 476 //error_log( print_r( $prettyPermalink, true) ); 423 477 424 478 //Custom page title replaces single page title. Works only when pretty permalink field is populated. //$title .= ' ' . $sPgTitle; … … 431 485 } 432 486 433 // Used by all.434 487 function filter_spg_canonical( $canonical ) { 435 488 436 $prettyPermalink = $this->spg_pretty_permalink(); 437 489 $prettyPermalink = $this->spg_pretty_permalink_staff_name(); 438 490 if( !empty( $prettyPermalink ) ){ 439 491 $canonical .= '' . $prettyPermalink . '/'; … … 441 493 return $canonical; 442 494 } 443 //----------------------------------------------------------------------- 444 // Used by all. 495 445 496 private function spgs_for_pretty() { 446 497 … … 455 506 return $ppPages; 456 507 } 457 458 // Returns last part of pretty permalink URL - Staff Member name. 459 private function spg_pretty_permalink() { 508 //--- Used by all END -------------------------------------------------------------- 509 510 // Returns last part of pretty permalink URL - Staff Member name. OR empty. 511 private function spg_pretty_permalink_staff_name() { 460 512 461 513 // Return empty if not pp page. 462 514 $ppPages = $this->spgs_for_pretty(); 463 $prettyPermalink = '';464 515 465 516 // Check URL only if it's pp page. … … 469 520 $nameStart = strpos( $currentURL, '&staff-name=' ); 470 521 471 if( $nameStart === false ){ return $prettyPermalink; } 472 $prettyPermalink = substr( $currentURL, $nameStart + 12 ); 473 } 474 return $prettyPermalink; 475 } 476 477 // Used by all. 522 if( $nameStart === false ){ return ''; } 523 return substr( $currentURL, $nameStart + 12 ); 524 } 525 return ''; 526 } 527 528 private function spg_is_pretty_permalink() { 529 530 $ppPages = $this->spgs_for_pretty(); 531 532 if( is_page( $ppPages ) ){ 533 global $wp; 534 $currentURL = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); 535 $nameStart = strpos( $currentURL, '&staff-name=' ); 536 537 if( $nameStart === false ){ return false; } 538 return true; 539 540 } 541 return false; 542 } 543 544 // Returns spg image URL (meta_key _imgUrlL). 478 545 function img_url_by_pretty( $imgURL='' ) { 479 546 480 //error_log( print_r( $url, true) ); 481 //error_log( print_r( 'xxxxxxxxxxxxxxxxxxx', true) ); 482 483 $prettyPermalink = $this->spg_pretty_permalink(); 547 $prettyPermalink = $this->spg_pretty_permalink_staff_name(); 484 548 $sPgTitle = abcfsl_db_spg_title_by_pretty( $prettyPermalink ); 485 549
Note: See TracChangeset
for help on using the changeset viewer.