Plugin Directory

Changeset 2690310


Ignore:
Timestamp:
03/07/2022 06:45:57 PM (4 years ago)
Author:
wptmcdev
Message:
  • Tested with WordPress 5.9.1
  • Refactor: Remove wp_trim_words from Home Label
Location:
breadcrumb-tmc
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • breadcrumb-tmc/trunk/assets/css/style.css

    r2515313 r2690310  
    22 * Plugin Name: Breadcrumb TMC
    33**/
    4 
    54ol.breadcrumb-tmc {
    65  list-style-type: none;
  • breadcrumb-tmc/trunk/breadcrumb-tmc.php

    r2604510 r2690310  
    55 * Plugin URI:        https://wordpress.org/plugins/breadcrumb-tmc/
    66 * Description:       Agile WordPress plugin to create Breadcrumb. Quick use <code>[breadcrumb-tmc]</code> to display breadcrumb.
    7  * Version:           1.3.7
     7 * Version:           1.3.8
    88 * Requires at least: 5.0
    99 * Requires PHP:      5.6
  • breadcrumb-tmc/trunk/lib/SundaWP/SundaWP.php

    r2515313 r2690310  
    2929
    3030        if( null === $more ) {
    31             $more = __( '&hellip;' );
     31            $more = __( '&hellip;', 'breadcrumb-tmc' );
    3232        }
    3333
     
    346346
    347347        if( null === $more ) {
    348             $more = __( '&hellip;' );
     348            $more = __( '&hellip;', 'breadcrumb-tmc' );
    349349        }
    350350
     
    447447        if( null === $more ) {
    448448
    449             $more = __( '&hellip;' );
     449            $more = __( '&hellip;', 'breadcrumb-tmc' );
    450450
    451451        }
     
    487487        if( null === $more ) {
    488488
    489             $more = __( '&hellip;' );
     489            $more = __( '&hellip;', 'breadcrumb-tmc' );
    490490
    491491        }
     
    502502
    503503    }
    504 
    505     /**
    506      * Returns Page Not Found Label
    507      *
    508      * @return string|bool
    509      */
    510 
    511     public static function getPageNotFoundLabel() {
    512 
    513         //  ----------------------------------------
    514         //  404 - Page Not Found
    515         //  ----------------------------------------
    516 
    517 
    518         $label = '404';
    519 
    520         //  Return
    521 
    522         return $label;
    523     }
    524504
    525505
     
    594574        if ( null === $args['more'] ) {
    595575
    596             $args['more'] = __( '&hellip;' );
     576            $args['more'] = __( '&hellip;', 'breadcrumb-tmc' );
    597577        }
    598578
     
    625605            return false;
    626606        }
    627 
    628607    }
    629608
     
    680659            return false;
    681660        }
    682 
    683661    }
    684662
  • breadcrumb-tmc/trunk/lib/SundaWP/SundaWP_requirementChecker.php

    r2358215 r2690310  
    1313    protected $currentVersionPHP;
    1414    protected $currentVersionWP;
    15 
    1615    protected $warnings = array();
    1716
     
    2120     */
    2221
    23 
    2422    public function __construct() {
    2523
     
    2826
    2927        add_action( 'admin_notices', array( $this, 'printAdminNotices' ) );
     28    }
    3029
    31     }
    3230
    3331    public function checkVersionPHP( $requiredVersionPHP, $errorMsg = null, $args = 'updated notice is-dismissible' ) {
     
    3735            'message'  => $errorMsg,
    3836            'class'    => $args
    39 
    4037        );
    4138
     
    5148
    5249            case 0:
    53                 $isSatisfied = true;
    54                 break;
    55 
    5650            case 1:
    5751                $isSatisfied = true;
     
    6256                $this->addWarning( $msgArgs );
    6357                break;
    64 
    6558        }
    6659
     
    7265
    7366        return $isSatisfied;
     67    }
    7468
    75     }
    7669
    7770    public function checkVersionWP( $requiredVersionWP, $errorMsg = null, $args = 'updated notice is-dismissible' ) {
     
    8174            'message'  => $errorMsg,
    8275            'class'    => $args
    83 
    8476        );
    8577
     
    9587
    9688            case 0:
    97                 $isSatisfied = true;
    98                 break;
    99 
    10089            case 1:
    10190                $isSatisfied = true;
     
    10695                $this->addWarning( $msgArgs );
    10796                break;
    108 
    10997        }
    11098
     
    116104
    117105        return $isSatisfied;
    118 
    119106    }
    120107
     
    123110
    124111        $this->warnings[] = $msg;
    125 
    126112    }
    127113
     
    132118
    133119            printf( '<div class="%1$s"><p>%2$s</p></div>', $warning['class'], $warning['message'] );
    134 
    135120        }
    136 
    137121    }
    138122}
  • breadcrumb-tmc/trunk/readme.txt

    r2604510 r2690310  
    22Contributors: jetplugs, themastercut, wptmcdev
    33Donate Link: https://jetplugs.com/
    4 Tags: breadcrumb, breadcrumb shortcode, breadcrumb trail, breadcrumb navigation
     4Tags: breadcrumb, trail, breadcrumb shortcode, breadcrumb trail, breadcrumb navigation
    55Requires at least: 5.0
    66Requires PHP: 5.6
    77Tested up to: 5.8
    8 Stable tag: 1.3.7
     8Stable tag: 1.3.8
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9494== Changelog ==
    9595
     96= 1.3.8  =
     97Release date: March 7, 2022
     98
     99- Tested with WordPress 5.9.1
     100- Refactor: Remove wp_trim_words from Home Label
     101
    96102= 1.3.7  =
    97103Release date: September 24, 2021
  • breadcrumb-tmc/trunk/src/BreadcrumbGenerator.php

    r2604510 r2690310  
    33/**
    44 * @author: przemyslaw.jaworowski@gmail.com
    5  * Date: 2020-03-15
     5 * Date: 2022-03-07
    66 * Time: 06:06
    77 */
    88
    9 namespace breadcrumb_tmc\v1_3_6;
     9namespace breadcrumb_tmc\v1_3_8;
    1010use pathnode\PathNode;
    1111use sundawp\v1_0_9\SundaWP;
     
    2626        /** @var string[] $nodes */
    2727        $nodes = array();
    28 
    2928
    3029        //  Apply filter - Trim Words
     
    4544        if ( SundaWP::getHomePathLinkHtml() ) {
    4645
    47             $homeText  = apply_filters( 'homeText', __('Home', 'breadcrumb-tmc') ); /* Deprecated */
     46            $homeText  = apply_filters( 'homeText', __( 'Home', 'breadcrumb-tmc' ) ); /* Deprecated */
    4847            $homeText  = apply_filters( 'breadcrumbTmc/homeLabel', $homeText );
    4948
    5049            $homeNode  = new PathNode();
    51             $homeNode->setLabel( wp_trim_words( $homeText, $trimWords, $endingCharacter ) );
     50            $homeNode->setLabel( $homeText );
    5251            $homeNode->setHref( get_home_url() );
    5352            $homeNode->setPriority( 100 );
     
    6463        if ( ( ( is_archive() || is_single() || is_home() ) and !is_front_page() ) and SundaWP::getArchiveUrl() ) {
    6564
    66             $archiveLabel = apply_filters( 'breadcrumbTmc/archiveLabel', __( null, 'breadcrumb-tmc') );
     65            $archiveLabel = apply_filters( 'breadcrumbTmc/archiveLabel', __( null, 'breadcrumb-tmc' ) );
    6766
    6867            if ( !$archiveLabel ) {
     
    145144            while( $postParentId ){
    146145
    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;
    154153
    155154                $postParentId = wp_get_post_parent_id( $postParentId );
     
    175174            if ( $terms ){
    176175
     176                $termsNodes = array();
     177
    177178                foreach( $terms as $term ){
    178179
    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;
    188190                }
    189191
    190                 $nodes = array_merge( $nodes, $TermsNodes );
     192                $nodes = array_merge( $nodes, $termsNodes );
    191193            }
    192194
    193195
    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;
    201203        }
    202204
     
    209211
    210212            $pageNotFoundNode = new PathNode();
    211             $pageNotFoundNode->setLabel( wp_trim_words( SundaWP::getPageNotFoundLabel(), $trimWords, $endingCharacter ) );
     213            $pageNotFoundNode->setLabel( wp_trim_words( __( '404','breadcrumb-tmc' ), $trimWords, $endingCharacter ) );
    212214            $pageNotFoundNode->setHref( SundaWP::getPageNotFoundUrl() );
    213215            $pageNotFoundNode->setPriority( 700 );
     
    217219        }
    218220
     221
    219222        //  ----------------------------------------
    220223        //  Search
    221224        //  ----------------------------------------
    222225
    223 
    224226        if ( is_search() ) {
    225227
    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;
    233235        }
    234236
     
    253255            $i++;
    254256
    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() );
    257259
    258260            if ( $i == $numOfArrayElements ) {
     
    268270        //  Lets rock!
    269271
    270         return '<ol class="breadcrumb-tmc">'.implode( '', $nodesString).'</ol>';
     272        return '<ol class="breadcrumb-tmc">'.implode( '', $nodesString ).'</ol>';
    271273    }
    272274
  • breadcrumb-tmc/trunk/src/app.php

    r2515313 r2690310  
    88
    99
    10 use breadcrumb_tmc\v1_3_6\BreadcrumbGenerator;
     10use breadcrumb_tmc\v1_3_8\BreadcrumbGenerator;
    1111
    1212if ( ! class_exists( 'pathnode\PathNode' ) ) {
Note: See TracChangeset for help on using the changeset viewer.