(i.e., how do I do the
add_action('init','register_my_custom_post_type')
, etc. with a class)?
You pass the callback from inside the class, using $this
:
add_action( 'init', array( $this, 'register_my_custom_post_type' ) );
(i.e., how do I do the
add_action('init','register_my_custom_post_type')
, etc. with a class)?
You pass the callback from inside the class, using $this
:
add_action( 'init', array( $this, 'register_my_custom_post_type' ) );