Plugin Directory

Changeset 3305250


Ignore:
Timestamp:
06/02/2025 07:02:20 PM (9 months ago)
Author:
soliddigital
Message:

Update to version 1.10.0 from GitHub

Location:
solid-dynamics
Files:
2 added
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • solid-dynamics/tags/1.10.0/classes/display-condition-solid-dynamics-macro.php

    r3301750 r3305250  
    1717
    1818    public function check( $args ) : bool {
    19         $value = solid_dynamics_macro($args['macro']);
     19        $result = solid_dynamics_macro($args['macro']);
     20        $compare = $args['compare'] ?? '';
     21        $value = $args['value'] ?? '';
    2022
    21         if (($args['compare'] ?? '') === 'true') {
    22             return boolval($value);
    23         } else {
    24             return ! boolval($value);
     23        switch ($compare) {
     24            case 'true':
     25                return boolval($result);
     26            case 'false':
     27                return ! boolval($result);
     28            case 'equal':
     29                return $result === $value;
     30            case 'not_equal':
     31                return $result !== $value;
     32            default:
     33                return false;
    2534        }
    2635    }
     
    4352                    'true' => __( 'Is True', 'solid-dynamics' ),
    4453                    'false' => __( 'Is False', 'solid-dynamics' ),
    45                     // TODO: add other options, equal, not equal, etc.
     54                    'equal' => __( 'Equal', 'solid-dynamics' ),
     55                    'not_equal' => __( 'Not Equal', 'solid-dynamics' ),
     56                    // TODO: add other options, contains, not contains, etc.
    4657                ],
     58            ]
     59        );
     60        $this->add_control(
     61            'value',
     62            [
     63                'label' => __( 'Value', 'solid-dynamics' ),
     64                'type' => \Elementor\Controls_Manager::TEXT,
    4765            ]
    4866        );
  • solid-dynamics/tags/1.10.0/classes/elementor-dynamic-tags.php

    r2896065 r3305250  
    1818        require_once( __DIR__ . "/list-pluck.php" );
    1919        require_once( __DIR__ . "/post-field.php" );
     20        require_once( __DIR__ . "/post-type-label.php" );
    2021
    2122        $dynamic_tags->register( new \Solid\ParentMeta() );
     
    2526        $dynamic_tags->register( new \Solid\ListPluck() );
    2627        $dynamic_tags->register( new \Solid\PostField() );
     28        $dynamic_tags->register( new \Solid\PostTypeLabel() );
     29
    2730    }
    2831}
  • solid-dynamics/tags/1.10.0/readme.txt

    r3301750 r3305250  
    33Tags: elementor, dynamic tags, jet engine, macros
    44Tested up to: 6.8.1
    5 Stable tag: 1.9.2
     5Stable tag: 1.10.0
    66Requires PHP: 7.0
    77License: GPLv2
     
    2828- `List Pluck`: Pluck `field` off each item in `list` (`src` meta or option), and join with `sep`.
    2929- `Post Field`: Retrieves custom post field by name.
     30- `Post Type Label`: Retrieves post type label.
    3031
    3132Elementor Display Conditions
     
    3334Solid Dynamics also provides several display conditions for Elementor:
    3435
    35 - `Solid Dynamics Macro`: access post or user data, e.g. `post|post_content`, `user|user_email`, or call any function `function|get_current_user_id`. The result is passed to boolval to show the widget.
     36- `Solid Dynamics Macro`: access post or user data, e.g. `post|post_content`, `user|user_email`, or call any function `function|get_current_user_id`. The result can be checked directly or compared against a value.
    3637
    3738Settings
     
    6869
    6970== Changelog ==
     71
     72= 1.10.0 =
     732025-06-02
     74- Add dynamic tag to get post type label.
     75- Add compare option to display condition.
    7076
    7177= 1.9.2 =
  • solid-dynamics/tags/1.10.0/solid-dynamics.php

    r3301750 r3305250  
    44 * Plugin Name:       Solid Dynamics
    55 * Description:       Helpful utilities for Elementor, Jet Engine, and beyond.
    6  * Version:           1.9.2
     6 * Version:           1.10.0
    77 * Author:            Solid Digital
    88 * Author URI:        https://www.soliddigital.com
  • solid-dynamics/trunk/classes/display-condition-solid-dynamics-macro.php

    r3301750 r3305250  
    1717
    1818    public function check( $args ) : bool {
    19         $value = solid_dynamics_macro($args['macro']);
     19        $result = solid_dynamics_macro($args['macro']);
     20        $compare = $args['compare'] ?? '';
     21        $value = $args['value'] ?? '';
    2022
    21         if (($args['compare'] ?? '') === 'true') {
    22             return boolval($value);
    23         } else {
    24             return ! boolval($value);
     23        switch ($compare) {
     24            case 'true':
     25                return boolval($result);
     26            case 'false':
     27                return ! boolval($result);
     28            case 'equal':
     29                return $result === $value;
     30            case 'not_equal':
     31                return $result !== $value;
     32            default:
     33                return false;
    2534        }
    2635    }
     
    4352                    'true' => __( 'Is True', 'solid-dynamics' ),
    4453                    'false' => __( 'Is False', 'solid-dynamics' ),
    45                     // TODO: add other options, equal, not equal, etc.
     54                    'equal' => __( 'Equal', 'solid-dynamics' ),
     55                    'not_equal' => __( 'Not Equal', 'solid-dynamics' ),
     56                    // TODO: add other options, contains, not contains, etc.
    4657                ],
     58            ]
     59        );
     60        $this->add_control(
     61            'value',
     62            [
     63                'label' => __( 'Value', 'solid-dynamics' ),
     64                'type' => \Elementor\Controls_Manager::TEXT,
    4765            ]
    4866        );
  • solid-dynamics/trunk/classes/elementor-dynamic-tags.php

    r2896065 r3305250  
    1818        require_once( __DIR__ . "/list-pluck.php" );
    1919        require_once( __DIR__ . "/post-field.php" );
     20        require_once( __DIR__ . "/post-type-label.php" );
    2021
    2122        $dynamic_tags->register( new \Solid\ParentMeta() );
     
    2526        $dynamic_tags->register( new \Solid\ListPluck() );
    2627        $dynamic_tags->register( new \Solid\PostField() );
     28        $dynamic_tags->register( new \Solid\PostTypeLabel() );
     29
    2730    }
    2831}
  • solid-dynamics/trunk/readme.txt

    r3301750 r3305250  
    33Tags: elementor, dynamic tags, jet engine, macros
    44Tested up to: 6.8.1
    5 Stable tag: 1.9.2
     5Stable tag: 1.10.0
    66Requires PHP: 7.0
    77License: GPLv2
     
    2828- `List Pluck`: Pluck `field` off each item in `list` (`src` meta or option), and join with `sep`.
    2929- `Post Field`: Retrieves custom post field by name.
     30- `Post Type Label`: Retrieves post type label.
    3031
    3132Elementor Display Conditions
     
    3334Solid Dynamics also provides several display conditions for Elementor:
    3435
    35 - `Solid Dynamics Macro`: access post or user data, e.g. `post|post_content`, `user|user_email`, or call any function `function|get_current_user_id`. The result is passed to boolval to show the widget.
     36- `Solid Dynamics Macro`: access post or user data, e.g. `post|post_content`, `user|user_email`, or call any function `function|get_current_user_id`. The result can be checked directly or compared against a value.
    3637
    3738Settings
     
    6869
    6970== Changelog ==
     71
     72= 1.10.0 =
     732025-06-02
     74- Add dynamic tag to get post type label.
     75- Add compare option to display condition.
    7076
    7177= 1.9.2 =
  • solid-dynamics/trunk/solid-dynamics.php

    r3301750 r3305250  
    44 * Plugin Name:       Solid Dynamics
    55 * Description:       Helpful utilities for Elementor, Jet Engine, and beyond.
    6  * Version:           1.9.2
     6 * Version:           1.10.0
    77 * Author:            Solid Digital
    88 * Author URI:        https://www.soliddigital.com
Note: See TracChangeset for help on using the changeset viewer.