How i can filter (hook) function inside Wordpress Class?
I have a plugin example:
class ProductCustomPostType {
function __construct() {
..
add_action( 'manage_posts_custom_column', array( $this, 'managePostCustomColumns' ) );
}
function managePostCustomColumns( $column_name ){
开发者_高级运维 ...
}
}
I need to hook function managePostCustomColumns from functions.php with add_filter action.
How i can do it? Thank you!
If you want to hook custom code when a filter is applied, you have to call:
add_filter( 'manage_posts_custom_column', array( $this, 'managePostCustomColumns' ) );
If you need to call all functions, hooked to a specific filer, use:
apply_filters('manage_posts_custom_column', 'column_name')
take a look at the link and look at comments too, answer is in comments. this might help you.
Override plugin with functions.php
精彩评论