Plugin Directory

Changeset 2453741


Ignore:
Timestamp:
01/11/2021 09:02:21 AM (5 years ago)
Author:
_luigi
Message:

Publishing version 5.2

Location:
sitetree
Files:
5 added
6 deleted
9 edited
44 copied

Legend:

Unmodified
Added
Removed
  • sitetree/tags/5.2/admin/page-controller-classes.php

    r2449056 r2453741  
    391391                // Break omitted.
    392392
    393             case 'sitemap':
    394393            case 'newsmap':   
    395394                if ( !$sitemap_active || $sitemap_filename_has_changed ){
  • sitetree/tags/5.2/data-model/global-objects-resources.php

    r2449056 r2453741  
    3030    'includes/builders/site-tree-builder.class.php'
    3131));
     32
     33$this->registerGlobalObjectResources( 'HyperlistController', array( 'includes/hyperlist-controller.class.php' ) );
    3234?>
  • sitetree/tags/5.2/data-model/site_tree-page-data.php

    r2449056 r2453741  
    124124        ),
    125125        new Field( 'limit', 'NumberField', 'positive_number', $common_l10n['limit'][0],
    126                    $common_l10n['limit'][1], 100, array( 'min_value' => 10, 'max_value' => 1000 )
     126                   $common_l10n['limit'][1], 100, array( 'min_value' => 5, 'max_value' => 1000 )
    127127        )     
    128128    ) ));
     
    150150        $post_type_section->addField( new Field( 'limit', 'NumberField',
    151151                                                 'positive_number', $common_l10n['limit'][0], $common_l10n['limit'][1], 100,
    152                                                   array( 'min_value' => 10, 'max_value' => 1000 ) ));
     152                                                  array( 'min_value' => 5, 'max_value' => 1000 ) ));
    153153
    154154        $this->registerSection( $post_type_section );
  • sitetree/tags/5.2/includes/builders/builders-interfaces.php

    r2449056 r2453741  
    5959
    6060    /**
     61     * Returns 'true' or 'false' according to whether or not the builder
     62     * is generating an hyper-list as a result of either a "shortcode call"
     63     * or Template Tag call.
     64     *
     65     * @since 5.2
     66     * @return bool
     67     */
     68    public function isDoingHyperlist();
     69
     70    /**
    6171     * @since 2.0
    6272     * @param string $string     
  • sitetree/tags/5.2/includes/builders/site-tree-builder.class.php

    r2449056 r2453741  
    7272
    7373    /**
     74     * @since 5.2
     75     * @var bool
     76     */
     77    private $doingHyperlist = false;
     78
     79    /**
    7480     * {@inheritdoc}
    7581     */
     
    106112    public function isDoingShortcode() {
    107113        return $this->doingShortcode;
     114    }
     115
     116    /**
     117     * @since 5.2
     118     * @param bool $true_or_false
     119     */
     120    public function setDoingHyperlist( $true_or_false ) {
     121        $this->doingHyperlist = $true_or_false;
     122    }
     123
     124    /**
     125     * {@inheritdoc}
     126     */
     127    public function isDoingHyperlist() {
     128        return $this->doingHyperlist;
    108129    }
    109130
     
    388409
    389410    /**
    390      * @since 4.5
     411     * @since 5.2
    391412     *
    392413     * @param string $meta_keys
     
    394415     * @return bool
    395416     */
    396     private function prepareVariablesOnDoingShortcode( &$meta_keys, &$postmeta_conditions ) {
    397         if (! $this->doingShortcode ) {
     417    private function prepareVariablesOnDoingHyperlist( &$meta_keys, &$postmeta_conditions ) {
     418        if (! $this->doingHyperlist ) {
    398419            return false;
    399420        }
     
    427448        }
    428449
    429         $list_of_ids_globally_excluded = $this->getListOption( 'include_globally_excluded' );
    430 
    431         if ( $list_of_ids_globally_excluded ) {
    432             if ( $list_of_ids_globally_excluded === true ) {
    433                 return true;
    434             }
    435 
    436             $ids_to_include = wp_parse_id_list(  $list_of_ids_globally_excluded );
    437 
    438             if ( $ids_to_include ) {
    439                 $list_of_ids_globally_excluded = implode( ',', $ids_to_include );
    440                 $postmeta_conditions .= ' AND pm.post_id NOT IN (' .  $list_of_ids_globally_excluded . ')' ;
    441             }
    442         }
    443        
    444         $meta_keys .= ',';
    445         $meta_keys .= $this->db->prepareMetaKey( 'exclude_from_shortcode_lists' );
     450        if ( $this->doingShortcode ) {
     451            $list_of_ids_globally_excluded = $this->getListOption( 'include_globally_excluded' );
     452
     453            if ( $list_of_ids_globally_excluded ) {
     454                if ( $list_of_ids_globally_excluded === true ) {
     455                    return true;
     456                }
     457
     458                $ids_to_include = wp_parse_id_list(  $list_of_ids_globally_excluded );
     459
     460                if ( $ids_to_include ) {
     461                    $list_of_ids_globally_excluded = implode( ',', $ids_to_include );
     462                    $postmeta_conditions .= ' AND pm.post_id NOT IN (' .  $list_of_ids_globally_excluded . ')' ;
     463                }
     464            }
     465           
     466            $meta_keys .= ',';
     467            $meta_keys .= $this->db->prepareMetaKey( 'exclude_from_shortcode_lists' ); 
     468        }
    446469
    447470        return true;
     
    520543        }
    521544
    522         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     545        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    523546
    524547        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
     
    563586        }
    564587
    565         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     588        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    566589
    567590        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
     
    935958        $this->appendToQueryClause( 'order_by', $order_by );
    936959
    937         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     960        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    938961
    939962        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
  • sitetree/tags/5.2/includes/core.class.php

    r2449056 r2453741  
    7878        else {
    7979            $this->load( 'includes/core-delegate.class.php' );
    80             $this->load( 'includes/shortcode-controller.class.php' );
    8180           
    82             $sitetreeDelegate    = new CoreDelegate( $this );
    83             $shortcodeController = new ShortcodeController( $this );
    84 
     81            $sitetreeDelegate = new CoreDelegate( $this );
     82           
    8583            add_action( 'wp', array( $sitetreeDelegate, 'listenToPageRequest' ), 5 );
    86             add_shortcode( 'sitetree', array( $shortcodeController, 'doShortcode' ) );
     84            add_shortcode( 'sitetree', array( $this->invokeGlobalObject( 'HyperlistController' ), 'doShortcode' ) );
    8785
    8886            if ( $there_are_google_sitemaps_active ) {
  • sitetree/tags/5.2/readme.txt

    r2449056 r2453741  
    77Tested up to: 5.6
    88Requires PHP: 5.6.20
    9 Stable tag: 5.1.3
     9Stable tag: 5.2
    1010License: GPLv3
    1111License URI: https://opensource.org/licenses/GPL-3.0
     
    3333WordPress-like settings pages together with the SiteTree Dashboard are where all your customisations take place. No need to be a developer to use SiteTree.
    3434
    35 = One Shortcode, A Myriad of Hyper-lists =
    36 
    37 You can think of the `[sitetree]` shortcode as a multipurpose tool, flexible like only a few other shortcodes: you change one attribute, and a whole new, dynamic list of hyperlinks is all set to be perused.
     35= A Myriad of Hyper-lists =
     36
     37Fully documented and always ready-to-use, the `[sitetree]` shortcode and its workmate `sitetree_get_hyperlist()` are flexible like only a few other developer tools: you change one attribute, or argument, and a whole new, dynamic list of hyperlinks is all set to be perused.
    3838
    3939= Custom Post Types Support =
     
    92924. Drag-and-drop reordering of the hyper-lists composing the Site Tree.
    93935. Metadata section.
    94 6. The Google Sitemap generated for LuigiCavalieri.com.
     946. The Site Tree of LuigiCavalieri.com, fine-tuned by Pro Leaf.
     957. The Google Sitemap generated for LuigiCavalieri.com.
    9596
    9697
     
    130131== Upgrade Notice ==
    131132
    132 = 5.1.3 =
     133= 5.2 =
    133134
    134135This update finally removes from the database the Priority and Change Frequency metadata deprecated since SiteTree 3.0.
     
    136137
    137138== Changelog ==
     139
     140= 5.2 (11 January 2020) =
     141
     142It's time to introduce a Template Tag: `sitetree_get_hyperlist()` is only awaiting the developer inside you!
     143
    138144
    139145= 5.1.3 (2 January 2021) =
  • sitetree/tags/5.2/sitetree.php

    r2449056 r2453741  
    44 * Plugin URI: https://luigicavalieri.com/sitetree/
    55 * Description: Sitemaps, Hyper-lists and Beyond.
    6  * Version: 5.1.3
     6 * Version: 5.2
    77 * Requires: 5.3
    88 * Author: Luigi Cavalieri
     
    1313 *
    1414 * @package SiteTree
    15  * @version 5.1.3
     15 * @version 5.2
    1616 * @copyright Copyright 2021 Luigi Cavalieri.
    1717 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
     
    5050    include( 'library/base-plugin.class.php' );
    5151    include( 'includes/core.class.php' );
     52    include( 'includes/template-tags.php' );
    5253
    5354    \SiteTree\Core::launch( __DIR__ );
  • sitetree/trunk/admin/page-controller-classes.php

    r2449056 r2453741  
    391391                // Break omitted.
    392392
    393             case 'sitemap':
    394393            case 'newsmap':   
    395394                if ( !$sitemap_active || $sitemap_filename_has_changed ){
  • sitetree/trunk/data-model/global-objects-resources.php

    r2449056 r2453741  
    3030    'includes/builders/site-tree-builder.class.php'
    3131));
     32
     33$this->registerGlobalObjectResources( 'HyperlistController', array( 'includes/hyperlist-controller.class.php' ) );
    3234?>
  • sitetree/trunk/data-model/site_tree-page-data.php

    r2449056 r2453741  
    124124        ),
    125125        new Field( 'limit', 'NumberField', 'positive_number', $common_l10n['limit'][0],
    126                    $common_l10n['limit'][1], 100, array( 'min_value' => 10, 'max_value' => 1000 )
     126                   $common_l10n['limit'][1], 100, array( 'min_value' => 5, 'max_value' => 1000 )
    127127        )     
    128128    ) ));
     
    150150        $post_type_section->addField( new Field( 'limit', 'NumberField',
    151151                                                 'positive_number', $common_l10n['limit'][0], $common_l10n['limit'][1], 100,
    152                                                   array( 'min_value' => 10, 'max_value' => 1000 ) ));
     152                                                  array( 'min_value' => 5, 'max_value' => 1000 ) ));
    153153
    154154        $this->registerSection( $post_type_section );
  • sitetree/trunk/includes/builders/builders-interfaces.php

    r2449056 r2453741  
    5959
    6060    /**
     61     * Returns 'true' or 'false' according to whether or not the builder
     62     * is generating an hyper-list as a result of either a "shortcode call"
     63     * or Template Tag call.
     64     *
     65     * @since 5.2
     66     * @return bool
     67     */
     68    public function isDoingHyperlist();
     69
     70    /**
    6171     * @since 2.0
    6272     * @param string $string     
  • sitetree/trunk/includes/builders/site-tree-builder.class.php

    r2449056 r2453741  
    7272
    7373    /**
     74     * @since 5.2
     75     * @var bool
     76     */
     77    private $doingHyperlist = false;
     78
     79    /**
    7480     * {@inheritdoc}
    7581     */
     
    106112    public function isDoingShortcode() {
    107113        return $this->doingShortcode;
     114    }
     115
     116    /**
     117     * @since 5.2
     118     * @param bool $true_or_false
     119     */
     120    public function setDoingHyperlist( $true_or_false ) {
     121        $this->doingHyperlist = $true_or_false;
     122    }
     123
     124    /**
     125     * {@inheritdoc}
     126     */
     127    public function isDoingHyperlist() {
     128        return $this->doingHyperlist;
    108129    }
    109130
     
    388409
    389410    /**
    390      * @since 4.5
     411     * @since 5.2
    391412     *
    392413     * @param string $meta_keys
     
    394415     * @return bool
    395416     */
    396     private function prepareVariablesOnDoingShortcode( &$meta_keys, &$postmeta_conditions ) {
    397         if (! $this->doingShortcode ) {
     417    private function prepareVariablesOnDoingHyperlist( &$meta_keys, &$postmeta_conditions ) {
     418        if (! $this->doingHyperlist ) {
    398419            return false;
    399420        }
     
    427448        }
    428449
    429         $list_of_ids_globally_excluded = $this->getListOption( 'include_globally_excluded' );
    430 
    431         if ( $list_of_ids_globally_excluded ) {
    432             if ( $list_of_ids_globally_excluded === true ) {
    433                 return true;
    434             }
    435 
    436             $ids_to_include = wp_parse_id_list(  $list_of_ids_globally_excluded );
    437 
    438             if ( $ids_to_include ) {
    439                 $list_of_ids_globally_excluded = implode( ',', $ids_to_include );
    440                 $postmeta_conditions .= ' AND pm.post_id NOT IN (' .  $list_of_ids_globally_excluded . ')' ;
    441             }
    442         }
    443        
    444         $meta_keys .= ',';
    445         $meta_keys .= $this->db->prepareMetaKey( 'exclude_from_shortcode_lists' );
     450        if ( $this->doingShortcode ) {
     451            $list_of_ids_globally_excluded = $this->getListOption( 'include_globally_excluded' );
     452
     453            if ( $list_of_ids_globally_excluded ) {
     454                if ( $list_of_ids_globally_excluded === true ) {
     455                    return true;
     456                }
     457
     458                $ids_to_include = wp_parse_id_list(  $list_of_ids_globally_excluded );
     459
     460                if ( $ids_to_include ) {
     461                    $list_of_ids_globally_excluded = implode( ',', $ids_to_include );
     462                    $postmeta_conditions .= ' AND pm.post_id NOT IN (' .  $list_of_ids_globally_excluded . ')' ;
     463                }
     464            }
     465           
     466            $meta_keys .= ',';
     467            $meta_keys .= $this->db->prepareMetaKey( 'exclude_from_shortcode_lists' ); 
     468        }
    446469
    447470        return true;
     
    520543        }
    521544
    522         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     545        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    523546
    524547        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
     
    563586        }
    564587
    565         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     588        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    566589
    567590        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
     
    935958        $this->appendToQueryClause( 'order_by', $order_by );
    936959
    937         $this->prepareVariablesOnDoingShortcode( $meta_keys, $postmeta_conditions );
     960        $this->prepareVariablesOnDoingHyperlist( $meta_keys, $postmeta_conditions );
    938961
    939962        $postmeta_conditions = sprintf( $postmeta_conditions, $meta_keys );
  • sitetree/trunk/includes/core.class.php

    r2449056 r2453741  
    7878        else {
    7979            $this->load( 'includes/core-delegate.class.php' );
    80             $this->load( 'includes/shortcode-controller.class.php' );
    8180           
    82             $sitetreeDelegate    = new CoreDelegate( $this );
    83             $shortcodeController = new ShortcodeController( $this );
    84 
     81            $sitetreeDelegate = new CoreDelegate( $this );
     82           
    8583            add_action( 'wp', array( $sitetreeDelegate, 'listenToPageRequest' ), 5 );
    86             add_shortcode( 'sitetree', array( $shortcodeController, 'doShortcode' ) );
     84            add_shortcode( 'sitetree', array( $this->invokeGlobalObject( 'HyperlistController' ), 'doShortcode' ) );
    8785
    8886            if ( $there_are_google_sitemaps_active ) {
  • sitetree/trunk/readme.txt

    r2449056 r2453741  
    77Tested up to: 5.6
    88Requires PHP: 5.6.20
    9 Stable tag: 5.1.3
     9Stable tag: 5.2
    1010License: GPLv3
    1111License URI: https://opensource.org/licenses/GPL-3.0
     
    3333WordPress-like settings pages together with the SiteTree Dashboard are where all your customisations take place. No need to be a developer to use SiteTree.
    3434
    35 = One Shortcode, A Myriad of Hyper-lists =
    36 
    37 You can think of the `[sitetree]` shortcode as a multipurpose tool, flexible like only a few other shortcodes: you change one attribute, and a whole new, dynamic list of hyperlinks is all set to be perused.
     35= A Myriad of Hyper-lists =
     36
     37Fully documented and always ready-to-use, the `[sitetree]` shortcode and its workmate `sitetree_get_hyperlist()` are flexible like only a few other developer tools: you change one attribute, or argument, and a whole new, dynamic list of hyperlinks is all set to be perused.
    3838
    3939= Custom Post Types Support =
     
    92924. Drag-and-drop reordering of the hyper-lists composing the Site Tree.
    93935. Metadata section.
    94 6. The Google Sitemap generated for LuigiCavalieri.com.
     946. The Site Tree of LuigiCavalieri.com, fine-tuned by Pro Leaf.
     957. The Google Sitemap generated for LuigiCavalieri.com.
    9596
    9697
     
    130131== Upgrade Notice ==
    131132
    132 = 5.1.3 =
     133= 5.2 =
    133134
    134135This update finally removes from the database the Priority and Change Frequency metadata deprecated since SiteTree 3.0.
     
    136137
    137138== Changelog ==
     139
     140= 5.2 (11 January 2020) =
     141
     142It's time to introduce a Template Tag: `sitetree_get_hyperlist()` is only awaiting the developer inside you!
     143
    138144
    139145= 5.1.3 (2 January 2021) =
  • sitetree/trunk/sitetree.php

    r2449056 r2453741  
    44 * Plugin URI: https://luigicavalieri.com/sitetree/
    55 * Description: Sitemaps, Hyper-lists and Beyond.
    6  * Version: 5.1.3
     6 * Version: 5.2
    77 * Requires: 5.3
    88 * Author: Luigi Cavalieri
     
    1313 *
    1414 * @package SiteTree
    15  * @version 5.1.3
     15 * @version 5.2
    1616 * @copyright Copyright 2021 Luigi Cavalieri.
    1717 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
     
    5050    include( 'library/base-plugin.class.php' );
    5151    include( 'includes/core.class.php' );
     52    include( 'includes/template-tags.php' );
    5253
    5354    \SiteTree\Core::launch( __DIR__ );
Note: See TracChangeset for help on using the changeset viewer.