I'm trying to remove two of the actions that adds a plugin (sportspress specifically). The actions of this plugins are:
add_action('sportspress_before_single_player','sportspress_output_player_details', 15);
add_action('sportspress_single_player_content','sportspress_output_player_statistics',20);
I've created a plugin, and I want to remove these hooks, this is my code:
<?php
/*
Plugin Name: my plugin
Description: Plugin to override plugins' hooks
Version: 0.1
Author: Company Name
Author URI: http://www.example.com/
License: GPL2
*/
add_action('plugins_loaded','remove_hooks');
function remove_hooks(){
remove_action( 'sportspress_before_single_player', 'sportspress_output_player_details' );
remove_action( 'sportspress_single_player_content', 'sportspress_output_player_statistics' );
}
I've searched and tried a lot of things, but I can't make it work.
the_content
as the hook instead ofplugins_loaded
?