Plugin Directory

Changeset 3438931


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

Update to version 3.1.0 from GitHub

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

Legend:

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

    r3438920 r3438931  
    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: 3.0.0
     7 * Version: 3.1.0
    88 * Author: Md Forid Uddin
    99 * Author URI: https://foriduddin.netlify.app/
  • current-post-shortcode/tags/3.1.0/includes/frontend/shortcode.php

    r3438920 r3438931  
    2020
    2121    /**
     22     * Get value with skip logic
     23     *
     24     * @param mixed $meta_value
     25     * @param mixed $default
     26     * @return mixed
     27     */
     28    private function get_value_with_skip( $meta_value, $default ) {
     29        if ( empty( $meta_value ) ) {
     30            return $default;
     31        }
     32        return $meta_value;
     33    }
     34
     35    /**
     36     * Get value without skip logic
     37     *
     38     * @param mixed $meta_value
     39     * @param mixed $default
     40     * @return mixed
     41     */
     42    private function get_value_without_skip( $meta_value, $default ) {
     43        if ( isset( $meta_value ) && $meta_value !== '' ) {
     44            return $meta_value;
     45        }
     46        return $default;
     47    }
     48
     49    /**
    2250     * Render the shortcode
    2351     *
     
    2856
    2957        $default = [
    30             'id'   => get_the_ID(),
    31             'meta' => false,
     58            'id'      => get_the_ID(),
     59            'meta'    => false,
     60            'default' => '',
     61            'skip'    => false,
    3262        ];
    3363
     
    4373
    4474            /*
    45              * If value found, return it; otherwise return empty string
     75             * If skip is set, use skip logic; otherwise, use normal logic
    4676             */
    47             if ( !empty( $meta_value ) ) {
    48                 return $meta_value;
     77            if ( !empty( $atts['skip'] ) ) {
     78                return $this->get_value_with_skip( $meta_value, $atts['default'] );
    4979            }
    5080
    51             return '';
     81            return $this->get_value_without_skip( $meta_value, $atts['default'] );
    5282        }
    5383
  • current-post-shortcode/tags/3.1.0/readme.txt

    r3438920 r3438931  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 3.0.0
     7Stable tag: 3.1.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    6666== Changelog ==
    6767
     68= 3.1.0 - 14/01/2026 =
     69
     70* Added Shortcode functionality for displaying current post information.
     71* Added support for displaying meta values with fallback options.
     72
    6873= 3.0.0 - 13/01/2026 =
    6974
  • current-post-shortcode/trunk/current-post-shortcode.php

    r3438920 r3438931  
    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: 3.0.0
     7 * Version: 3.1.0
    88 * Author: Md Forid Uddin
    99 * Author URI: https://foriduddin.netlify.app/
  • current-post-shortcode/trunk/includes/frontend/shortcode.php

    r3438920 r3438931  
    2020
    2121    /**
     22     * Get value with skip logic
     23     *
     24     * @param mixed $meta_value
     25     * @param mixed $default
     26     * @return mixed
     27     */
     28    private function get_value_with_skip( $meta_value, $default ) {
     29        if ( empty( $meta_value ) ) {
     30            return $default;
     31        }
     32        return $meta_value;
     33    }
     34
     35    /**
     36     * Get value without skip logic
     37     *
     38     * @param mixed $meta_value
     39     * @param mixed $default
     40     * @return mixed
     41     */
     42    private function get_value_without_skip( $meta_value, $default ) {
     43        if ( isset( $meta_value ) && $meta_value !== '' ) {
     44            return $meta_value;
     45        }
     46        return $default;
     47    }
     48
     49    /**
    2250     * Render the shortcode
    2351     *
     
    2856
    2957        $default = [
    30             'id'   => get_the_ID(),
    31             'meta' => false,
     58            'id'      => get_the_ID(),
     59            'meta'    => false,
     60            'default' => '',
     61            'skip'    => false,
    3262        ];
    3363
     
    4373
    4474            /*
    45              * If value found, return it; otherwise return empty string
     75             * If skip is set, use skip logic; otherwise, use normal logic
    4676             */
    47             if ( !empty( $meta_value ) ) {
    48                 return $meta_value;
     77            if ( !empty( $atts['skip'] ) ) {
     78                return $this->get_value_with_skip( $meta_value, $atts['default'] );
    4979            }
    5080
    51             return '';
     81            return $this->get_value_without_skip( $meta_value, $atts['default'] );
    5282        }
    5383
  • current-post-shortcode/trunk/readme.txt

    r3438920 r3438931  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 3.0.0
     7Stable tag: 3.1.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    6666== Changelog ==
    6767
     68= 3.1.0 - 14/01/2026 =
     69
     70* Added Shortcode functionality for displaying current post information.
     71* Added support for displaying meta values with fallback options.
     72
    6873= 3.0.0 - 13/01/2026 =
    6974
Note: See TracChangeset for help on using the changeset viewer.