« first day (664 days earlier)      last day (4579 days later) » 

09:49
@toscho why "WPCamp" ? getting foundation of your backs? :)
yes
10:13
Hi everyone, bit of a long shot but is anyone available for a few minutes - trying to work out how to do an AJAX request in WordPress but it's frying my brain.
@martincarlin87 had you worked through info in Codex? what stage is giving you trouble?
i'm a wordpress n00b but have been working with it for the past week and a bit, I will let you know what I have
ok, so I have a page, it uses query_posts to get the latest 4 posts for a particular user, underneath, I have a 'load more' button where, once clicked, I'd like to load 4 more posts.

outside that loop in the same script I have my get_posts function which is some jquery that sends the data I need to admin-ajax.php, and after the function I have my action hooks:

add_action('wp_ajax_myFunction', 'get_posts');
add_action('wp_ajax_nopriv_myFunction', 'get_posts');
then in functions.php i have my load-mroe function which just does the same query and loop as in my initial page but with a larger post count and the hooks there are:

add_action('wp_ajax_addCustomer', 'load_more');
add_action('wp_ajax_nopriv_addCustomer', 'load_more'); // not really needed
but I'm confused as to whether my first function, get_posts should be in functions.php and not in my plugin, and if so, how to call that function as I don't quite understand how it works, I think i'm close to solving it but obviously not close enough!
@martincarlin87 this part won't work because get_posts is name of core function
you need to create your own function and do add_action('wp_ajax_myFunction', 'your function name');
wait...
I am sleepy :)
not enough... what is your Ajax call with data? example?
10:31
wall of text warning!
now changed from get_posts to load_more_posts
just noticed I still had the add customer stuff in the actions I copied from a tutorial >_>
so, figured it out?
almost, just realised I had my jquery in a function when I don't think it should be, I'm getting the alert on success now but not getting the data I need
how does wordpress know when I send an ajax request to admin-ajax.php, what function I want to use?
@martincarlin87 check that you are using correct action in first argument and correct function in second
@martincarlin87 this is what add_action() describes there
it matches your action in request to callback (function or something)
10:48
just getting a 0 when alerting the contents of the success function
Hiya!
@TomJNowell Well, I am back. Been busy with some important stuff off the web.
just understood what you meant by action, never used it in my ajax requests before, added in action: 'loadMore', but still getting a 0 (even after putting in `die()' in the function that's called
A wild @its_me appears
@martincarlin87 what is your (1) action (2) function (3) add_action call?
been fiddling with the ajax call, here it is:

$.ajax({
type: "GET",
url: "/wordpress/wp-admin/admin-ajax.php",
data: {
action: 'loadMore',
"id=" + id + "&firstname=" + firstname + "&surname=" + surname + "&posts=" + posts + "&category=" + category,
},
success: function(msg){
// alert("Woo!");
// $('#oe-updates-grid').html(msg);
// $('#posts-count').text(posts+4);
// alert ($('#posts-count').text);
alert(msg);
}
});


function: loadMore()

action hooks:

dd_action('wp_ajax_loadMore', 'loadMore');
11:02
ok, what is in your loadMore() function?
simplified it to this for now:

function loadMore() {

$output = 'it worked!!!!!!!';

die($output);

}
not getting the alert box on success since adding the action though
what if you just open in browser example.com/wordpress/wp-admin/admin-ajax.php?action=loadMore
get the output text :

it worked!!!!!!!
then your callback is working and you are somehow messing up JS part that makes the call
i was thinking the data string looks off but i've not done it this way before:

data: {
action: 'loadMore',
"id=" + id + "&firstname=" + firstname + "&surname=" + surname + "&posts=" + posts + "&category=" + category,
},
shouldn't there be something before "id=" + id.... etc
11:07
JS side not my thing, so can't help you there without messing with code (which I am not doing going to do right now :)
someone should write workbench plugin for Ajax...
managed to get it!
changed it to the following format: data: ({ action: 'loadMore', id: id, firstname: firstname, surname: surname, posts: posts, category: category}),
yay!
thanks for your help :)
11:44
Hello @amit
@TomJNowell Hi
eyes.nasa.gov – you have install a Java applet but it is totally worth it. Beautiful!
@toscho eurgh but why java, with their budgets they could have just used a webcam and hired scientists to personally show you round their lab
@TomJNowell there are some really cool feature build-in. It is not worse than Flash.
@toscho it's bad, but it's a different kind of bad
at least flash 'works'
11:54
now that I talked about it … it hangs. dangit!
java is just horrendously inconsistent and all over the place when it comes to their browser plugins or even their version distribution. Last I checked Oracle ran multiple java main sites, each of which advertised multiple versions of Java as the latest, ranging from Java 7 to 6
and their updater, aside from requiring admin privs to simply ask a server what the latest version is, always insists there's a new version, attempts to download it, only to say you're upto date afterall
and eclipse.. oh dear lord...
Eclipse rocks. Be quiet now!
7
Q: WP E-Commerce VS Shopp VS WooCommerce VS JigoShop

drtanzHi I am in the process of creating a website for an importer who wants to showcase his products. There are over 1,500 products and they also need to be categorised by brand. At this point for this client I only need to display a catalogue with no options for actual purchasing, but he wants to be...

This is sooo not constructive. Thoughts?
@toscho too broad, polling, subjective
closed.
I think I should delete my LinkedIn account. There is no way to stop their emails, and I really don’t need it.
12:26
@TomJNowell I don't do the Java applet, ever. Without fail I get jacked with a virus when installed.
@toscho they have notification settings
though I agree there's little/no point being on there these days
@TomJNowell I know. Didn’t help.
google+ is bigger, and probably more secure already
Ever got anything out of being on LinkedIn?
some people do, but you have to be prolific on the social groups bit
12:29
just their spammy emails
most people just connect on linkedin which doesnt help you much at all, and a lot of people just hook up their twitter so it's a glorified twitter proxy for some
A friend of mine got poached from one startup to another from their, high paying job. That's the only success story I know of. No self promotion either.
lol.. tweet-circle-jerk?
I have an account there but never got around to using it... The site is a design travesty
You may not know it: we have an undocumented search parameter code:. Example
had no idea
12:44
@TomJNowell ...for a change
12:55
@its_me im not sure what this was referring to
@TomJNowell username change
@its_me pick a name and stick to it
imagine you had a good friend called Alex
@TomJNowell yeah, yeah... I know. This is final!
:D
oneday you say hello Alex, he doesn't respond. "Sorry my name's James". Later you need help, he's leaving and he has your phone but doesn't realise it, you need it to get home. You shout 'James'. His name is now Warren
12:59
lol! I know
You change your name as much as you change your website :)
@Rarst see comments - maybe this is what you were talking about.
@kaiser what? when?
13:51
Are Links going to be removed from next version of wordpress?
@Sisir it's on the plan, don't know if it's actually getting done though
okey.. then, what is your advice if i need to do some thing with links..
@Rarst You were asking about track tickets, bounties and questions, right?
2
A: What is the use of the wp_links table?

kaiserIn short YES, they could have. As anything else could have been implemented as custom post type and/or custom taxonomy. But WordPress is a grown system - now 9 years old - and things are moving slowly to keep most stuff backwards compatible. In short, with WP 3.5, the Links Manager will be move...

@toscho Thanks for that simulation link. Definitely wicked cool.
@kaiser not quite following the connecxtion, but I am sleepy
14:13
16 hours ago, by Rarst
core has bug, no one cares for two years. enter WPSE - post it here, upvote, put a bounty... people are fighting to provide best solution. test, commit to core.
@kaiser I remember I don't see how your link ties in
@Rarst Needs trac ticket - has question
@kaiser I was talking about directly opposite
@Rarst I know, but why not going this direction?
Encounter problem - proof that it needs patch - answer question - provide one.
@kaiser because result in this direction is dead trac ticket no one cares about
14:18
at least we care :P
Can you legally SELL a WordPress plugin, created by yourself, if you use ANY 3rd party code at all ANYWHERE in your plugin? Does it need to be 100% your own code? No utilizing 3rd party jQuery plugins to beef up a plugin, correct?
@MichaelEcklund you can sell any 3rd party code as long as license of that code allows you to
@Rarst How can I determine this?
You don't really sell a plugin anyway, keep it GPL and sell support/updates
@MichaelEcklund read the license?.. :)
hiya @NoelTock :) rare guest here
14:29
So if it's not documented, then one shall assume it's okay to include?
@rarst friday you know :)
@MichaelEcklund if it's not documented one shall assume touching that code teleports you to jail
@MichaelEcklund GPL code cannot be sold, rather when you pay for GPL code, you're paying for distribution of the code to you not the code itself
thats how GPL code can be sold despite it being 'free'
@TomJNowell well, it can be in sense of exchange of money for code
so you can buy GPL software and resell it if you please
@Rarst indeed, but no ownership change occurred, as it's public
14:31
@NoelTock I have weak relationship with time... there are about two days in month I care about - paycheck and taxes deadline :)
@NoelTock howdy
Heh, fair enough, still jet lagged, naptime :)
hey tom ;)
^_^ what brings you here?
hadn't checked out the UI in a while
(just looking around the site after viewing the #wpcs post)
@NoelTock oh, meant to ask - any movement on Adoptr? it seems I will have some time to burn in near future (as in not having job for a while :)
14:37
been crazy with HT, but lets make it happen
I've been so crazy with work stuff for so long that I need downtime badly
@Rarst didn't you just recently get a new job?
@MichaelEcklund no
oh, my fault. I thought I remembered you talking complaining about it.
@MichaelEcklund it wasn't new, just progressively harder to cope with :)
14:39
aha okay
Adoptr? I thought that was just an excuse to make Tony Scott homeless
@NoelTock I will probably be wrapping up at work next week, then will be dealing with paperwork for wpcs and burning through my long neglected projects :)
awesome, I'll try to prep the next stage by then
stepping out for a bit
so I've been doing mental review and Adoptr loosely qualifies under long neglected :)
15:04
@Rarst whats next for queryposts?
@TomJNowell static code parser
One pretty big improvement would be if get_current_screen() would have the hooks when some value gets added as placeholders until it gets set...
Wish someone would take the time to actually write documentation for all the hooks.
@amit Finally made it here :)
15:51
@kaiser ;) yes,
@amit Our "community edit"-bot ;)
I noticed already usage marks on our edit link. :)
@kaiser lol, see - I've only 74 suggests
I think I should not suggest minor edits anymore, ;)
dont want increase the rejected numbers.
@amit Plain code formatting is okay if it is necessary for readability. If you change nothing else it will probably rejected. See Fix all problems in one edit. :)
@Wyck In case you read this: Add "Metoffice UK" to your list of services. They state that they can't provide answers to support questions before 28(!) days. But they answer them in 28 minutes - just a perfect experience so far.
16:05
@toscho ok
16:43
@kaiser so I geuss it's safe to conclude that zombies are in charge over there
zombie olympics
 
2 hours later…
18:18
why get_posts() messing with main query? eljamesbooks.net Four CPT on accordion i am getting using get_post() and used while loop on bottom of the page but it just getting the CPT again.. any idea?
@Sisir you should ask in a question and show som code imo
also just use wp query, I never see any reason why to use get_posts or query_posts other than being lazy
Is it possible to remove the "Add new taxonomy_name" link from a custom taxonomy UI on a CPT add post screen? -- I don't know if I worded that the best.
@Wyck that's why its puzzling me. i prefer using get_post over wp_query if not too much necessary..
@MichaelEcklund from the menu or the edit post screen?
@Wyck From the edit post screen.
18:28
@Wyck here it is : pastebin.com/Dehdsi7q the problem is not new for me. So, i guess i have some problem in my coding
@MichaelEcklund 'show_ui' => false, when registering a custom tax. See my latest question for in depth info.
@kaiser But won't that hide the entire UI? I want to be able to use the UI still, just remove the "Add New ..." link
or change where it links to
@MichaelEcklund Hm? Where exactly? Make a screenshot pls.
how do you upload an image in chat?
nevermind
@kaiser :5726466 I'm actualy answering that right now and creating a tarc ticket for it
:5726468
I guess 2 names don't work in stackchat..
18:32
You have to reply to one and write @theOther like this
@Wyck I guess we should wait with the ticket
ah
0
A: register_taxonomy - show in admin menu, but not on post type (edit) screen

WyckAs per le comment. function remove_artist_meta() { remove_meta_box( '{taxonomy name}', 'post', 'side' ); } add_action( 'admin_menu' , 'remove_artist_meta' ); The Admin menu has been always difficult to deal with, some help here would ne nice:http://core.trac.wordpress.org/ticket/12718 Bu...

ill add it in a bit
it would be a pretty simple patch I think
The problem is, that we don't know how to handle it. Adding another argument?
@MichaelEcklund Intercept on add_meta_boxes, search through the array, get the callback, copy/paste it and replace it with your own. Or just hide it with css.
@MichaelEcklund Callback for non-hierarchical custom taxonomies is post_tags_meta_box and for hierarchical it's post_categories_meta_box.
@MichaelEcklund MUCH simpler than you've thought. This just appears, when the user: if ( current_user_can($tax->cap->edit_terms) ). So just deny the access to the edit_terms-cap for those roles, that shouldn' get it.
oh good idea
@kaiser Perfect. I like the capability approach.
@MichaelEcklund RULE #1 First, always search in core code. How-to, the easy way: Go with FireBug or some other dev tool into the source and find the surrounding #ID of the wrapping element. Than do a cross file search and BOOM, you know where to start hunting. :)
18:46
it would be easy to hook into remove_meta but let's see what the wp superheros say
but don't be suprised if "they" say there is a plugin, and if not, write one
@kaiser What do you mean a "cross file search"? (Apologize if that sounds nub)
@MichaelEcklund Search all core files - most IDEs can do that. Notepad++ can do that too.
@Wyck Added to that ticket. The solution would be simple and non-intrusive.
I use DreamWeaver CS5
ew
19:00
Why not "Artisteer"? </sarkasm>
lol
can do it as well
there is a drop-down / select box on the search dialog where you can select something like "search in project folder"
or in any other custom folder
and dreamweaver is not that bad...
/topic change What would be the easiest/fastest way to get lat/lng from a user into WP/php?
@kaiser via what an ip, address?
@Wyck navigator or maybe the result from a google request?
I'm searching on both ends...
19:06
@kaiser the best way is via address and google api ( or bing api)
But how would I get the address?
because users kow thier address and it's pretty accurate
they would have to type it
Too complicated ;)
ip geolocation isn't that great unless you want to pay
or get them to turn on html5 geo thingy
Meh. Just need to have a click, do an AJAX request and send the navigator data to that request...
@Wyck mostly talking about smart phones.
19:08
why not google geocoder?
oh then they probably already enabled geo stuff :dev.w3.org/geo/api/spec-source.html
@ungestaltbar Can use that one too.
@ungestaltbar But I only need lat/lng and nothing else. It's just to prefix the Transient.
and how accurate?
@kaiser seen recent story how man got high caliber rifle shipped to him instead of new tv? there probably was similar question in root of that story :)
19:10
ip geo is pretty lame
@Rarst well ok. then I just rob a bank. might be a better idea anyway.
these guys seem to have the best service and look at the %'s, maxmind.com/app/city_accuracy
ipinfodb.com/ip_location_api.php is quite good on city level, but you won't get more than that with the free service
@Wyck damn
chat with local girls in your area!
results may vary
there are some hacks around that triangulate server ip and stuff I rmember reading
19:13
Cote D'Ivoire 96% - 3% - 1%
@Wyck haha
ha I can juts see soemone using your app in the jungle
Hopefully Bear Grylls.
The NSA was granted a patent for an IP geo-location technology based
on triangulation using latency measures
ask them
@Wyck Already salt( md5( $mail ) );ed my CIA contact - support ticket added.
19:22
And now you're waiting that I a) read that, b) understand it and c) build something useful upon it? :)
video is easier I imagine youtube.com/watch?v=oet32BJ_-Jo
no hehe
Thanks, but what I got is enough so far. Just add some quick UI and fin.
ya I think if you have that tech in some software someone will come knock on your door
I doubt that you can really measure the signal strength (or whatever they use) from the stations...
 
1 hour later…
20:39
guys, http://wp.in domain is available ;)
take it?
I'll let wordpress buy it. :)
why? they don't need it anyway
I think you don't sleep.
my brain completely elsewhere in use, but please explain
20:51
@kaiser one question - do you use svn (subversion) for developing if so which one ?
@amit Currently trying to move everything to self dropbox hosted git. But so far most of my stuff is in private repos on Bitbucket and the freely available ones on GitHub.
Hi, please, how can syntax highlight in my Blog xxx.wordpress.com
I know plugin menu is removed, but i need to syntax highlight my code in my Posts.
21:40
@Wyck Metoffice support is just rock'n'roll.
@kaiser I like the "pollen count" map but where are the "fresh brains"
What does this mean in non-shorthand code?
`if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){`
22:05
@MichaelEcklund probably checking if there is anything in the array
does this seem right?
`
if(!is_null($value[0]) && !empty($value[0])){
if(in_array($value[0], $restricted)){
// do stuff...
}
}
`
how come backticks dont work?
if the first value in the array is not equal to NULL then probably do something
or even:
`if(!is_null($value[0]) && !empty($value[0]) && in_array($value[0], $restricted)){`
what are you actually trying to do that looks awful weird
I can't stand short hand code. I'm just trying to convert it to the normal way.
using brackets

« first day (664 days earlier)      last day (4579 days later) »