Changeset 2711694
- Timestamp:
- 04/19/2022 05:43:51 PM (4 years ago)
- Location:
- display-your-zenodo-community
- Files:
-
- 12 edited
- 1 copied
-
tags/1.2.1 (copied) (copied from display-your-zenodo-community/trunk)
-
tags/1.2.1/CHANGELOG.md (modified) (2 diffs)
-
tags/1.2.1/README.md (modified) (1 diff)
-
tags/1.2.1/README.txt (modified) (3 diffs)
-
tags/1.2.1/includes/class-display-your-zenodo-community.php (modified) (1 diff)
-
tags/1.2.1/public/class-display-your-zenodo-community-public.php (modified) (4 diffs)
-
tags/1.2.1/zenodo-plugin.php (modified) (1 diff)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/includes/class-display-your-zenodo-community.php (modified) (1 diff)
-
trunk/public/class-display-your-zenodo-community-public.php (modified) (4 diffs)
-
trunk/zenodo-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
display-your-zenodo-community/tags/1.2.1/CHANGELOG.md
r2449354 r2711694 5 5 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 6 7 ## [1.2.1] - 2022-04-19 8 ### Added 9 - Shortcodes can now take a keyword attribute - it will bypass the admin `extra keyword` option and search only for the records with this keyword/tag in Zenodo. 10 7 11 ## [1.2.0] - 2021-01-03 8 12 ### Added … … 10 14 - Administrators can choose the number of publications shown per page (default is 10) 11 15 ### Changed 12 *Fixed a bug that would make the plugin query Zenodo at the init stage of all pages16 - Fixed a bug that would make the plugin query Zenodo at the init stage of all pages 13 17 14 18 ## [1.1.0] - 2020-07-01 -
display-your-zenodo-community/tags/1.2.1/README.md
r2449354 r2711694 20 20 the publications, as well as possibility to choose the number of publication shown per page. 21 21 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 22 23 A new option is possible: by entering a parameter `keyword` directly in your shortcode (e.g. `[display-your-zenodo-community keyword='DMP']`), you would only retrieve the records of your community (or ORCID user) that have this specific tag/keyword. That's to be able to provide different lists of records on different pages of the same website (we could also add the possibility for different communities/orcid as well if anyone needs it).\ 24 **Note:** It will favour/prefer the keyword parameter over the admin option extra_keyword (if it was entered), so the admin option would be overwritten by this keyword parameter. 25 22 26 # How does it work? 23 27 With API request directly to Zenodo, with your community identifier or your ORCID added in the admin page, you can 24 retrieve some information of disseminated data on Zenodo .28 retrieve some information of disseminated data on Zenodo and print them on your Wordpress website. -
display-your-zenodo-community/tags/1.2.1/README.txt
r2449354 r2711694 4 4 Tags: zenodo, dariah, operas, community, api 5 5 Requires at least: 4.9.1 6 Tested up to: 5. 66 Tested up to: 5.9 7 7 Requires PHP: 5.6.35 8 Stable tag: 1.2. 08 Stable tag: 1.2.1 9 9 License: Apache License - 2.0 10 10 License URI: http://www.apache.org/licenses/LICENSE-2.0 … … 32 32 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 33 33 34 A new option is possible: by entering a parameter `keyword` directly in your shortcode (e.g. `[display-your-zenodo-community keyword='DMP']`), you would only retrieve the records of your community (or ORCID user) that have this specific tag/keyword. That's to be able to provide different lists of records on different pages of the same website (we could also add the possibility for different communities/orcid as well if anyone needs it). 35 Note: It will favour/prefer the keyword parameter over the admin option extra_keyword (if it was entered), so the admin option would be overwritten by this keyword parameter. 36 34 37 == Frequently Asked Questions == 35 38 … … 45 48 46 49 == Changelog == 50 51 = 1.2.1 = 52 * Shortcodes can now take a keyword attribute - it will bypass the admin `extra keyword` option and search only for the records with this keyword/tag in Zenodo. 47 53 48 54 = 1.2.0 = -
display-your-zenodo-community/tags/1.2.1/includes/class-display-your-zenodo-community.php
r2449354 r2711694 54 54 $this->version = ZENODO_PLUGIN_VERSION; 55 55 } else { 56 $this->version = '1.2. 0';56 $this->version = '1.2.1'; 57 57 } 58 58 $this->plugin_name = 'display-your-zenodo-community'; -
display-your-zenodo-community/tags/1.2.1/public/class-display-your-zenodo-community-public.php
r2449354 r2711694 92 92 /** 93 93 * Render the result page of Zenodo community 94 * 95 * @since 1.0.0 96 */ 97 public function display_zenodo_data() { 94 * 95 * @param String $attr Attributes that could be used in the shortcodes 96 * 97 * @since 1.0.0 98 */ 99 public function display_zenodo_data( $attr ) { 100 $shortcode_specific_keyword = ''; 101 if( is_array( $attr ) ) { 102 $shortcode_specific_keyword = sanitize_text_field( $attr['keyword'] ); 103 } 104 98 105 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 99 106 $number_publications = 10; … … 107 114 } 108 115 $html = "<div id=\"display-your-zenodo-community\">"; 109 $result_api = $this->zp_retrieve_json( $page, $display_your_zenodo_community_options );116 $result_api = $this->zp_retrieve_json( $page, $display_your_zenodo_community_options, $shortcode_specific_keyword ); 110 117 $nb_pages = 1; 111 118 if( isset( $result_api->aggregations->access_right->buckets[0]->doc_count ) ) { … … 215 222 * 216 223 * @param int $page Page of Zenodo data 224 * @param array $display_your_zenodo_community_options Options available form the admin interface 225 * @param String $shortcode_specific_keyword Specific shortcode parameter for keywords search in Zenodo 217 226 * 218 227 * @return string The full JSON response from the query 219 228 * @since 1.0.0 220 229 */ 221 public function zp_retrieve_json( $page = 1, $display_your_zenodo_community_options ) {230 public function zp_retrieve_json( $page = 1, $display_your_zenodo_community_options, $shortcode_specific_keyword ) { 222 231 $choice = $id_community_orcid = $extra_keyword = ""; 223 232 $number_publications = 10; … … 228 237 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 229 238 } 230 if( array_key_exists( 'extra_keyword', $display_your_zenodo_community_options ) ) { 239 if( $shortcode_specific_keyword ) { //Favour the shortcode than the admin option (admin option is general, shortcode option is what we need) 240 $extra_keyword = $shortcode_specific_keyword; 241 } elseif( array_key_exists( 'extra_keyword', $display_your_zenodo_community_options ) ) { 231 242 $extra_keyword = $display_your_zenodo_community_options['extra_keyword']; 232 243 } -
display-your-zenodo-community/tags/1.2.1/zenodo-plugin.php
r2449354 r2711694 17 17 * Plugin URI: https://github.com/dariah-eric/display-your-zenodo-community 18 18 * Description: This plugin allows user to view their community data from Zenodo on WordPress 19 * Version: 1.2. 019 * Version: 1.2.1 20 20 * Author: DARIAH-EU 21 21 * Author URI: https://www.dariah.eu -
display-your-zenodo-community/trunk/CHANGELOG.md
r2449354 r2711694 5 5 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 6 7 ## [1.2.1] - 2022-04-19 8 ### Added 9 - Shortcodes can now take a keyword attribute - it will bypass the admin `extra keyword` option and search only for the records with this keyword/tag in Zenodo. 10 7 11 ## [1.2.0] - 2021-01-03 8 12 ### Added … … 10 14 - Administrators can choose the number of publications shown per page (default is 10) 11 15 ### Changed 12 *Fixed a bug that would make the plugin query Zenodo at the init stage of all pages16 - Fixed a bug that would make the plugin query Zenodo at the init stage of all pages 13 17 14 18 ## [1.1.0] - 2020-07-01 -
display-your-zenodo-community/trunk/README.md
r2449354 r2711694 20 20 the publications, as well as possibility to choose the number of publication shown per page. 21 21 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 22 23 A new option is possible: by entering a parameter `keyword` directly in your shortcode (e.g. `[display-your-zenodo-community keyword='DMP']`), you would only retrieve the records of your community (or ORCID user) that have this specific tag/keyword. That's to be able to provide different lists of records on different pages of the same website (we could also add the possibility for different communities/orcid as well if anyone needs it).\ 24 **Note:** It will favour/prefer the keyword parameter over the admin option extra_keyword (if it was entered), so the admin option would be overwritten by this keyword parameter. 25 22 26 # How does it work? 23 27 With API request directly to Zenodo, with your community identifier or your ORCID added in the admin page, you can 24 retrieve some information of disseminated data on Zenodo .28 retrieve some information of disseminated data on Zenodo and print them on your Wordpress website. -
display-your-zenodo-community/trunk/README.txt
r2449354 r2711694 4 4 Tags: zenodo, dariah, operas, community, api 5 5 Requires at least: 4.9.1 6 Tested up to: 5. 66 Tested up to: 5.9 7 7 Requires PHP: 5.6.35 8 Stable tag: 1.2. 08 Stable tag: 1.2.1 9 9 License: Apache License - 2.0 10 10 License URI: http://www.apache.org/licenses/LICENSE-2.0 … … 32 32 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 33 33 34 A new option is possible: by entering a parameter `keyword` directly in your shortcode (e.g. `[display-your-zenodo-community keyword='DMP']`), you would only retrieve the records of your community (or ORCID user) that have this specific tag/keyword. That's to be able to provide different lists of records on different pages of the same website (we could also add the possibility for different communities/orcid as well if anyone needs it). 35 Note: It will favour/prefer the keyword parameter over the admin option extra_keyword (if it was entered), so the admin option would be overwritten by this keyword parameter. 36 34 37 == Frequently Asked Questions == 35 38 … … 45 48 46 49 == Changelog == 50 51 = 1.2.1 = 52 * Shortcodes can now take a keyword attribute - it will bypass the admin `extra keyword` option and search only for the records with this keyword/tag in Zenodo. 47 53 48 54 = 1.2.0 = -
display-your-zenodo-community/trunk/includes/class-display-your-zenodo-community.php
r2449354 r2711694 54 54 $this->version = ZENODO_PLUGIN_VERSION; 55 55 } else { 56 $this->version = '1.2. 0';56 $this->version = '1.2.1'; 57 57 } 58 58 $this->plugin_name = 'display-your-zenodo-community'; -
display-your-zenodo-community/trunk/public/class-display-your-zenodo-community-public.php
r2449354 r2711694 92 92 /** 93 93 * Render the result page of Zenodo community 94 * 95 * @since 1.0.0 96 */ 97 public function display_zenodo_data() { 94 * 95 * @param String $attr Attributes that could be used in the shortcodes 96 * 97 * @since 1.0.0 98 */ 99 public function display_zenodo_data( $attr ) { 100 $shortcode_specific_keyword = ''; 101 if( is_array( $attr ) ) { 102 $shortcode_specific_keyword = sanitize_text_field( $attr['keyword'] ); 103 } 104 98 105 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 99 106 $number_publications = 10; … … 107 114 } 108 115 $html = "<div id=\"display-your-zenodo-community\">"; 109 $result_api = $this->zp_retrieve_json( $page, $display_your_zenodo_community_options );116 $result_api = $this->zp_retrieve_json( $page, $display_your_zenodo_community_options, $shortcode_specific_keyword ); 110 117 $nb_pages = 1; 111 118 if( isset( $result_api->aggregations->access_right->buckets[0]->doc_count ) ) { … … 215 222 * 216 223 * @param int $page Page of Zenodo data 224 * @param array $display_your_zenodo_community_options Options available form the admin interface 225 * @param String $shortcode_specific_keyword Specific shortcode parameter for keywords search in Zenodo 217 226 * 218 227 * @return string The full JSON response from the query 219 228 * @since 1.0.0 220 229 */ 221 public function zp_retrieve_json( $page = 1, $display_your_zenodo_community_options ) {230 public function zp_retrieve_json( $page = 1, $display_your_zenodo_community_options, $shortcode_specific_keyword ) { 222 231 $choice = $id_community_orcid = $extra_keyword = ""; 223 232 $number_publications = 10; … … 228 237 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 229 238 } 230 if( array_key_exists( 'extra_keyword', $display_your_zenodo_community_options ) ) { 239 if( $shortcode_specific_keyword ) { //Favour the shortcode than the admin option (admin option is general, shortcode option is what we need) 240 $extra_keyword = $shortcode_specific_keyword; 241 } elseif( array_key_exists( 'extra_keyword', $display_your_zenodo_community_options ) ) { 231 242 $extra_keyword = $display_your_zenodo_community_options['extra_keyword']; 232 243 } -
display-your-zenodo-community/trunk/zenodo-plugin.php
r2449354 r2711694 17 17 * Plugin URI: https://github.com/dariah-eric/display-your-zenodo-community 18 18 * Description: This plugin allows user to view their community data from Zenodo on WordPress 19 * Version: 1.2. 019 * Version: 1.2.1 20 20 * Author: DARIAH-EU 21 21 * Author URI: https://www.dariah.eu
Note: See TracChangeset
for help on using the changeset viewer.