Changeset 2853610
- Timestamp:
- 01/24/2023 02:22:30 PM (3 years ago)
- Location:
- bestseller-lists-from-new-york-times/trunk
- Files:
-
- 5 edited
-
admin-page.php (modified) (3 diffs)
-
index.php (modified) (1 diff)
-
nytBestsellerListings.class.php (modified) (1 diff)
-
plugin_updates.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bestseller-lists-from-new-york-times/trunk/admin-page.php
r2719463 r2853610 10 10 nytBestsellerListings::setApiKey( $_POST['nyt_bestseller_listings_apiKey']); 11 11 12 if( isset($_POST['nyt_bestseller_listings_defaultList']) ){13 nytBestsellerListings::setDefaultList( $_POST['nyt_bestseller_listings_defaultList']);14 }15 16 12 nytBestsellerListings::setCatalogLinkFormat($_POST['nyt_bestseller_listings_CatalogLinkFormat']); 17 13 } … … 20 16 21 17 $apiKey = nytBestsellerListings::getApiKey(); 22 $defaultList = nytBestsellerListings::getDefaultList();23 18 $catalogLinkFormat = nytBestsellerListings::getCatalogLinkFormat(); 24 19 ?> … … 48 43 <input type="text" class="wide" name="nyt_bestseller_listings_apiKey" value="<?= esc_attr($apiKey) ?>"> 49 44 50 <?php51 $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 <?php58 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 <?php67 }68 ?>69 45 70 46 <label class="block">Catalog Links</label> -
bestseller-lists-from-new-york-times/trunk/index.php
r2719463 r2853610 2 2 /* 3 3 Plugin Name: Bestseller Lists from the New York Times 4 Plugin URI: https://jake .paris/wordpress-plugins/4 Plugin URI: https://jakeparis.com/wordpress-plugins/ 5 5 Description: Integrate bestseller lists from the New York Times into your own site with a user-friendly interface. 6 Version: 2. 0.26 Version: 2.1.0 7 7 Requires PHP: 5.4 8 8 Requires at least: 4.9 9 Tested up to: 6. 0.09 Tested up to: 6.1.0 10 10 Author: Jake Paris 11 Author URI: https://jake .paris/11 Author URI: https://jakeparis.com/ 12 12 License: GPL-3.0 13 13 License URI: https://opensource.org/licenses/GPL-3.0 14 14 */ 15 15 16 define('BSLNYT_PLUGIN_VERSION', '2. 0.2');16 define('BSLNYT_PLUGIN_VERSION', '2.1.0'); 17 17 define('BSLNYT_PLUGIN_PATH', plugin_dir_path(__FILE__) ); 18 18 define('BSLNYT_PLUGIN_URL', plugins_url('/', __FILE__) ); -
bestseller-lists-from-new-york-times/trunk/nytBestsellerListings.class.php
r2705824 r2853610 14 14 } 15 15 16 static function setDefaultList($v){17 $v = sanitize_text_field( $v );18 return update_option( self::$optionsName . "_defaultList", $v);19 }20 16 static function getDefaultList(){ 21 return get_option( self::$optionsName . "_defaultList", 'hardcover-fiction');17 return 'hardcover-fiction'; 22 18 } 23 19 -
bestseller-lists-from-new-york-times/trunk/plugin_updates.php
r2705824 r2853610 22 22 delete_option("{self::}_apiKey"); 23 23 24 $defaultList = get_option( "{self::}_defaultList", 'hardcover-fiction');25 nytBestsellerListings::setDefaultList( $defaultList );24 // $defaultList = get_option( "{self::}_defaultList", 'hardcover-fiction'); 25 // nytBestsellerListings::setDefaultList( $defaultList ); 26 26 delete_option( "{self::}_defaultList"); 27 27 … … 33 33 } 34 34 35 // remove global default list 36 if( version_compare( '2.1.0', $bslnyt_stored_version, '>' ) ) { 37 delete_option('nyt_bestseller_listings_defaultList'); 38 } 39 35 40 36 41 -
bestseller-lists-from-new-york-times/trunk/readme.txt
r2719463 r2853610 1 1 === Bestseller Lists from the New York Times=== 2 2 Contributors: jakeparis 3 Donate link: https://jake .paris/3 Donate link: https://jakeparis.com/ 4 4 Tags: books, library, bestsellers, libraries, reading lists 5 5 Requires at least: 4.9 … … 18 18 == Use == 19 19 20 = WordPress 5 .0=20 = WordPress 5+ = 21 21 Use the *Bestseller Lists from NYT* block. You can optionally specify which list is initially displayed. 22 22 23 = WordPress 4 .x=23 = WordPress 4 = 24 24 Use 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"]` 25 25 … … 37 37 = How do I change which list shows up first? = 38 38 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. 39 You 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 43 This 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. 40 44 41 45 == Screenshots == … … 44 48 45 49 == 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 46 55 47 56 = 2.0.2 =
Note: See TracChangeset
for help on using the changeset viewer.