Changeset 2690310
- Timestamp:
- 03/07/2022 06:45:57 PM (4 years ago)
- Location:
- breadcrumb-tmc
- Files:
-
- 4 added
- 7 edited
-
tags/1.3.6 (added)
-
tags/1.3.6/assets (added)
-
tags/1.3.6/lib (added)
-
tags/1.3.6/src (added)
-
trunk/assets/css/style.css (modified) (1 diff)
-
trunk/breadcrumb-tmc.php (modified) (1 diff)
-
trunk/lib/SundaWP/SundaWP.php (modified) (8 diffs)
-
trunk/lib/SundaWP/SundaWP_requirementChecker.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/BreadcrumbGenerator.php (modified) (10 diffs)
-
trunk/src/app.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
breadcrumb-tmc/trunk/assets/css/style.css
r2515313 r2690310 2 2 * Plugin Name: Breadcrumb TMC 3 3 **/ 4 5 4 ol.breadcrumb-tmc { 6 5 list-style-type: none; -
breadcrumb-tmc/trunk/breadcrumb-tmc.php
r2604510 r2690310 5 5 * Plugin URI: https://wordpress.org/plugins/breadcrumb-tmc/ 6 6 * Description: Agile WordPress plugin to create Breadcrumb. Quick use <code>[breadcrumb-tmc]</code> to display breadcrumb. 7 * Version: 1.3. 77 * Version: 1.3.8 8 8 * Requires at least: 5.0 9 9 * Requires PHP: 5.6 -
breadcrumb-tmc/trunk/lib/SundaWP/SundaWP.php
r2515313 r2690310 29 29 30 30 if( null === $more ) { 31 $more = __( '…' );31 $more = __( '…', 'breadcrumb-tmc' ); 32 32 } 33 33 … … 346 346 347 347 if( null === $more ) { 348 $more = __( '…' );348 $more = __( '…', 'breadcrumb-tmc' ); 349 349 } 350 350 … … 447 447 if( null === $more ) { 448 448 449 $more = __( '…' );449 $more = __( '…', 'breadcrumb-tmc' ); 450 450 451 451 } … … 487 487 if( null === $more ) { 488 488 489 $more = __( '…' );489 $more = __( '…', 'breadcrumb-tmc' ); 490 490 491 491 } … … 502 502 503 503 } 504 505 /**506 * Returns Page Not Found Label507 *508 * @return string|bool509 */510 511 public static function getPageNotFoundLabel() {512 513 // ----------------------------------------514 // 404 - Page Not Found515 // ----------------------------------------516 517 518 $label = '404';519 520 // Return521 522 return $label;523 }524 504 525 505 … … 594 574 if ( null === $args['more'] ) { 595 575 596 $args['more'] = __( '…' );576 $args['more'] = __( '…', 'breadcrumb-tmc' ); 597 577 } 598 578 … … 625 605 return false; 626 606 } 627 628 607 } 629 608 … … 680 659 return false; 681 660 } 682 683 661 } 684 662 -
breadcrumb-tmc/trunk/lib/SundaWP/SundaWP_requirementChecker.php
r2358215 r2690310 13 13 protected $currentVersionPHP; 14 14 protected $currentVersionWP; 15 16 15 protected $warnings = array(); 17 16 … … 21 20 */ 22 21 23 24 22 public function __construct() { 25 23 … … 28 26 29 27 add_action( 'admin_notices', array( $this, 'printAdminNotices' ) ); 28 } 30 29 31 }32 30 33 31 public function checkVersionPHP( $requiredVersionPHP, $errorMsg = null, $args = 'updated notice is-dismissible' ) { … … 37 35 'message' => $errorMsg, 38 36 'class' => $args 39 40 37 ); 41 38 … … 51 48 52 49 case 0: 53 $isSatisfied = true;54 break;55 56 50 case 1: 57 51 $isSatisfied = true; … … 62 56 $this->addWarning( $msgArgs ); 63 57 break; 64 65 58 } 66 59 … … 72 65 73 66 return $isSatisfied; 67 } 74 68 75 }76 69 77 70 public function checkVersionWP( $requiredVersionWP, $errorMsg = null, $args = 'updated notice is-dismissible' ) { … … 81 74 'message' => $errorMsg, 82 75 'class' => $args 83 84 76 ); 85 77 … … 95 87 96 88 case 0: 97 $isSatisfied = true;98 break;99 100 89 case 1: 101 90 $isSatisfied = true; … … 106 95 $this->addWarning( $msgArgs ); 107 96 break; 108 109 97 } 110 98 … … 116 104 117 105 return $isSatisfied; 118 119 106 } 120 107 … … 123 110 124 111 $this->warnings[] = $msg; 125 126 112 } 127 113 … … 132 118 133 119 printf( '<div class="%1$s"><p>%2$s</p></div>', $warning['class'], $warning['message'] ); 134 135 120 } 136 137 121 } 138 122 } -
breadcrumb-tmc/trunk/readme.txt
r2604510 r2690310 2 2 Contributors: jetplugs, themastercut, wptmcdev 3 3 Donate Link: https://jetplugs.com/ 4 Tags: breadcrumb, breadcrumb shortcode, breadcrumb trail, breadcrumb navigation4 Tags: breadcrumb, trail, breadcrumb shortcode, breadcrumb trail, breadcrumb navigation 5 5 Requires at least: 5.0 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.8 8 Stable tag: 1.3. 78 Stable tag: 1.3.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 94 94 == Changelog == 95 95 96 = 1.3.8 = 97 Release date: March 7, 2022 98 99 - Tested with WordPress 5.9.1 100 - Refactor: Remove wp_trim_words from Home Label 101 96 102 = 1.3.7 = 97 103 Release date: September 24, 2021 -
breadcrumb-tmc/trunk/src/BreadcrumbGenerator.php
r2604510 r2690310 3 3 /** 4 4 * @author: przemyslaw.jaworowski@gmail.com 5 * Date: 202 0-03-155 * Date: 2022-03-07 6 6 * Time: 06:06 7 7 */ 8 8 9 namespace breadcrumb_tmc\v1_3_ 6;9 namespace breadcrumb_tmc\v1_3_8; 10 10 use pathnode\PathNode; 11 11 use sundawp\v1_0_9\SundaWP; … … 26 26 /** @var string[] $nodes */ 27 27 $nodes = array(); 28 29 28 30 29 // Apply filter - Trim Words … … 45 44 if ( SundaWP::getHomePathLinkHtml() ) { 46 45 47 $homeText = apply_filters( 'homeText', __( 'Home', 'breadcrumb-tmc') ); /* Deprecated */46 $homeText = apply_filters( 'homeText', __( 'Home', 'breadcrumb-tmc' ) ); /* Deprecated */ 48 47 $homeText = apply_filters( 'breadcrumbTmc/homeLabel', $homeText ); 49 48 50 49 $homeNode = new PathNode(); 51 $homeNode->setLabel( wp_trim_words( $homeText, $trimWords, $endingCharacter ));50 $homeNode->setLabel( $homeText ); 52 51 $homeNode->setHref( get_home_url() ); 53 52 $homeNode->setPriority( 100 ); … … 64 63 if ( ( ( is_archive() || is_single() || is_home() ) and !is_front_page() ) and SundaWP::getArchiveUrl() ) { 65 64 66 $archiveLabel = apply_filters( 'breadcrumbTmc/archiveLabel', __( null, 'breadcrumb-tmc' ) );65 $archiveLabel = apply_filters( 'breadcrumbTmc/archiveLabel', __( null, 'breadcrumb-tmc' ) ); 67 66 68 67 if ( !$archiveLabel ) { … … 145 144 while( $postParentId ){ 146 145 147 $ ParentNode = new PathNode();148 $ ParentNode->setLabel( get_the_title( $postParentId ) );149 $ ParentNode->setHref( get_permalink( $postParentId ) );150 $ ParentNode->setPriority( 400 );151 $ ParentNode->setSeparator( $separatorMark );152 153 $parentNodes[] = $ ParentNode;146 $parentNode = new PathNode(); 147 $parentNode->setLabel( get_the_title( $postParentId ) ); 148 $parentNode->setHref( get_permalink( $postParentId ) ); 149 $parentNode->setPriority( 400 ); 150 $parentNode->setSeparator( $separatorMark ); 151 152 $parentNodes[] = $parentNode; 154 153 155 154 $postParentId = wp_get_post_parent_id( $postParentId ); … … 175 174 if ( $terms ){ 176 175 176 $termsNodes = array(); 177 177 178 foreach( $terms as $term ){ 178 179 179 $termLink = get_term_link( $term->term_id, $termsTaxonomy ); 180 $termName = $term->name; 181 $TermsNode = new PathNode(); 182 $TermsNode->setLabel( $termName ); 183 $TermsNode->setHref( $termLink ); 184 $TermsNode->setPriority( 500 ); 185 $TermsNode->setSeparator( $separatorMark ); 186 187 $TermsNodes[] = $TermsNode; 180 $termsLink = get_term_link( $term->term_id, $termsTaxonomy ); 181 $termsName = $term->name; 182 183 $termsNode = new PathNode(); 184 $termsNode->setLabel( $termsName ); 185 $termsNode->setHref( $termsLink ); 186 $termsNode->setPriority( 500 ); 187 $termsNode->setSeparator( $separatorMark ); 188 189 $termsNodes[] = $termsNode; 188 190 } 189 191 190 $nodes = array_merge( $nodes, $ TermsNodes );192 $nodes = array_merge( $nodes, $termsNodes ); 191 193 } 192 194 193 195 194 $ SingleNode = new PathNode();195 $ SingleNode->setLabel( wp_trim_words( SundaWP::getSingleLabel(), $trimWords, $endingCharacter ) );196 $ SingleNode->setHref( SundaWP::getSingleUrl() );197 $ SingleNode->setPriority( 600 );198 $ SingleNode->setSeparator( $separatorMark );199 200 $nodes[] = $ SingleNode;196 $singleNode = new PathNode(); 197 $singleNode->setLabel( wp_trim_words( SundaWP::getSingleLabel(), $trimWords, $endingCharacter ) ); 198 $singleNode->setHref( SundaWP::getSingleUrl() ); 199 $singleNode->setPriority( 600 ); 200 $singleNode->setSeparator( $separatorMark ); 201 202 $nodes[] = $singleNode; 201 203 } 202 204 … … 209 211 210 212 $pageNotFoundNode = new PathNode(); 211 $pageNotFoundNode->setLabel( wp_trim_words( SundaWP::getPageNotFoundLabel(), $trimWords, $endingCharacter ) );213 $pageNotFoundNode->setLabel( wp_trim_words( __( '404','breadcrumb-tmc' ), $trimWords, $endingCharacter ) ); 212 214 $pageNotFoundNode->setHref( SundaWP::getPageNotFoundUrl() ); 213 215 $pageNotFoundNode->setPriority( 700 ); … … 217 219 } 218 220 221 219 222 // ---------------------------------------- 220 223 // Search 221 224 // ---------------------------------------- 222 225 223 224 226 if ( is_search() ) { 225 227 226 $search = new PathNode();227 $search ->setLabel( wp_trim_words( __('Search results','breadcrumb-tmc' ), $trimWords, $endingCharacter ) );228 $search ->setHref( $current_url );229 $search ->setPriority( 800 );230 $search ->setSeparator( $separatorMark );231 232 $nodes[] = $search ;228 $searchNode = new PathNode(); 229 $searchNode->setLabel( wp_trim_words( __( 'Search results','breadcrumb-tmc' ), $trimWords, $endingCharacter ) ); 230 $searchNode->setHref( $current_url ); 231 $searchNode->setPriority( 800 ); 232 $searchNode->setSeparator( $separatorMark ); 233 234 $nodes[] = $searchNode; 233 235 } 234 236 … … 253 255 $i++; 254 256 255 $nodeElement = sprintf( '<li>%1$s</li>', $node->getDisplay() );256 $nodeSeparator = sprintf( '<span class="breadcrumb-tmc-separator"> %1$s </span>', $node->getSeparator() );257 $nodeElement = sprintf( '<li>%1$s</li>', $node->getDisplay() ); 258 $nodeSeparator = sprintf( '<span class="breadcrumb-tmc-separator"> %1$s </span>', $node->getSeparator() ); 257 259 258 260 if ( $i == $numOfArrayElements ) { … … 268 270 // Lets rock! 269 271 270 return '<ol class="breadcrumb-tmc">'.implode( '', $nodesString ).'</ol>';272 return '<ol class="breadcrumb-tmc">'.implode( '', $nodesString ).'</ol>'; 271 273 } 272 274 -
breadcrumb-tmc/trunk/src/app.php
r2515313 r2690310 8 8 9 9 10 use breadcrumb_tmc\v1_3_ 6\BreadcrumbGenerator;10 use breadcrumb_tmc\v1_3_8\BreadcrumbGenerator; 11 11 12 12 if ( ! class_exists( 'pathnode\PathNode' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.