#wordpress 2023-05-14

2023-05-14 UTC
#
[chrisbergr]
That sounds great and would certainly make it easier to set up when that is no longer an issue at all.
#
[chrisbergr]
The less third-party the better
#
GWG
[chrisbergr]: Yes, that's why I host my own third-party.
#
GWG
I run a static map server, and 3 weather stations, and would love to figure out a reverse geolocation system
#
[chrisbergr]
many years ago there were two seperate projects.. open street map and opgen geo db (not sure if that was the exact name) - I guess something like that is needed.
#
[chrisbergr]
Oh, sorry.. Just lerned open geo db is still around but only coveres germany, austria, switzerland and belgium .. That is not helpful
#
GWG
[chrisbergr]: I have ideas, it is just a large project. So, for now...
#
GWG
I added multiple different third-party providers and check them periodically.
#
GWG
[chrisbergr]: I did want to talk to you about the location provider though, from the other day
#
[chrisbergr]
About your nextcloud phonetrack solution?
#
GWG
No, I have a solution. I'm trying to figure out what might help others.
#
GWG
I have a Compass server and a copy of GPSLogger
#
GWG
I built a few options. HTML5 Geolocation, put in an address and lookup the coordinates, put it an airport code...
#
[chrisbergr]
I also used Compass years ago, but I don't remember why I set up my own database for my Overland data.
#
[chrisbergr]
You fetch the data from Compass when you make a new post in WordPress to store it in simple location?
#
GWG
[chrisbergr]: Yes, so, you could implement an API that matches the Compass API or give me a different API format to add.
#
GWG
It fetches current or historical location.
#
GWG
So, if I change the publish date, it will look up where I was at that time and store that location.
#
GWG
Simple Location stores using the old WordPress geodata fields.
#
[chrisbergr]
I like that the publish date is matched with the historical data 🙂
#
GWG
I haven't tested that in the block editor though
#
[chrisbergr]
Do you always post your "regular" posts from within wp-admin on desktop?
#
GWG
[chrisbergr]: No, I often use Micropub...which does an automatic lookup and store
#
[chrisbergr]
Do you use http://micro.blog for writing your short posts or do you automatically syndicate frow wordpress to it?
#
[chrisbergr]
But it seems like you also only store geo data in checkin posts.
#
GWG
No, I don't use micro.blog for anything. I syndicate to it, not from it
#
GWG
[chrisbergr]: I only show it... I set it to private by default
#
[chrisbergr]
ah okay, got it 🙂
#
[chrisbergr]
I'm always interested how people post on their (wordpress) site, becaus I find it pretty difficult.
#
GWG
I should put more logic behind it than that...
#
GWG
I want more engagement
#
[chrisbergr]
more logic behind what? private location data?
#
GWG
More logic so I don't have to remember to change it. I only have one option, private or public by default. And public by default if Micropub sends it in, on the theory that's a hint on intention
#
[chrisbergr]
I guess there is potential for some logic according to category, tag, and/or kind
#
GWG
Yes, but I want to create more content.
#
GWG
So better figure out how to make it easier
#
[chrisbergr]
I also want to create more content.
#
[chrisbergr]
But even writing a short post the length of a tweet takes me more than 10 minutes, which would take 30 seconds on twitter. So I just don't do it.
#
GWG
[chrisbergr]: I do it using IndiePass of late, in fact I will write one now...
#
GWG
I did that on my phone
#
[chrisbergr]
Congratulations on the achievement of having made all the switches smart 🙂
#
[chrisbergr]
Unfortunately, IndiePass does not work for me.
#
GWG
[chrisbergr]: Why not?
#
GWG
iOS user?
#
[chrisbergr]
I can only set tags. After the post is published, there is only the default category set, and I need pll (polylang) lang attribute
#
GWG
[chrisbergr]: Doesn't that sound like an issue to add to the WordPress Micropub plugin?
#
GWG
I need to do some work there anyway on that other bug
#
GWG
Or feature
#
[chrisbergr]
But there is no setting for category in the app. (of course, ios is still an old indigenious version)
#
[chrisbergr]
What would be great is a possibility to hook some actions after publishing a post via micropub. With that I could solve my issues comming from my site setup
#
GWG
[chrisbergr]: We have that
#
GWG
It's in the readme.
#
GWG
It's the most detailed list of filters and hooks in any WordPress readme, thank [snarfed]
#
[chrisbergr]
Oh wow just found it. Great documentation! 🙂 I need to free up some time to dive deeper in that, so I'm finally be able to post more comfortable
#
GWG
I should do that with more of my plugins.
#
GWG
Add a filter list
#
[chrisbergr]
Yes, that would be great. I do quite a lot of customization on the output, every time I examine your code I find an excellent number of filters that can be used.
#
GWG
I also regret not doing more docblocks
#
[chrisbergr]
You could use some grunt script for auto docblock insertation
#
[chrisbergr]
Or maybe a plugin in your editor?
#
GWG
[chrisbergr]: I think I just need to write them so I can do some scripting to create filter docs
RasAlGhoul_ joined the channel
#
GWG
[chrisbergr]: My editor is vim
#
GWG
I'm old school
[tw2113_Slack_] joined the channel
#
[tw2113_Slack_]
it shows 😛
#
GWG
[tw2113_Slack_]: How so?
#
[chrisbergr]
Speaking of missing documentation and simple location: can you tell me what the replacement is for "Loc_View::get_location"?
#
[tw2113_Slack_]
i dunno , i'm just talkin smack
#
[tw2113_Slack_]
legit ignore me 🙂
#
GWG
[chrisbergr]: Geo_Data::get_location
#
GWG
I prefer the new global, get_post_location
#
[chrisbergr]
I see a commented out line of "_Geo_Data::location_content" in my file. Those general changes always kill me ^^_
#
GWG
[chrisbergr]: Didn't read the Upgrade notice for 5.0?
#
GWG
Due to extensive refactoring in this version, there may be unanticipated behavior. Old functions have been removed and users calling them directly may need to
#
GWG
New global functions have been introduced to reduce the calls to specific classes. Weather and location data has been separated into separate storage locations and functions, with a new
#
GWG
signature based on the Metadata API. This means that rolling back once the data is migrated could be problematic and the recommendation is to backup before upgrading.
#
GWG
I wanted to reduce calling the class functions
#
[chrisbergr]
I've seen the upgrade notice and there is no problem at all. I noticed the old call caused an error so I just commented the line of code out. Now that I know the new call I can search for the function and figure out how to get the output I want back in
#
GWG
I simplified a lot of things
#
[chrisbergr]
Now it's working again, that was easy, thanks 🙂
#
GWG
If you look at the new globals... I have one for every data structure
#
GWG
Post Location, Post Weather, Comment Weather, Comment location, etc
#
[chrisbergr]
Great 🙂
#
[chrisbergr]
There is an issue with map zoom level (at least on my site with geoapify)
#
[chrisbergr]
I've set 14 as default in the settings. All my venues have 18 stored and all new checkins use that 18... I always have to manually change it
#
[chrisbergr]
I'll take a closer look and post an issue on github. It has become quite late by now
#
GWG
[chrisbergr]: There's a formula, but I open the issue
[aciccarello], RasAlGhoul_, RasAlGhoul__, Loqi__, sebbu, IWSlackGateway, Guest6, [KevinMarks], KMF and [chrisbergr] joined the channel
#
GWG
Greetings from a parking lot
#
[chrisbergr]
Oh that's something new :)
#
GWG
I'm waiting to pick up my parents at the airport, but their plane can't get a gate, so I'm at the cell phone waiting area
#
GWG
And you? What's on your mind?
#
[chrisbergr]
I'm laying on my sofa 🙂 I wanted to come back to the micropub hooks again.
#
GWG
Go on?
#
[chrisbergr]
I read the documentation and inspected the endpoint class.. As far as I can see there is no hook after the post is created.
#
GWG
The plane landed over half an hour ago...
#
[chrisbergr]
For some things I'd like to do I need the real post ID.
#
GWG
Try after_micropub
#
GWG
It has the post_id
#
GWG
In $args['ID']
#
[chrisbergr]
And the post object does exist at the moment this is triggered?
#
GWG
Yes, of course, the before one is called before_micropub
#
[chrisbergr]
Okay, great, then I can continue to work with that. Thanks 🙂
#
[chrisbergr]
I hope you don't have to wait much longer.
#
GWG
I use it here in my location code
#
[chrisbergr]
Good example, thanks
#
[chrisbergr]
Oh, there I see the map zoom level thingy you noticed yesterday
#
GWG
It relates well to the previous conversation about how I do location
#
[chrisbergr]
I really do want always use map zoom 14. Do you think there is a possibility for a setting "Always use default Map Zoom Level"?
#
[chrisbergr]
Or a filter doing the same
#
GWG
[chrisbergr]: Open an issue, I'll have a look at where and why I overwrite it... I know I tried to make the map smart about the zoom level
#
GWG
I don't remember the details
#
[chrisbergr]
Yes, I see the math according to geo accuracy.. I guess it makes a lot of sense. But mavericks like me always want something special ^^
#
GWG
[chrisbergr]: There is another thing.... I was annoyed that the zoom was unviewable for some things
#
GWG
I think I set it specifically for checkins at one point, for example
#
[chrisbergr]
Yes, in micropub_set_location you have a check for 'checkin' and if so you'll youse 18.
#
GWG
[chrisbergr]: What do you want to do with the hook?
#
[chrisbergr]
"youse"?? Funny creation
#
GWG
I knew I had done something
#
[chrisbergr]
with the micropub hook? set polylang data, post must exist before.
#
[chrisbergr]
And I need to change the post format and post kind. Guess that could be done before.
capjamesg left the channel
#
GWG
[chrisbergr]: Before is before it is parsed.
#
GWG
Sorry, circling a lot
#
[chrisbergr]
I got everything in 'after_micropub' to work except 'set_post_format'.... Let's see what the problem is.
#
[chrisbergr]
yes! just called to early. prio 90 fixed it 🙂
#
[chrisbergr]
Interestingly no post date is displayed in the frontend
#
GWG
[chrisbergr]: That's a theme matter, isn't it?
#
[chrisbergr]
if I do wp_update_post(
#
[chrisbergr]
'post_date' => $now,
#
[chrisbergr]
'ID' => $post_id,
#
[chrisbergr]
'post_date_gmt' => get_gmt_from_date( $now ),
#
[chrisbergr]
the date will be displayed. wrong timezone but it's there. Not sure what exactly causes the issue.
#
[chrisbergr]
On a client project I noticed that after programmatically adding new posts the function 'the_post_date' returns empty but 'echo get_the_date' contains the right value...
#
GWG
Odd
#
[chrisbergr]
Yes, until I find out more, I can't say anything qualified about it. I just mentioned it in case someone might have made the same observation before.
#
[chrisbergr]
But I have managed it now. So I can actually use IndiePass (Indigenious) now, that makes me very happy 🙂
#
[chrisbergr]
I have to go to bed now. Have a nice evening with your parents, David 🙂