Plugin Directory

Changeset 1243318


Ignore:
Timestamp:
09/11/2015 12:27:17 PM (10 years ago)
Author:
luisfpg
Message:

If the form is rendered twice, the behavior is not applied twice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cyclos/trunk/cyclos-public.php

    r1242511 r1243318  
    2828// Register style sheet
    2929add_action( 'wp_enqueue_scripts', 'registerCyclosStyles' );
    30 
    3130
    3231// Create the widget to display the login form
     
    7574   
    7675    // Returns the html to show when shortcode is used.
    77     return '
     76    $out = '
    7877        <div class="cyclosFormBox cyclosForgotContainer" style="display:none">
    7978            <form class="cyclosForgotPasswordForm" action="#" method="post">
     
    115114                </div>
    116115            </form>
    117         </div>
     116        </div>';
     117    if (!array_key_exists('cyclos_behavior_applied', $GLOBALS)) {
     118        $GLOBALS['cyclos_behavior_applied'] = true;
     119        $out = $out . '
    118120        <script>
    119121            jQuery(document).ready(function($) {
     
    243245            });
    244246        </script>
    245     ';
     247        ';
     248    }
     249    return $out;
    246250}
    247251
Note: See TracChangeset for help on using the changeset viewer.