Plugin Directory

Changeset 2853610


Ignore:
Timestamp:
01/24/2023 02:22:30 PM (3 years ago)
Author:
jakeparis
Message:
  • Remove default list setting
  • Test against WP 6.1
Location:
bestseller-lists-from-new-york-times/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bestseller-lists-from-new-york-times/trunk/admin-page.php

    r2719463 r2853610  
    1010        nytBestsellerListings::setApiKey( $_POST['nyt_bestseller_listings_apiKey']);
    1111
    12         if( isset($_POST['nyt_bestseller_listings_defaultList']) ){
    13             nytBestsellerListings::setDefaultList( $_POST['nyt_bestseller_listings_defaultList']);
    14         }
    15 
    1612        nytBestsellerListings::setCatalogLinkFormat($_POST['nyt_bestseller_listings_CatalogLinkFormat']);
    1713    }
     
    2016
    2117$apiKey = nytBestsellerListings::getApiKey();
    22 $defaultList = nytBestsellerListings::getDefaultList();
    2318$catalogLinkFormat = nytBestsellerListings::getCatalogLinkFormat();
    2419?>
     
    4843    <input type="text" class="wide" name="nyt_bestseller_listings_apiKey" value="<?= esc_attr($apiKey) ?>">
    4944
    50     <?php
    51     $results = nytBestsellerListings::getResults('names.json');
    52     if( $results ){
    53         $lists = $results->results;
    54         ?>
    55         <label class="block">Default List</label>
    56         <select name="nyt_bestseller_listings_defaultList">
    57             <?php
    58             foreach($lists as $list){
    59                 $selected = ($defaultList == $list->list_name_encoded)
    60                     ? ' selected '
    61                     : '';
    62                 echo '<option value="'.esc_attr($list->list_name_encoded).'" '.$selected.'>'.$list->list_name.'</option>'."\n";
    63             }
    64             ?>
    65         </select>
    66         <?php
    67     }
    68     ?>
    6945
    7046    <label class="block">Catalog Links</label>
  • bestseller-lists-from-new-york-times/trunk/index.php

    r2719463 r2853610  
    22/*
    33Plugin Name: Bestseller Lists from the New York Times
    4 Plugin URI:  https://jake.paris/wordpress-plugins/
     4Plugin URI:  https://jakeparis.com/wordpress-plugins/
    55Description: Integrate bestseller lists from the New York Times into your own site with a user-friendly interface.
    6 Version:     2.0.2
     6Version:     2.1.0
    77Requires PHP: 5.4
    88Requires at least: 4.9
    9 Tested up to: 6.0.0
     9Tested up to: 6.1.0
    1010Author:      Jake Paris
    11 Author URI:  https://jake.paris/
     11Author URI:  https://jakeparis.com/
    1212License:     GPL-3.0
    1313License URI: https://opensource.org/licenses/GPL-3.0
    1414*/
    1515
    16 define('BSLNYT_PLUGIN_VERSION', '2.0.2');
     16define('BSLNYT_PLUGIN_VERSION', '2.1.0');
    1717define('BSLNYT_PLUGIN_PATH', plugin_dir_path(__FILE__) );
    1818define('BSLNYT_PLUGIN_URL', plugins_url('/', __FILE__) );
  • bestseller-lists-from-new-york-times/trunk/nytBestsellerListings.class.php

    r2705824 r2853610  
    1414    }
    1515
    16     static function setDefaultList($v){
    17         $v = sanitize_text_field( $v );
    18         return update_option( self::$optionsName . "_defaultList", $v);
    19     }
    2016    static function getDefaultList(){
    21         return get_option( self::$optionsName . "_defaultList", 'hardcover-fiction');
     17        return 'hardcover-fiction';
    2218    }
    2319
  • bestseller-lists-from-new-york-times/trunk/plugin_updates.php

    r2705824 r2853610  
    2222    delete_option("{self::}_apiKey");
    2323
    24     $defaultList = get_option( "{self::}_defaultList", 'hardcover-fiction');
    25     nytBestsellerListings::setDefaultList( $defaultList );
     24    // $defaultList = get_option( "{self::}_defaultList", 'hardcover-fiction');
     25    // nytBestsellerListings::setDefaultList( $defaultList );
    2626    delete_option( "{self::}_defaultList");
    2727
     
    3333}
    3434
     35// remove global default list
     36if( version_compare( '2.1.0', $bslnyt_stored_version, '>' ) ) {
     37    delete_option('nyt_bestseller_listings_defaultList');
     38}
     39
    3540
    3641
  • bestseller-lists-from-new-york-times/trunk/readme.txt

    r2719463 r2853610  
    11=== Bestseller Lists from the New York Times===
    22Contributors: jakeparis
    3 Donate link: https://jake.paris/
     3Donate link: https://jakeparis.com/
    44Tags: books, library, bestsellers, libraries, reading lists
    55Requires at least: 4.9
     
    1818== Use ==
    1919
    20 = WordPress 5.0 =
     20= WordPress 5+ =
    2121Use the *Bestseller Lists from NYT* block. You can optionally specify which list is initially displayed.
    2222
    23 = WordPress 4.x =
     23= WordPress 4 =
    2424Use the `[nyt-bestseller-listings]` shortcode to embed the lists in your page. You can optionally specify which list is initially displayed by using the `initial-list` attribute with the list slug as the attribute value. Get the list slug by first placing the shortcode in your page, then visiting the page and changing lists. The page url will change as the list changes, and the list slug can be seen by looking for **nyt-list=SLUG-HERE** in your browser's url bar. So for example, to place the lists on a page and set the initial list to be children's picture books, you would use: `[nyt-bestseller-listings initial-list="picture-books"]`
    2525
     
    3737= How do I change which list shows up first? =
    3838
    39 You can set this at a global level on the administration screen. You can also set it on a per-instance level, by choosing the list in the block, or using the correct shortcode attribute. See the *Use* section.
     39You can  set it on a per-instance level, by choosing the list in the block, or using the correct shortcode attribute. See the *Use* section.
     40
     41= The initial list displaying is not the one I'm choosing =
     42
     43This can happen when old settings are "stuck". Visit the settings page (*Admin* > *Settings* > *NYT Bestseller Lists*) and just click Save. That should clear out any old settings.
    4044
    4145== Screenshots ==
     
    4448
    4549== Changelog ==
     50
     51= 2.1.0 =
     52
     53* Removed "default list" php setting. Now just set the default list in the block.
     54* Tested with WordPress 6.1
    4655
    4756= 2.0.2 =
Note: See TracChangeset for help on using the changeset viewer.