Skip to content

u/beefyjon

In this archive from Jan 2019 to Apr 2019

2
posts
6
comments
0
media
108
score

register_activation_hook and similar - why pass in an array as second argument instead of '$foo->activate'?

I thought in PHP you access non-static class methods by instantiating the class and then using arrow syntax like in the title to (quite literally) point to the method. Yet the WordPress developer docs here say different, to make an array instead: register_activation_hook( FILE, array( 'MyPlugin', 'i...

2 points2 comments
Open on Reddit

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.