Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the CPT objects #56

Closed
shadyvb opened this issue Sep 20, 2016 · 2 comments
Closed

Expose the CPT objects #56

shadyvb opened this issue Sep 20, 2016 · 2 comments

Comments

@shadyvb
Copy link

shadyvb commented Sep 20, 2016

There is times where we'd need to remove/add/alter some hooks, so far I've not found a way to catch a CPT object unless I save the reference somewhere on the time of registration, which isn't always the best way of doing that in a pluggable env.

Something along these lines would be useful:

add_filter( 'ext-cpts/{$cpt}/instance', function() use ( $instance ) { return $instance; } );
@johnbillion
Copy link
Owner

I think I'll do this as an action.

do_action( "ext-cpts/{$post_type}/instance", Extended_CPT $this );

Does that work for your use case?

@shadyvb
Copy link
Author

shadyvb commented Mar 21, 2017

I believe it might, can't really remember the exact case, but this should probably do it.

@johnbillion johnbillion added this to the 3.1 milestone Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants