I have a function that when it comes to calling from another plugin I call it this way
add_action( 'du_postSaveEvent', [ 'Lever\Api\Providers\ShareService', 'postSaveEvent' ], 10, 3 );
This works while in a plugin path.
/public_html/wp-content/plugins/
But if I call it from a page that is in
/public_html/wp-content/themes/
the thing changes and I can not execute said action
How should the action change?
The function to call is inside a plugin and has this structure.
public static function postSaveEvent ( $new_status, $old_status, $post ) {
}
Note:
That is, if I call that function from another plugin that is inside the plugins/
folder works.
But if I call it from a page that is in themes/
it doesn't work.