Title: atomicadam's Replies | WordPress.org

---

# atomicadam

  [  ](https://wordpress.org/support/users/atomicadam/)

 *   [Profile](https://wordpress.org/support/users/atomicadam/)
 *   [Topics Started](https://wordpress.org/support/users/atomicadam/topics/)
 *   [Replies Created](https://wordpress.org/support/users/atomicadam/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/atomicadam/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/atomicadam/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/atomicadam/engagements/)
 *   [Favorites](https://wordpress.org/support/users/atomicadam/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/users/atomicadam/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/atomicadam/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Force Login] Authenticate via javascript fetch for REST API](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/#post-10775524)
 * Thanks Kevin. I think with your plugin and an .htpasswd file at the server level,
   one can put in a basic authentication gateway for a detached front end. But I
   think for more secure connections one needs to use the API OAuth, which seems
   fine for user apps, but for just delivering content to a detached front end I’m
   thinking of just making an Express server that connects directly to the WordPress
   MySQL server to read data.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Force Login] Authenticate via javascript fetch for REST API](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/#post-10770489)
 * actually this only works due to being logged into the WP admin so the fetch is
   sending along the cookies to authenticate. logging in to WP w/ only browser JS
   from another domain does not seem possible.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Force Login] Authenticate via javascript fetch for REST API](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/#post-10769682)
 * I was able to resolve this – though I’m not sure I’m 100% happy with always returning
   200 on a OPTIONS request (the redirect to readme.html will return a 200 in the
   OPTIONS preflight request). But here is the fetch request and .htaccess setup
   that works with Force Login turned on.
 *     ```
       fetch(endpoint, {
             headers: new Headers({
                'Authorization': 'Basic ' + Buffer.from('user:pass').toString('base64'),
                'Content-Type': 'application/json; charset=utf-8'
         }),
         credentials: 'include',
         mode: 'cors',
         method: 'GET',
         redirect: 'follow'
       })
       .then(res => res.json())
       .then(json => console.log(json))
       ```
   
 * and
 *     ```
       <IfModule mod_headers.c>
       Header unset Access-Control-Allow-Origin
       Header always set Access-Control-Allow-Origin "http://localhost:3000"
       Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT, DELETE"
       Header always set Access-Control-Allow-Headers "Origin,Content-Type,Accept,Authorization,X-Requested-With"
       Header unset Access-Control-Allow-Credentials
       Header always set Access-Control-Allow-Credentials true
       </IfModule>
   
       <IfModule mod_rewrite.c>
       RewriteEngine On                  
       RewriteCond %{REQUEST_METHOD} OPTIONS 
       RewriteRule ^(.*)$ readme.html [QSA,L]  
       </IfModule>
   
       <LimitExcept OPTIONS>
       AuthType Basic
       AuthName "API Service"
       AuthUserFile .htpasswd
       Require valid-user
       </LimitExcept>
       ```
   
 * I have not tried this with pretty URL rewrites – yet – so the endpoint looks 
   like: [http://api.site.com/?rest_route=/wp/v2/pages/2/](http://api.site.com/?rest_route=/wp/v2/pages/2/)
    -  This reply was modified 7 years, 7 months ago by [atomicadam](https://wordpress.org/support/users/atomicadam/).
    -  This reply was modified 7 years, 7 months ago by [atomicadam](https://wordpress.org/support/users/atomicadam/).
    -  This reply was modified 7 years, 7 months ago by [atomicadam](https://wordpress.org/support/users/atomicadam/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Force Login] Authenticate via javascript fetch for REST API](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/#post-10765975)
 * Most likely this is just server setup. If I can get it working I’ll post.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Force Login] Authenticate via javascript fetch for REST API](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/authenticate-via-javascript-fetch-for-rest-api/#post-10765637)
 * Hi Kevin – Thanks for writing the plugin.
 * Yes, the fetch request works fine when the plugin is turned off.
 * Also the same request via curl works fine. So this is most likely a CORS issues
   and am just hoping you might have tried this yourself.
 * The fetch request looks something like this
 *     ```
       fetch(endpoint, {
         headers: new Headers {
           'Authenticate': 'Basic user:password'
         },
         redirect: 'follow'
       })
       .then(res => res.json())
       .then(json => console.log(json));
       ```
   
 * Looking at the fetch documentation, I am now seeing I didn’t set a mode key value,
   I will try that. Will also follow up with more specific error messages.
    -  This reply was modified 7 years, 7 months ago by [atomicadam](https://wordpress.org/support/users/atomicadam/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Shipping Address not visible when total is $0](https://wordpress.org/support/topic/shipping-address-not-visible-when-total-is-0/)
 *  [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years ago](https://wordpress.org/support/topic/shipping-address-not-visible-when-total-is-0/#post-7147516)
 * Having the same issue. it is NOT working fine with Woo 2.5.3 and WP 4.4.2. What
   should I be looking into that could possibly be causing this.
 * Thanks,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CKEditor WYSIWYG for Gravity Forms] Detecting click inside iframe OR javascript hook for after CKE has loaded](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/#post-7051430)
 * I ended up with this solution. script enqueued 9999, though I think the real 
   magic is the readystatechange check.
 *     ```
       (function($) {
   
       	document.onreadystatechange = function () {
       		if (document.readyState === 'complete') {
       			for (var i in CKEDITOR.instances) {
       				CKEDITOR.instances[i].on('focus', function(e) {
       					var target = $('#'+e.sender.name);
       					$(target).trigger('click');
       				});
       			}
       		}
       	}
   
       })(jQuery);
       ```
   
 * I’ve tweaked the progression.js in my own fork to work better with GF and to 
   use the whole #field_x element instead of the input. That way if a user click
   on a title, description, or input, the progression.js is triggered. With the 
   code above, e.sender.name gets the ID i’m looking for, and I just trigger a click
   which triggers progression.js to do its thing.
 * Thanks for the help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CKEditor WYSIWYG for Gravity Forms] Detecting click inside iframe OR javascript hook for after CKE has loaded](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/#post-7051379)
 * Hi ovann86 –
 * Thanks for the feedback. Yes, we are not using the 100% bar for that same reason.
 * Progression.js seems to work well and is simple. I have a fork of it that works
   better with GF. ([https://github.com/adamplabarge/progression.js](https://github.com/adamplabarge/progression.js))
   It seems that it is no longer being developed by the author, thus forking and
   changing to suite your needs is best.
 * Thanks for the code example and letting me know what you are binding to. I’ll
   try this out later today or tomorrow.
 * Thanks,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CKEditor WYSIWYG for Gravity Forms] Detecting click inside iframe OR javascript hook for after CKE has loaded](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/detecting-click-inside-iframe-or-javascript-hook-for-after-cke-has-loaded/#post-7051339)
 * Hi ovann86 –
 * Yes. Basically, we are using Progression JS ([http://jquerycards.com/forms/date-time/progression-js/](http://jquerycards.com/forms/date-time/progression-js/))
   to add tool tips to GF fields. Since the CKE input box is in an iframe, the progression.
   js code click capture does not appear to see the click. Or, since the CKE code
   takes a bit to load or instantiate, the normal $(document).ready() hook is firing
   before the CKE iframe has loaded, and I can’t seem to be able to capture click
   events inside the iframe.
 * (honestly, not sure how to best proceed. I don’t often work w/ iframes or least
   the ones we do work with are from other domains, so we don’t have control over
   content, clicks, etc, and didn’t have a lot of time to research and try out stuff,
   yesterday. would be happy for any suggestion) – thanks.
 * I’ll give the code a shot, this might be what I’m looking for. I scanned over
   the CKE docs, but didn’t see anything like this. Did I miss something?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms: Post Updates] Checkboxes no checked even though form checkbox choice isSelect set to TRUE](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/#post-5863116)
 * Thanks jamesbAtPK for the update. I have not looked into this for a while, but
   I see there is an update for the plugin, of which we have not updated, due to
   the customizing of the plugin.
 * I’d love to say that I want to look into this sometime soon, but between Gravity
   Forms & WPML upgrade issues of late, I honestly would rather just shoot myself
   than ever use these plugins again.
 * jamesbAtPK, if you want to see what I customized, I can send you the code, just
   LMK.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Google Search] set browser back button to go back on results pagination](https://wordpress.org/support/topic/set-browser-back-button-to-go-back-on-results-pagination/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/set-browser-back-button-to-go-back-on-results-pagination/#post-6617002)
 * Awesome Peter,
 * Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Google Search] set browser back button to go back on results pagination](https://wordpress.org/support/topic/set-browser-back-button-to-go-back-on-results-pagination/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/set-browser-back-button-to-go-back-on-results-pagination/#post-6616978)
 * answered my own question, but unfortunately requires to hack the plugin.
 * in wp-google-search.php line 157
    $content .= ‘<div class=”gcse-‘ . $gcse_code.‘”
   data-enableHistory=”true” data-linktarget=”_self”></div>’;
 * add data-enableHistory.
 * You guys should allow for the shortcode to accept arguments that could just output
   some of the custom search API options found here: [https://developers.google.com/custom-search/docs/element?hl=en](https://developers.google.com/custom-search/docs/element?hl=en)
 * Wouldn’t be that hard to do and would make the plugin just that much more usable.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Nav Bar Menu Static Placement & Hover Actions Messed Up](https://wordpress.org/support/topic/nav-bar-menu-static-placement-hover-actions-messed-up/)
 *  [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/nav-bar-menu-static-placement-hover-actions-messed-up/#post-6507885)
 * Same thing is happening to me.
 * Samuel Wood’s add_action to insert css trick seems to resolve it at least one
   site. I tried to change the Chrome settings, and no luck.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms: Post Updates] Checkboxes no checked even though form checkbox choice isSelect set to TRUE](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/#post-5863095)
 * I had to hack the plugin to get it to work 🙁
 * Basically, the plugin seemed to over ride any gform_pre_render hook for the checkboxes.
   I’ve not looked into it for a while, nor undated the plugin since it has been
   customized 🙁 but might have time to dig back in and address this issue again.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms: Post Updates] Checkboxes no checked even though form checkbox choice isSelect set to TRUE](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/)
 *  Thread Starter [atomicadam](https://wordpress.org/support/users/atomicadam/)
 * (@atomicadam)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-no-checked-even-though-form-checkbox-choice-isselect-set-to-true/#post-5862927)
 * ok, so i got it to work by integrating my function into the class and adding 
   actions to my the gform_pre_render after your in the class
 *     ```
       add_filter( 'gform_pre_render_' . $form_id,        array(__CLASS__, 'gform_pre_render') );
       				add_filter( 'gform_pre_render_' . $form_id, array(__CLASS__, 'acf_to_gf_populate_checkbox_static') );
       				add_filter( 'gform_pre_submission_filter_' . $form_id, array(__CLASS__, 'acf_to_gf_populate_checkbox_static') );
       ```
   

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/users/atomicadam/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/atomicadam/replies/page/2/?output_format=md)