Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcode attributes are being ignored #33

Closed
sandrinodimattia opened this issue Jan 7, 2015 · 2 comments
Closed

Shortcode attributes are being ignored #33

sandrinodimattia opened this issue Jan 7, 2015 · 2 comments

Comments

@sandrinodimattia
Copy link
Member

The shortcode attributes are being ignored. In this example, the Lock's title will never be changed, even tough the form_title attributed is defined on the shortcode.

[auth0 show_as_modal="true" social_big_buttons="true" form_title="Please login on my WP blog"]

Reported here: https://ask.auth0.com/t/shortcode-attributes-go-nowhere-in-auth0-plugin/464

@karl-wednesday
Copy link

This seems to be an issue for me when using v2.1.3 when attempting to use the example shortcode from the README.md:

 [auth0 show_as_modal="true" social_big_buttons="true" modal_trigger_name="Login button: This text is configurable!"]

When adding the "Auth0 Lock Popup" widget to a sidebar, the button within the widget launches the log in form within a modal as expected, but this is not the case when using the example shortcode; instead the form is output inline and no button markup is output:

<div id="form-signin-wrapper" class="auth0-login">
  <div class="form-signin">

    <div id="auth0-login-form">
      <div class="auth0-lock auth0-lock-opened-in-frame" data-reactid=".0">
        <div class="auth0-lock-center" data-reactid=".0.1">
          <form class="auth0-lock-widget" data-reactid=".0.1.0">
            <div class="auth0-lock-widget-container" data-reactid=".0.1.0.2"><span data-reactid=".0.1.0.2.0"><div class="auth0-lock-cred-pane" data-reactid=".0.1.0.2.0.$email"><div class="auth0-lock-header" data-reactid=".0.1.0.2.0.$email.0"><div class="auth0-lock-header-bg auth0-lock-blur-support" data-reactid=".0.1.0.2.0.$email.0.1"><div class="auth0-lock-header-bg-blur" style="background-image:url('http:https://mytestwebsite.com/wp-content/uploads/2016/02/icon.png');" data-reactid=".0.1.0.2.0.$email.0.1.0"></div><div class="auth0-lock-header-bg-solid" style="background-color:#ea5323;" data-reactid=".0.1.0.2.0.$email.0.1.1"></div></div><div class="auth0-lock-header-welcome" data-reactid=".0.1.0.2.0.$email.0.2"><img class="auth0-lock-header-logo" src="http:https://mytestwebsite.com/wp-content/uploads/2016/02/icon.png" data-reactid=".0.1.0.2.0.$email.0.2.0"><div class="auth0-lock-name" data-reactid=".0.1.0.2.0.$email.0.2.1">Auth0</div></div></div><div data-reactid=".0.1.0.2.0.$email.1"><div style="visibility:visible;" data-reactid=".0.1.0.2.0.$email.1.0"><span data-reactid=".0.1.0.2.0.$email.1.0.0"></span>
              <div
                class="auth0-lock-content" data-reactid=".0.1.0.2.0.$email.1.0.1">
                <div class="auth0-lock-form" data-reactid=".0.1.0.2.0.$email.1.0.1.0">
                  <p data-reactid=".0.1.0.2.0.$email.1.0.1.0.0"><span data-reactid=".0.1.0.2.0.$email.1.0.1.0.0.0">Enter your email to sign in<br>or create an account</span></p>
                  <div class="auth0-lock-input-block auth0-lock-input-email" data-reactid=".0.1.0.2.0.$email.1.0.1.0.1">
                    <div class="auth0-lock-input-wrap" data-reactid=".0.1.0.2.0.$email.1.0.1.0.1.0"><span data-reactid=".0.1.0.2.0.$email.1.0.1.0.1.0.0"><svg width="32px" height="26px" viewBox="0 0 32 26" version="1.1" xmlns="http:https://www.w3.org/2000/svg" xmlns:xlink="http:https://www.w3.org/1999/xlink" xmlns:sketch="http:https://www.bohemiancoding.com/sketch/ns" class="auth0-lock-icon"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"><g id="32px" sketch:type="MSLayerGroup" transform="translate(-2155.000000, -2317.000000)" fill="#373A39"><g id="Group-856" transform="translate(1.000000, 1.000000)" sketch:type="MSShapeGroup"><path id="Fill-419" d="M2184,2339 C2184,2339.55 2183.55,2340 2183,2340 L2157,2340 C2156.45,2340 2156,2339.55 2156,2339 L2156,2319 C2156,2318.45 2156.45,2318 2157,2318 L2183,2318 C2183.55,2318 2184,2318.45 2184,2319 L2184,2339 L2184,2339 Z M2184,2316 L2156,2316 C2154.89,2316 2154,2316.89 2154,2318 L2154,2340 C2154,2341.1 2154.89,2342 2156,2342 L2184,2342 C2185.1,2342 2186,2341.1 2186,2340 L2186,2318 C2186,2316.89 2185.1,2316 2184,2316 L2184,2316 Z M2176,2322 L2180,2322 L2180,2326 L2176,2326 L2176,2322 Z M2174,2328 L2182,2328 L2182,2320 L2174,2320 L2174,2328 Z M2158,2332 L2172,2332 L2172,2330 L2158,2330 L2158,2332 Z M2158,2336 L2172,2336 L2172,2334 L2158,2334 L2158,2336 Z"></path></g></g></g></svg></span>
                      <input
                        type="text" name="email" class="auth0-lock-input" placeholder="[email protected]" autocomplete="off" autocapitalize="off" value="" tabindex="101" data-reactid=".0.1.0.2.0.$email.1.0.1.0.1.0.1">
                    </div>
                  </div>
                </div>
            </div>
        </div>
      </div>
      <button type="submit" class="auth0-lock-submit" style="background-color:#ea5323;" tabindex="110" data-reactid=".0.1.0.2.0.$email.2">
        <div class="auth0-loading-container" data-reactid=".0.1.0.2.0.$email.2.0">
          <div class="auth0-loading" data-reactid=".0.1.0.2.0.$email.2.0.0"></div>
        </div><span data-reactid=".0.1.0.2.0.$email.2.1"><svg width="43px" height="42px" viewBox="0 0 43 42" version="1.1" xmlns="http:https://www.w3.org/2000/svg" xmlns:xlink="http:https://www.w3.org/1999/xlink" xmlns:sketch="http:https://www.bohemiancoding.com/sketch/ns"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"><g id="Lock" sketch:type="MSArtboardGroup" transform="translate(-280.000000, -3592.000000)"><g id="SMS" sketch:type="MSLayerGroup" transform="translate(153.000000, 3207.000000)"><g id="Group" sketch:type="MSShapeGroup"><g id="Login" transform="translate(0.000000, 369.000000)"><g id="Btn"><g id="Oval-302-+-Shape" transform="translate(128.000000, 17.000000)"><circle id="Oval-302" stroke="#FFFFFF" stroke-width="2" cx="20.5" cy="20" r="20"></circle><path d="M17.8,15.4 L19.2,14 L25.2,20 L19.2,26 L17.8,24.6 L22.4,20 L17.8,15.4 Z" id="Shape" fill="#FFFFFF"></path></g></g></g></g></g></g></g></svg></span></button>
      <span
        data-reactid=".0.1.0.2.0.$email.3"></span>
    </div>
    </span>
  </div>
  </form><span class="auth0-lock-badge-bottom" data-reactid=".0.1.1"><a href="https://auth0.com/" target="_blank" class="auth0-lock-badge" data-reactid=".0.1.1.0"><span data-reactid=".0.1.1.0.0"><svg width="18px" height="21px" viewBox="0 0 18 21" version="1.1" xmlns="http:https://www.w3.org/2000/svg" xmlns:xlink="http:https://www.w3.org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"><g id="Lock" sketch:type="MSArtboardGroup" transform="translate(-276.000000, -3229.000000)" fill-opacity="0.4" fill="#FFFFFF"><g id="SMS" sketch:type="MSLayerGroup" transform="translate(153.000000, 3207.000000)"><g id="Group" sketch:type="MSShapeGroup"><g id="Header" transform="translate(-0.500000, 0.000000)"><path d="M137.790429,38.4848167 L135.770249,32.1883757 L141.058325,28.2980192 L134.521693,28.2980192 L132.501273,22.001821 L132.500673,22.0001214 L139.038385,22.0001214 L141.059165,28.2974122 L141.059165,28.2972908 L141.060843,28.2963196 C142.234586,31.9495762 141.025835,36.1047125 137.790429,38.4848167 L137.790429,38.4848167 L137.790429,38.4848167 Z M127.211877,38.4848167 L127.210199,38.4860307 L132.499714,42.3773585 L137.790429,38.4849381 L132.501393,34.593489 L127.211877,38.4848167 L127.211877,38.4848167 Z M123.942542,28.296441 L123.942542,28.296441 C122.707175,32.147463 124.141203,36.2280579 127.210798,38.4855451 L127.211278,38.4836027 L129.231698,32.1875259 L123.9447,28.2978978 L130.479774,28.2978978 L132.500314,22.0016996 L132.500793,22 L125.962722,22 L123.942542,28.296441 L123.942542,28.296441 Z" id="Shape"></path></g></g></g></g></g></svg></span></a>
  </span>
