Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] Properly Writing WordPress Plugin Constructors
<?php
public function __construct( $data_manager ) {
$this->data_manager = $data_manager;
}
public function init() {
add_action(
'hook_for_doing_something',
array( $this, 'do_something' ),
10, 1
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment