Plugin Directory

Changeset 3215060


Ignore:
Timestamp:
12/31/2024 12:38:59 AM (15 months ago)
Author:
mtekk
Message:

pre-7.4.0 commit

Location:
breadcrumb-navxt/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • breadcrumb-navxt/trunk/breadcrumb-navxt.php

    r3102953 r3215060  
    44Plugin URI: http://mtekk.us/code/breadcrumb-navxt/
    55Description: Adds a breadcrumb navigation showing the visitor&#39;s path to their current location. For details on how to use this plugin visit <a href="http://mtekk.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
    6 Version: 7.3.1
     6Version: 7.4.0
    77Author: John Havlik
    88Author URI: http://mtekk.us/
     
    6464class breadcrumb_navxt
    6565{
    66     const version = '7.3.1';
     66    const version = '7.4.0';
    6767    protected $name = 'Breadcrumb NavXT';
    6868    protected $identifier = 'breadcrumb-navxt';
     
    726726}
    727727//Have to bootstrap our startup so that other plugins can replace the bcn_breadcrumb_trail object if they need to
    728 add_action('plugins_loaded', 'bcn_init', 15);
     728add_action('init', 'bcn_init', 5);
    729729function bcn_init()
    730730{
  • breadcrumb-navxt/trunk/class.bcn_admin.php

    r3102953 r3215060  
    4545class bcn_admin extends adminKit
    4646{
    47     const version = '7.3.1';
     47    const version = '7.4.0';
    4848    protected $full_name = 'Breadcrumb NavXT Settings';
    4949    protected $short_name = 'Breadcrumb NavXT';
     
    575575                        </th>
    576576                        <td>
    577                             <?php wp_dropdown_pages(
    578                                     array('name' => $this->unique_prefix . '_options[apost_' . $post_type->name . '_root]',
     577                            <?php wp_dropdown_pages( apply_filters(
     578                                    'bcn_admin_post_root_args',
     579                                        array('name' => $this->unique_prefix . '_options[apost_' . $post_type->name . '_root]',
    579580                                            'id' => $optid,
    580581                                            'echo' => 1,
     
    582583                                            'option_none_value' => '0',
    583584                                            'selected' => $this->settings['apost_' . $post_type->name . '_root']->get_value(),
    584                                             'class' => $overriden_style['apost_' . $post_type->name . '_root']));
     585                                            'class' => $overriden_style['apost_' . $post_type->name . '_root']),
     586                                    $post_type->name
     587                                    ));
    585588                            if(isset($overriden['apost_' . $post_type->name . '_root']) && $overriden['apost_' . $post_type->name . '_root'] !== '')
    586589                            {
  • breadcrumb-navxt/trunk/class.bcn_breadcrumb.php

    r3102953 r3215060  
    2222{
    2323    //Our member variables
    24     const version = '7.3.1';
     24    const version = '7.4.0';
    2525    //The main text that will be shown
    2626    protected $title;
  • breadcrumb-navxt/trunk/class.bcn_breadcrumb_trail.php

    r3102953 r3215060  
    2222{
    2323    //Our member variables
    24     const version = '7.3.1';
     24    const version = '7.4.0';
    2525    //An array of breadcrumbs
    2626    public $breadcrumbs = array();
     
    326326     * @param int $parent (optional) The id of the parent of the current post, used if hiearchal posts will be the "taxonomy" for the current post
    327327     */
     328    //TODO/FIXME Move to passing in WP_POST instead of id, type and parent
    328329    protected function post_hierarchy($id, $type, $parent = null)
    329330    {
     
    393394        {
    394395            $parent = get_post($id);
     396            if(!($parent instanceof WP_Post))
     397            {
     398                return;
     399            }
    395400        }
    396401        //Finish off with trying to find the type archive
     
    10061011     * Breadcrumb Trail Filling Function
    10071012     *
    1008      * @param bool $force Whether or not to force the fill function to run in the loop.
     1013     * @param bool $use_loop_post Whether or not to generate for the post within the loop or the page containing the loop (usually an archive of some sort)
    10091014     *
    10101015     * This functions fills the breadcrumb trail.
    10111016     */
    1012     public function fill($force = false)
     1017    public function fill($use_loop_post = false)
    10131018    {
    10141019        global $wpdb, $wp_query, $wp, $wp_taxonomies;
     
    10471052        }
    10481053        //For the front page, as it may also validate as a page, do it first
    1049         if(is_front_page() && !$force)
     1054        if(is_front_page() && (!$use_loop_post || !in_the_loop()))
    10501055        {
    10511056            //Must have two seperate branches so that we don't evaluate it as a page
     
    10561061        }
    10571062        //For posts
    1058         else if(is_singular() || ($force && in_the_loop()))
     1063        else if(is_singular() || ($use_loop_post && in_the_loop()))
    10591064        {
    10601065            //Could use the $post global, but we can't really trust it
     
    10621067            $this->do_post($type, false, (get_query_var('page') > 1));
    10631068            //If this is an attachment then we need to change the queried object to the parent post
    1064             if(is_attachment())
    1065             {
    1066                 $type = get_post($type->post_parent); //TODO check for WP_Error?
     1069            if(is_attachment() && $type instanceof WP_Post)
     1070            {
     1071                $type = get_post($type->post_parent);
    10671072            }
    10681073            if($type instanceof WP_Post)
     
    11551160        }
    11561161        //We always do the home link last, unless on the frontpage
    1157         if(!is_front_page())
     1162        if(!is_front_page() || ($use_loop_post && in_the_loop()))
    11581163        {
    11591164            $this->do_home(true, false, false);
  • breadcrumb-navxt/trunk/class.bcn_network_admin.php

    r3102953 r3215060  
    3030class bcn_network_admin extends bcn_admin
    3131{
    32     const version = '7.3.1';
     32    const version = '7.4.0';
    3333    protected $full_name = 'Breadcrumb NavXT Network Settings';
    3434    protected $access_level = 'manage_network_options';
  • breadcrumb-navxt/trunk/class.bcn_widget.php

    r3102953 r3215060  
    2020class bcn_widget extends WP_Widget
    2121{
    22     const version = '7.3.1';
     22    const version = '7.4.0';
    2323    protected $allowed_html = array();
    2424    protected $defaults = array('title' => '', 'pretext' => '', 'type' => 'microdata', 'linked' => true, 'reverse' => false, 'front' => false, 'force' => false);
Note: See TracChangeset for help on using the changeset viewer.