• Resolved ari-el

    (@ari-el)


    I use jetpack “Sharing”, and for email sharing of posts, I have activated “Recaptcha”.

    Now Google’s recaptcha API offers some basic functionality including themes (such as blackglass or white) and also localisation to many languages.

    I am trying to have Jetpack’s recaptcha with optional parameters to change the default theme (horrible Red) and also set a language (my blog is in spanish, but the recaptcha is in english – uncool).

    The below is from google’s recaptcha API.

    I am trying to figure out how to specify this options, if possible without having to customize wordpress or jetpack’s code (so that the customization survives WP and Jetpack updates)

    Thanks

    <script type=”text/javascript”>
    var RecaptchaOptions = {
    lang : ‘fr’,
    theme : ‘custom’,
    custom_theme_widget: ‘recaptcha_widget’
    };

    http://wordpress.org/plugins/jetpack/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    To do so, you’ll have to create and load your own sharing js library instead of the one delivered with Jetpack. You can do so by following these steps:

    1. In your dashboard, go to Settings > Sharing, and check the “Advanced’ checkbox at the bottom of the page.
    2. Edit your theme’s functions.php file, and add the following code to load some of the Jetpack libraries:
      function tweakjp_add_sharing_js() {
          wp_enqueue_script( 'sharing-js-fe', get_template_directory_uri() . '/js/sharing.js', array( ), 3 );
      }
      add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_js' );
      
      function tweakjp_add_sharing_css() {
          wp_enqueue_style( 'sharing', WP_SHARING_PLUGIN_URL.'sharing.css', false, JETPACK__VERSION );
      }
      add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_css' );
    3. You’ll notice that the first script now points to a folder in your theme. Create this js folder in your theme, and create a new file named sharing.js.
    4. In that new file, copy the contents of this file: http://plugins.svn.wordpress.org/jetpack/tags/2.5/modules/sharedaddy/sharing.js
    5. Go to line 347, and locate the mention of RecaptchaOptions
    6. There, add your own custom rules.

    I hope this helps.

    Thread Starter ari-el

    (@ari-el)

    Hi Jeremy – thanks for following up.

    I am using the “responsive” theme.
    I activated “advanced” mode in the Sharing settings.

    I added the code in (2) above in my theme’s functions.php file, which in my theme is:

    /var/www/html/wordpress/wp-content/themes/responsive/core/includes/functions.php

    Then I wget’d the file (sharing.js) into a new “js” folder:

    /var/www/html/wordpress/wp-content/themes/responsive/js/sharing.js

    Without editing anything in that file, “Share by email” stopped working.

    When clicking in the “email sharing” icon, the browser is redirected to:

    miblog.com/?shared=email&msg=fail

    and nothing happens – the post is displayed again. Sharing with facebook and tweeter still works OK.

    I deleted the “sharing.js” file (without touching anything else) and the same error happens, which leads me to believe that the location where I am putting the file is wrong.

    I tried also:
    /var/www/html/wordpress/wp-content/themes/responsive/core/js/sharing.js
    Same brokenness.

    I tried removing the additions in functions.php (without disabling advanced mode) and then all the “sharing icons” disappear. Which leads me to believe that the additions to functions.php are being taken up.

    Any hint?

    Thanks!

    ps. It would be so much easier if Jetpack could add Theme and Language options for Recaptcha 🙂 – I just want recaptcha in spanish and in black 🙂

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Could you post your site URL here, so I can have a look?

    If you want it to remain private, you can also contact us via this contact form:
    http://jetpack.me/contact-support/
    If you do so, please mention this thread in your email, so I can follow up. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Jetpack sharing / recaptcha options’ is closed to new replies.