Changeset 2936577
- Timestamp:
- 07/10/2023 02:13:48 PM (3 years ago)
- Location:
- schema-breadcrumbs
- Files:
-
- 6 added
- 2 edited
-
tags/2.1.0 (added)
-
tags/2.1.0/WDPanelAdmin.css (added)
-
tags/2.1.0/WDPanelAdmin.php (added)
-
tags/2.1.0/readme.txt (added)
-
tags/2.1.0/schema-breadcrumbs.php (added)
-
tags/2.1.0/script_link.png (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/schema-breadcrumbs.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
schema-breadcrumbs/trunk/readme.txt
r2859044 r2936577 5 5 Requires at least: 2.2 6 6 Tested up to: 6.1 7 stable tag: 2. 007 stable tag: 2.1.0 8 8 9 9 Very easily add breadcrumbs to your site with valid Schema Breadcrumb Markup, this plugin is also a drop-in replacement for RDFa Breadcrumb, just install this and deactivate RDFa Breadcrumb. … … 35 35 36 36 == Changelog == 37 38 = 2.1.0 = 39 * PHP 8 compatibility 40 * Added ability to remove final crumb from display 37 41 38 42 = 2.0.0 = -
schema-breadcrumbs/trunk/schema-breadcrumbs.php
r2859068 r2936577 3 3 Plugin URI: http://webdesires.co.uk 4 4 Description: Outputs a fully Schema valid breadcrumb 5 Version: 2. 0.05 Version: 2.1.0 6 6 Author: Dean Williams 7 7 Author URI: http://deano.me … … 28 28 $opt['boldlast'] = true; 29 29 $opt['blogparent'] = true; 30 $opt['removefinal'] = false; 30 31 $opt['nofollowhome'] = false; 31 32 $opt['nofollowcurrent'] = false; … … 63 64 } 64 65 65 foreach (array('boldlast', 'blogparent', ' nofollowhome', 'nofollowcurrent', 'singlecatprefix', 'trytheme') as $option_name) {66 foreach (array('boldlast', 'blogparent', 'removefinal', 'nofollowhome', 'nofollowcurrent', 'singlecatprefix', 'trytheme') as $option_name) { 66 67 if (isset($_POST[$option_name])) { 67 68 $opt[$option_name] = true; … … 160 161 "desc" => __('Enable/Disable the Blog crumb in the breadcrumb'), 161 162 "content" => '<input type="checkbox" name="blogparent" id="blogparent" '.checked($opt['blogparent'],true,false).'/>', 163 ); 164 $rows[] = array( 165 "id" => "removefinal", 166 "label" => __('Remove Final Crumb'), 167 "desc" => __('Remove the final crumb in the breadcrumb, ie the page you are on.'), 168 "content" => '<input type="checkbox" name="removefinal" id="removefinal" '.checked($opt['removefinal'],true,false).'/>', 162 169 ); 163 170 $rows[] = array( … … 278 285 "@id": "'.$actual_link.'", 279 286 "url": "'.$actual_link.'", 280 "name": "'. addslashes($input).'"287 "name": "'.str_replace('"', '', $input).'" 281 288 } 282 289 }'; … … 337 344 "@id": "'.$dat['link'].'", 338 345 "url": "'.$dat['link'].'", 339 "name": "'. $dat['name'].'"346 "name": "'.str_replace('"', '', $dat['name']).'" 340 347 } 341 348 }'; … … 383 390 "@id": "'.get_permalink(get_option('page_on_front')).'", 384 391 "url": "'.get_permalink(get_option('page_on_front')).'", 385 "name": "'. addslashes($opt['home']).'"392 "name": "'.str_replace('"', '', $opt['home']).'" 386 393 } 387 394 }'; … … 454 461 "@id": "'.$page_url.'", 455 462 "url": "'.$page_url.'", 456 "name": "'. addslashes($page_name).'"463 "name": "'.str_replace('"', '', $page_name).'" 457 464 } 458 465 }'; … … 490 497 "@id": "'.get_bloginfo('url').'", 491 498 "url": "'.get_bloginfo('url').'", 492 "name": "'. addslashes($opt['home']).'"499 "name": "'.str_replace('"', '', $opt['home']).'" 493 500 } 494 501 }'; … … 496 503 $bloglink[] = $homelink; 497 504 } 498 if(count($link) > 4){505 //if(count($link) > 4){ 499 506 //print_r($bloglink); 500 507 //print_r($homelink); 501 }508 //} 502 509 503 510 if ( ($on_front == "page" && is_front_page()) || ($on_front == "posts" && is_home()) ) { … … 559 566 "@id": "'.get_term_link($category->slug, $obj->taxonomies[0]).'", 560 567 "url": "'.get_term_link($category->slug, $obj->taxonomies[0]).'", 561 "name": "'. addslashes($category->name).'"568 "name": "'.str_replace('"', '', $category->name).'" 562 569 } 563 570 }'; … … 568 575 569 576 if ($customtax === false) { 570 if (is_single() && count(get_the_category()) > 1) {577 if (is_single() && is_array(get_the_category()) && count(get_the_category()) > 1) { 571 578 if ($opt['showsinglecategoryifmultiple'] === true) { 572 579 $cats = get_the_category(); … … 623 630 "@id": "'.get_category_link($cat->term_id).'", 624 631 "url": "'.get_category_link($cat->term_id).'", 625 "name": "'. addslashes($cat->name).'"632 "name": "'.str_replace('"', '', $cat->name).'" 626 633 } 627 634 }'; … … 635 642 "@id": "'.get_category_link($cat->term_id).'", 636 643 "url": "'.get_category_link($cat->term_id).'", 637 "name": "'. addslashes($cat->name).'"644 "name": "'.str_replace('"', '', $cat->name).'" 638 645 } 639 646 }'; … … 677 684 "@id": "'.$ancestor_link.'", 678 685 "url": "'.$ancestor_link.'", 679 "name": "'. addslashes($ancestor_term->name).'"686 "name": "'.str_replace('"', '', $ancestor_term->name).'" 680 687 } 681 688 }'; … … 697 704 "@id": "'.$descendant_link.'", 698 705 "url": "'.$descendant_link.'", 699 "name": "'. addslashes($descendant->name).'"706 "name": "'.str_replace('"', '', $descendant->name).'" 700 707 } 701 708 }'; … … 718 725 "@id": "'.$actual_link.'", 719 726 "url": "'.$actual_link.'", 720 "name": "'. addslashes(woocommerce_page_title( false )).'"727 "name": "'.str_replace('"', '', woocommerce_page_title( false )).'" 721 728 } 722 729 }'; … … 809 816 "@id": "'.$linker.$link['url'].'", 810 817 "url": "'.$linker.$link['url'].'", 811 "name": "'. addslashes($link['title']).'"818 "name": "'.str_replace('"', '', $link['title']).'" 812 819 } 813 820 }'; … … 824 831 825 832 $html = ''; 833 834 if ($opt['removefinal'] === true) { 835 array_pop($output); 836 } 826 837 827 838 foreach ($output as $key => $out) { … … 854 865 "@id": "'.$actual_link.'", 855 866 "url": "'.$actual_link.'", 856 "name": "'. get_the_title().'"867 "name": "'.str_replace('"', '', get_the_title()).'" 857 868 } 858 869 }';
Note: See TracChangeset
for help on using the changeset viewer.