413 reputation
1727
bio website
location
age
visits member for 3 years, 8 months
seen Jan 29 '12 at 6:17

I like lacrosse, hence my handle.


Jan
25
comment How to include code only on specific pages?
Thank you for your message. I tried using your solution, but, unfortunately, I couldn't get it to work.
Jan
24
comment Load js/css files only on specific admin UI pages
Hi @Chip Bennett, this is front-end script/style enqueueing.
Jan
9
comment How to include code only on specific pages?
@mrOr7if3r, Thanks for the message. For example, let's say I've got a Google Maps plugin. Does that plugin have to be loaded on every page-- i.e. pages that don't use the plugin? Let's say I have an "About" page which doesn't have the Google Maps shortcode on it. If I look at View Source, I see that the plugin's code was loaded on that page (event though I'm not using). Does code for plugins have to load on every single page? Thanks.
Nov
19
comment Multiple wp_localize_script
Thanks for the answer. That will be a useful feature!
Nov
17
comment Does wp_localize_script Call a Javascript Function or Simply Pass PHP Parameters to It
Great explanation! I understand it now. Thanks so much.
Nov
17
comment How do I escape a ']' in a short code?
Thank you for you answer. In my question, I forgot to put ']' in a code block so it came out as a ']'. I've edited my question. The HTML entity works for WP, but not for Google Maps. I'll have to use Regex to replace the HTML entities. Thank you very much for the help.
Nov
17
comment Mixing Regular Javascript With jQuery in a Plugin
Thank you very much for the detailed answer.
Nov
13
comment How to Debug: My Plugin Interferes With My Theme
Thank you for your help.
Nov
13
comment How to Debug: My Plugin Interferes With My Theme
I took the Google Maps event listener out. Now, I call the function that calculates the map bounds when the button is clicked. I then chained the functions together so that one function calls the others. It's not as efficient as when the event listener called the functions after the map tiles loaded, but it works.
Nov
13
comment How to Debug: My Plugin Interferes With My Theme
Also, I tried commenting out all of the code in csf_map_viewport_bounds(), and uncommenting the event listener: google.maps.event.addListener(csf_dcscore_crime_map, 'tilesloaded', csf_dcscore_crime_map_viewport_bounds); So, I know that the problem is with the eventListener, not with the function.
Nov
13
comment How to Debug: My Plugin Interferes With My Theme
The line reading: google.maps.event.addListener(csf_dcscore_crime_map, 'tilesloaded', csf_dcscore_crime_map_viewport_bounds); isn't ina function. It's simply in the jQuery(document).ready(function() { }); -- not sure if that would make any difference.
Nov
13
comment How to Debug: My Plugin Interferes With My Theme
Hi @Wyck, Thank you for your message. My pal, Miro, suggested that I comment out all of the js, and then uncomment it bit by bit to figure out which line caused the problem. I've traced it to this line in the js: google.maps.event.addListener(csf_map, 'tilesloaded', csf_map_viewport_bounds); . This event listener calls the csf_map_viewport_bounds function after the Google Map tiles have loaded. The function checks the lat long coordinates of the map. I'm not sure why this line is causing problem. It could be the function it calls, but I don't see anything weird. Any suggestions?
Oct
10
comment Fatal error: Call to undefined function wp_create_nonce()
I was thinking about doing that. I'll go ahead and post a new one. Thank you very much for the help!
Oct
10
comment Fatal error: Call to undefined function wp_create_nonce()
Hi, @Christopher Davis, Thank you very much for your message. You're right, I didn't have wp_localize_script inside a function. I never would have thought of your solution. I plopped it in a function and now I don't get the fatal error anymore. Unfortunately, I must have a second bug. I don't think that the nonce is being posted. Does this bit look correct: jQuery.post(the_ajax_script.ajaxurl, {my_nonce : the_ajax_script.my_nonce}, jQuery("#theForm").serialize()... Also, I tried putting an echo in php and alert on the js. It looks like the 2 numbers are different. Is this normal? Thank you.
Oct
6
comment Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin
Thank you for the help. I changed the file permissions and switched it to an absolute path.
Oct
5
comment Building a WP Shortcode: Loading Markers on a Google Map
Maybe there is a way to build the XML file following this example: wordpress.stackexchange.com/questions/6840/… If I can combine this solution with the above, it might work.
Sep
30
comment How to Run a jQuery Script after a Javascript Script has Finished in WordPress
Hi @DrewGourley Thank you for the help. It was a timing problem. My function was firing before the map fully loaded. I added your code, and the timing was still off. So in addition, I added an eventListener. It works now. Thank you.
Sep
27
comment How Can I Access a PHP Variable in Another PHP Function
@goto10, you came up with a much better title.
Sep
16
comment How Can I Access a PHP Variable in Another PHP Function
Sorry, I ran out of space. Thank you for including the open.js link explaining what you were doing in the "for in" loop. Do I need to set default values for the $atts in php if we there are defaults set in default_args in the js script? If I wanted to turn this into a PHP class, I would wrap it in class myClass {}. I'm not sure how I would set the js to a property other than $output.= . I learned a ton from you. I'll definitely give you the green checkmark (not exactly a huge reward for your effort). Again, thank you so much for your solution and explanation.
Sep
16
comment How Can I Access a PHP Variable in Another PHP Function
Awesome answer! Thank you very much for your kind help. I never would have thought of concatenating the js script in the $output. Thank you for mentioning the localize_script pitfall. I want to understand your solution thoroughly. As I understand it, this bit jQuery.noConflict(); jQuery(document).ready(function($) { } isn't needed? Do I need to worry about this script conflicting with other scripts? Multi-instance friendly: As long as I only have one lax-google-map shortcode per page, then it should work okay? As I understand it, it will only crash if I have multiple maps on one page.