Plugin Directory

Changeset 3438920


Ignore:
Timestamp:
01/13/2026 06:32:01 PM (3 months ago)
Author:
mdforiduddin
Message:

Update to version 3.0.0 from GitHub

Location:
current-post-shortcode
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • current-post-shortcode/tags/3.0.0/current-post-shortcode.php

    r3438467 r3438920  
    55 * Plugin URI: https://github.com/mdforiduddin/
    66 * Description: The Current Post Shortcode plugin allows you to display the current post's title and metadata using simple shortcodes.
    7  * Version: 2.0.0
     7 * Version: 3.0.0
    88 * Author: Md Forid Uddin
    99 * Author URI: https://foriduddin.netlify.app/
  • current-post-shortcode/tags/3.0.0/includes/frontend/shortcode.php

    r3438467 r3438920  
    2828
    2929        $default = [
    30             'id'      => get_the_ID(),
    31             'meta'    => false,
    32             'default' => '',
     30            'id'   => get_the_ID(),
     31            'meta' => false,
    3332        ];
    3433
     
    4443
    4544            /*
    46              * If value found, return it; otherwise return default value
     45             * If value found, return it; otherwise return empty string
    4746             */
    4847            if ( !empty( $meta_value ) ) {
     
    5049            }
    5150
    52             return $atts['default'];
     51            return '';
    5352        }
    5453
  • current-post-shortcode/tags/3.0.0/readme.txt

    r3438467 r3438920  
    11=== Current Post Shortcode ===
    22Contributors: mdforiduddin
    3 Tags: current post shortcode, shortcode, post title, post meta, custom field
     3Tags: current post, shortcode, post title, post meta, custom field
    44Requires at least: 6.7
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.0.0
     7Stable tag: 3.0.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    1212
    1313== Description ==
     14
    1415The "Current Post Shortcode" plugin allows you to display post titles and custom field values using simple shortcodes. You can display the current post's title or meta information, or specify a post ID to retrieve data from a specific post.
     16
     17= Display Current Post Title and Meta Information: =
     18- **Post Title:** `[current_post]`  → Outputs the current post title, e.g., "Hello World"
     19- **Post Meta** (Custom Field): `[current_post meta="custom_field"]`  → Outputs the value of the custom field
     20
     21= Display Data from a Specific Post ID: =
     22- **Post Title:** `[current_post id="123"]`  → Outputs the title of the post with ID "123"
     23- **Post Meta** (Custom Field): `[current_post id="123" meta="custom_field"]`  → Outputs the value of the custom field in the post with ID "123"
     24
     25= Display Fallback Meta Value: =
     26- **Post Meta with Fallback:** `[current_post meta="custom_field" default="Default Value"]`  → Displays "Default Value" if the custom field is empty
     27
     28= Display Default Value for Zero Meta Value: =
     29- **Post Meta with Default for Zero:** `[current_post meta="custom_field" default="Default Value" skip="true"]`  → Displays "Default Value" if the custom field value is zero
    1530
    1631== Installation ==
    1732
    18 From your WordPress dashboard -> Go to Plugins -> Click on "Add new" -> In the Search field, enter 'Current Post Shortcode' and choose Current Post Shortcode. Press "Install Now" -> After installation, click "Activate".
     33= From your WordPress dashboard: =
    1934
    20 Or **install it manually**:
    21 1. Download the plugin ZIP file from [WordPress Directory](https://wordpress.org/plugins/current-post-shortcode/).
    22 2. Log in to your WordPress Dashboard, navigate to Plugins > Add New and click on "Upload Plugin" button at the top of the page
    23 3. Choose the plugin ZIP file you downloaded in step 1 and click "Install Now."
    24 4. After the installation is complete, click the "Activate Plugin" button.
     35- Go to Plugins > Add New.
     36- Search for 'Current Post Shortcode'.
     37- Click "Install Now", then "Activate Plugin".
    2538
    26 == Shortcodes ==
     39 = Or **install it manually**: =
    2740
    28 1. Display Current Post Title and Meta Information:
    29    - Post Title: `[current_post]`
    30    - Post Meta (Custom Field): `[current_post meta="custom_field"]`
    31 
    32 2. Display Data from a Specific Post ID:
    33    - Post Title: `[current_post id="123"]`
    34    - Post Meta: `[current_post id="123" meta="custom_field"]`
     41- Download the plugin ZIP file from [WordPress Directory](https://wordpress.org/plugins/current-post-shortcode/).
     42- Log in to your WordPress Dashboard, navigate to Plugins > Add New, and click the "Upload Plugin" button.
     43- Choose the plugin ZIP file and click "Install Now".
     44- After installation, click "Activate Plugin".
    3545
    3646== Frequently Asked Questions ==
    3747
    38 **How do I use the shortcodes?**
     48= How do I use the shortcodes? =
     49
    3950- Use `[current_post]` to display the title of the current post.
    4051- Use `[current_post meta="custom_field"]` to display a custom field value.
    41 - To display data from a specific post, use the `id` attribute: `[current_post id="123"]` for the title or `[current_post id="123" meta="custom_field"]` for a custom field.
     52- To display data from a specific post, use the `id` attribute.
    4253
    43 **Can I use this shortcode in widgets or other areas of the site?**
    44 Yes, you can use these shortcodes anywhere shortcodes are supported in WordPress, such as posts, pages, widgets, and more.
     54= Can I use this shortcode in widgets or other areas of the site? =
     55
     56- Yes, you can use these shortcodes anywhere shortcodes are supported in WordPress, such as posts, pages, widgets, Gutenberg blocks, and page builders like Elementor, Divi, WPBakery, etc.
     57
     58= How do I handle empty or zero meta values? =
     59
     60- You can use the `skip` attribute to skip empty or zero values and optionally display a default value.
     61
     62= Is there a fallback for meta values? =
     63
     64- Yes, you can use the `default` attribute to provide a fallback value for empty meta values.
    4565
    4666== Changelog ==
    4767
    48 = 1.2.2 =
    49 * Added post meta fallback message when meta value does not exist.
     68= 3.0.0 - 13/01/2026 =
    5069
    51 = 1.0.0 =
     70* Improved shortcode functionality to support additional attributes.
     71* Enhanced compatibility with the latest WordPress versions.
     72* Added fallback meta value for better user experience.
     73
     74= 1.0.0 - 11/03/2025 =
     75
    5276* Initial release of the plugin.
  • current-post-shortcode/trunk/current-post-shortcode.php

    r3438467 r3438920  
    55 * Plugin URI: https://github.com/mdforiduddin/
    66 * Description: The Current Post Shortcode plugin allows you to display the current post's title and metadata using simple shortcodes.
    7  * Version: 2.0.0
     7 * Version: 3.0.0
    88 * Author: Md Forid Uddin
    99 * Author URI: https://foriduddin.netlify.app/
  • current-post-shortcode/trunk/includes/frontend/shortcode.php

    r3438467 r3438920  
    2828
    2929        $default = [
    30             'id'      => get_the_ID(),
    31             'meta'    => false,
    32             'default' => '',
     30            'id'   => get_the_ID(),
     31            'meta' => false,
    3332        ];
    3433
     
    4443
    4544            /*
    46              * If value found, return it; otherwise return default value
     45             * If value found, return it; otherwise return empty string
    4746             */
    4847            if ( !empty( $meta_value ) ) {
     
    5049            }
    5150
    52             return $atts['default'];
     51            return '';
    5352        }
    5453
  • current-post-shortcode/trunk/readme.txt

    r3438467 r3438920  
    11=== Current Post Shortcode ===
    22Contributors: mdforiduddin
    3 Tags: current post shortcode, shortcode, post title, post meta, custom field
     3Tags: current post, shortcode, post title, post meta, custom field
    44Requires at least: 6.7
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.0.0
     7Stable tag: 3.0.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    1212
    1313== Description ==
     14
    1415The "Current Post Shortcode" plugin allows you to display post titles and custom field values using simple shortcodes. You can display the current post's title or meta information, or specify a post ID to retrieve data from a specific post.
     16
     17= Display Current Post Title and Meta Information: =
     18- **Post Title:** `[current_post]`  → Outputs the current post title, e.g., "Hello World"
     19- **Post Meta** (Custom Field): `[current_post meta="custom_field"]`  → Outputs the value of the custom field
     20
     21= Display Data from a Specific Post ID: =
     22- **Post Title:** `[current_post id="123"]`  → Outputs the title of the post with ID "123"
     23- **Post Meta** (Custom Field): `[current_post id="123" meta="custom_field"]`  → Outputs the value of the custom field in the post with ID "123"
     24
     25= Display Fallback Meta Value: =
     26- **Post Meta with Fallback:** `[current_post meta="custom_field" default="Default Value"]`  → Displays "Default Value" if the custom field is empty
     27
     28= Display Default Value for Zero Meta Value: =
     29- **Post Meta with Default for Zero:** `[current_post meta="custom_field" default="Default Value" skip="true"]`  → Displays "Default Value" if the custom field value is zero
    1530
    1631== Installation ==
    1732
    18 From your WordPress dashboard -> Go to Plugins -> Click on "Add new" -> In the Search field, enter 'Current Post Shortcode' and choose Current Post Shortcode. Press "Install Now" -> After installation, click "Activate".
     33= From your WordPress dashboard: =
    1934
    20 Or **install it manually**:
    21 1. Download the plugin ZIP file from [WordPress Directory](https://wordpress.org/plugins/current-post-shortcode/).
    22 2. Log in to your WordPress Dashboard, navigate to Plugins > Add New and click on "Upload Plugin" button at the top of the page
    23 3. Choose the plugin ZIP file you downloaded in step 1 and click "Install Now."
    24 4. After the installation is complete, click the "Activate Plugin" button.
     35- Go to Plugins > Add New.
     36- Search for 'Current Post Shortcode'.
     37- Click "Install Now", then "Activate Plugin".
    2538
    26 == Shortcodes ==
     39 = Or **install it manually**: =
    2740
    28 1. Display Current Post Title and Meta Information:
    29    - Post Title: `[current_post]`
    30    - Post Meta (Custom Field): `[current_post meta="custom_field"]`
    31 
    32 2. Display Data from a Specific Post ID:
    33    - Post Title: `[current_post id="123"]`
    34    - Post Meta: `[current_post id="123" meta="custom_field"]`
     41- Download the plugin ZIP file from [WordPress Directory](https://wordpress.org/plugins/current-post-shortcode/).
     42- Log in to your WordPress Dashboard, navigate to Plugins > Add New, and click the "Upload Plugin" button.
     43- Choose the plugin ZIP file and click "Install Now".
     44- After installation, click "Activate Plugin".
    3545
    3646== Frequently Asked Questions ==
    3747
    38 **How do I use the shortcodes?**
     48= How do I use the shortcodes? =
     49
    3950- Use `[current_post]` to display the title of the current post.
    4051- Use `[current_post meta="custom_field"]` to display a custom field value.
    41 - To display data from a specific post, use the `id` attribute: `[current_post id="123"]` for the title or `[current_post id="123" meta="custom_field"]` for a custom field.
     52- To display data from a specific post, use the `id` attribute.
    4253
    43 **Can I use this shortcode in widgets or other areas of the site?**
    44 Yes, you can use these shortcodes anywhere shortcodes are supported in WordPress, such as posts, pages, widgets, and more.
     54= Can I use this shortcode in widgets or other areas of the site? =
     55
     56- Yes, you can use these shortcodes anywhere shortcodes are supported in WordPress, such as posts, pages, widgets, Gutenberg blocks, and page builders like Elementor, Divi, WPBakery, etc.
     57
     58= How do I handle empty or zero meta values? =
     59
     60- You can use the `skip` attribute to skip empty or zero values and optionally display a default value.
     61
     62= Is there a fallback for meta values? =
     63
     64- Yes, you can use the `default` attribute to provide a fallback value for empty meta values.
    4565
    4666== Changelog ==
    4767
    48 = 1.2.2 =
    49 * Added post meta fallback message when meta value does not exist.
     68= 3.0.0 - 13/01/2026 =
    5069
    51 = 1.0.0 =
     70* Improved shortcode functionality to support additional attributes.
     71* Enhanced compatibility with the latest WordPress versions.
     72* Added fallback meta value for better user experience.
     73
     74= 1.0.0 - 11/03/2025 =
     75
    5276* Initial release of the plugin.
Note: See TracChangeset for help on using the changeset viewer.