</div>
</div>
</div>



</div>
</div>


<script type="text/javascript">
  var ignore_sso = false;
  document.addEventListener("DOMContentLoaded", function() {

    var callback = null;



    function a0ShowLoginModal() {
      var options = {
        "authParams": {
          "state": "{\"interim\":false,\"uuid\":\"56eaa31ec4392\",\"redirect_to\":\"mytestwebsite.com\\\/\"}",
          "scope": "openid "
        },
        "responseType": "code",
        "callbackURL": "http:\/\/mytestwebsite.com\/index.php?auth0=1",
        "dict": {
          "signin": {
            "title": "Log In To The Test Site"
          }
        },
        "socialBigButtons": true,
        "gravatar": true,
        "usernameStyle": "email",
        "rememberLastLogin": true,
        "sso": true,
        "icon": "http:\/\/mytestwebsite.com\/wp-content\/uploads\/2016\/02\/icon.png",
        "container": "auth0-login-form"
      };

      lock.magiclink(options);
    }


    var lock = new Auth0LockPasswordless('l7vbWymIytMAWakX32f2eG9CVUn6K8Vb', 'mytestapplication.auth0.com');


    a0ShowLoginModal();

  });
</script>

There are no errors reported in the console in Chrome, and the sign in form and the rest of the page seems to be working as expected.

Having tried to customize the shortcode by changing out the various attributes and their values, it seems that nothing that I am doing is having any effect short of removing the shortcode completely.

@glena
Copy link
Contributor

glena commented Mar 17, 2016

Hi @karl-wednesday, sorry about that.

there is an error when it checks for the show_as_modal attribute.

Can you try changing this line of the plugin?

https://github.com/auth0/wp-auth0/blob/master/lib%2FWP_Auth0_Lock_Options.php#L84

by return (isset($this->extended_settings['show_as_modal']) && $this->extended_settings['show_as_modal']);

It will be fixed in the next release (I dont have a date yet but will be soon, probably next week).

Is there any other attribute giving you a hard time?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants