I have some trouble with regular wordpress functions in class methods
I save post meta like this and Its works fine:
But when i try update meta use same method, it doesnt work! why?
Thats i invoke this
I save post meta like this and Its works fine:
Code:
public function saveMetadata( $postname ) {
$post_id = $_POST[ 'post_ID' ];
$post_holder = $_POST[ $postname ];
update_post_meta( $post_id, $postname, $post_holder );
}
But when i try update meta use same method, it doesnt work! why?
Thats i invoke this
Code:
//creation and run object
add_action( 'save_post', $quality->saveMetadata( 'project_quality' ) );