Plugin Directory

Changeset 2499300


Ignore:
Timestamp:
03/19/2021 09:31:23 AM (5 years ago)
Author:
karlogitlea
Message:

Fixed regex

Location:
miqid-elementor/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • miqid-elementor/trunk/core/widget_miqid.php

    r2480511 r2499300  
    5151            }, ARRAY_FILTER_USE_KEY );
    5252
    53             $options[ $i ] = [
     53            $options[ $ShortName ] = [
    5454                'label'   => __( $ShortName, 'miqid-core' ),
    5555                'options' => $class_options,
    5656            ];
    5757        }
     58
     59        $options['Profile']['options']['Profile.DateOfBirth|dmy\-XXXX'] = __( 'CPR-nr' );
     60        $options['Profile']['options']['profilepassportfaceimage']      = __( 'Passport Face Image' );
     61
     62//      print_r( $options );
    5863
    5964        return $options;
  • miqid-elementor/trunk/miqid-elementor.php

    r2485846 r2499300  
    44 * Plugin Name:       MIQID-Elementor
    55 * Description:       MIQID-Elementor extend Elementor with MIQID data.
    6  * Version:           1.6.3
     6 * Version:           1.6.4
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.2
  • miqid-elementor/trunk/readme.md

    r2485846 r2499300  
    44Tested up to: 5.7 
    55Requires PHP: 7.2 
    6 Stable tag: 1.6.3 
     6Stable tag: 1.6.4 
    77License: GPL v3 or later 
    88
  • miqid-elementor/trunk/widget/text_hide_if.php

    r2480511 r2499300  
    4444
    4545    protected function render() {
    46         $settings = $this->get_settings_for_display();
    47         $text     = $settings['text'];
    48         $miqid    = explode( '.', $settings["miqid"] ?? '' );
    49         $match    = do_shortcode( sprintf( '[miqid-%s fields="%s"]', mb_strtolower( array_shift( $miqid ) ), array_shift( $miqid ) ) );
    50         $negate   = filter_var( $settings['negate'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE ) ?? false;
     46        $settings    = $this->get_settings_for_display();
     47        $text        = '';
     48        $miqid       = $settings['miqid'];
     49        $match       = $settings['match'];
     50        $negate      = filter_var( $settings['negate'], FILTER_VALIDATE_BOOLEAN );
     51        $miqid       = explode( '.', $miqid );
     52        $shortcode   = sprintf( '[miqid-%s fields="%s"]', mb_strtolower( $miqid[0] ), $miqid[1] );
     53        $miqid_match = do_shortcode( $shortcode );
     54        $pattern     = sprintf( '/%s/i', $match );
    5155
    52         $text = $negate && preg_match( '/' . $settings['match'] . '/i', $match )
    53             ? $text
    54             : ( ! preg_match( '/' . $settings['match'] . '/i', $match ) ? $text : null );
     56        if ( $negate && preg_match( $pattern, $miqid_match ) ) {
     57            $text = $settings['text'];
     58        } else if ( ! $negate && ! preg_match( $pattern, $miqid_match ) ) {
     59            $text = $settings['text'];
     60        }
    5561
    5662        ?>
Note: See TracChangeset for help on using the changeset viewer.