Plugin Directory

Changeset 2711694


Ignore:
Timestamp:
04/19/2022 05:43:51 PM (4 years ago)
Author:
yoannspace
Message:

->1.2.1 release

Location:
display-your-zenodo-community
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • display-your-zenodo-community/tags/1.2.1/CHANGELOG.md

    r2449354 r2711694  
    55and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
    66
     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
    711## [1.2.0] - 2021-01-03
    812### Added
     
    1014- Administrators can choose the number of publications shown per page (default is 10)
    1115### Changed
    12 * Fixed a bug that would make the plugin query Zenodo at the init stage of all pages
     16- Fixed a bug that would make the plugin query Zenodo at the init stage of all pages
    1317
    1418## [1.1.0] - 2020-07-01
  • display-your-zenodo-community/tags/1.2.1/README.md

    r2449354 r2711694  
    2020 the publications, as well as possibility to choose the number of publication shown per page.
    2121On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications.
     22
     23A 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
    2226# How does it work?
    2327With 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  
    44Tags: zenodo, dariah, operas, community, api
    55Requires at least: 4.9.1
    6 Tested up to: 5.6
     6Tested up to: 5.9
    77Requires PHP: 5.6.35
    8 Stable tag: 1.2.0
     8Stable tag: 1.2.1
    99License: Apache License - 2.0
    1010License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    3232On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications.
    3333
     34A 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).
     35Note: 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
    3437== Frequently Asked Questions ==
    3538
     
    4548
    4649== 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.
    4753
    4854= 1.2.0 =
  • display-your-zenodo-community/tags/1.2.1/includes/class-display-your-zenodo-community.php

    r2449354 r2711694  
    5454            $this->version = ZENODO_PLUGIN_VERSION;
    5555        } else {
    56             $this->version = '1.2.0';
     56            $this->version = '1.2.1';
    5757        }
    5858        $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  
    9292    /**
    9393     * 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
    98105        $display_your_zenodo_community_options = get_option( $this->plugin_name );
    99106        $number_publications = 10;
     
    107114        }
    108115        $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 );
    110117        $nb_pages = 1;
    111118        if( isset( $result_api->aggregations->access_right->buckets[0]->doc_count ) ) {
     
    215222     *
    216223     * @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
    217226     *
    218227     * @return string The full JSON response from the query
    219228     * @since    1.0.0
    220229     */
    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 ) {
    222231        $choice = $id_community_orcid = $extra_keyword = "";
    223232        $number_publications = 10;
     
    228237            $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid'];
    229238        }
    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 ) ) {
    231242            $extra_keyword = $display_your_zenodo_community_options['extra_keyword'];
    232243        }
  • display-your-zenodo-community/tags/1.2.1/zenodo-plugin.php

    r2449354 r2711694  
    1717 * Plugin URI:        https://github.com/dariah-eric/display-your-zenodo-community
    1818 * Description:       This plugin allows user to view their community data from Zenodo on WordPress
    19  * Version:           1.2.0
     19 * Version:           1.2.1
    2020 * Author:            DARIAH-EU
    2121 * Author URI:        https://www.dariah.eu
  • display-your-zenodo-community/trunk/CHANGELOG.md

    r2449354 r2711694  
    55and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
    66
     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
    711## [1.2.0] - 2021-01-03
    812### Added
     
    1014- Administrators can choose the number of publications shown per page (default is 10)
    1115### Changed
    12 * Fixed a bug that would make the plugin query Zenodo at the init stage of all pages
     16- Fixed a bug that would make the plugin query Zenodo at the init stage of all pages
    1317
    1418## [1.1.0] - 2020-07-01
  • display-your-zenodo-community/trunk/README.md

    r2449354 r2711694  
    2020 the publications, as well as possibility to choose the number of publication shown per page.
    2121On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications.
     22
     23A 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
    2226# How does it work?
    2327With 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  
    44Tags: zenodo, dariah, operas, community, api
    55Requires at least: 4.9.1
    6 Tested up to: 5.6
     6Tested up to: 5.9
    77Requires PHP: 5.6.35
    8 Stable tag: 1.2.0
     8Stable tag: 1.2.1
    99License: Apache License - 2.0
    1010License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    3232On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications.
    3333
     34A 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).
     35Note: 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
    3437== Frequently Asked Questions ==
    3538
     
    4548
    4649== 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.
    4753
    4854= 1.2.0 =
  • display-your-zenodo-community/trunk/includes/class-display-your-zenodo-community.php

    r2449354 r2711694  
    5454            $this->version = ZENODO_PLUGIN_VERSION;
    5555        } else {
    56             $this->version = '1.2.0';
     56            $this->version = '1.2.1';
    5757        }
    5858        $this->plugin_name = 'display-your-zenodo-community';
  • display-your-zenodo-community/trunk/public/class-display-your-zenodo-community-public.php

    r2449354 r2711694  
    9292    /**
    9393     * 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
    98105        $display_your_zenodo_community_options = get_option( $this->plugin_name );
    99106        $number_publications = 10;
     
    107114        }
    108115        $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 );
    110117        $nb_pages = 1;
    111118        if( isset( $result_api->aggregations->access_right->buckets[0]->doc_count ) ) {
     
    215222     *
    216223     * @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
    217226     *
    218227     * @return string The full JSON response from the query
    219228     * @since    1.0.0
    220229     */
    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 ) {
    222231        $choice = $id_community_orcid = $extra_keyword = "";
    223232        $number_publications = 10;
     
    228237            $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid'];
    229238        }
    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 ) ) {
    231242            $extra_keyword = $display_your_zenodo_community_options['extra_keyword'];
    232243        }
  • display-your-zenodo-community/trunk/zenodo-plugin.php

    r2449354 r2711694  
    1717 * Plugin URI:        https://github.com/dariah-eric/display-your-zenodo-community
    1818 * Description:       This plugin allows user to view their community data from Zenodo on WordPress
    19  * Version:           1.2.0
     19 * Version:           1.2.1
    2020 * Author:            DARIAH-EU
    2121 * Author URI:        https://www.dariah.eu
Note: See TracChangeset for help on using the changeset viewer.