@יוסף-בן-שמעון אמר בFatal error: Class not found...:
תוכל להעלות את הקוד של הקלאס?
class validateTimeExpSimulatoer {
private $timestemp_for_post = '';
private $sec_validatio_post = '';
public $error_msg = '';
public $simulator_timing = '';
private static $post_id = '';
public function __construct($post_id){
$this -> timestemp_for_post = get_the_time('U', $post_id);
$this -> sec_validatio_post = time() - $this -> timestemp_for_post;
$this -> post_id = $post_id;
return($this -> checked_closed($post_id));
}//end function starter
private function checked_closed($post_id){
if(!get_field('status_post', $post_id)){
return( $this -> error_msg = 'closed');
}else{
return($this -> valiate_blocked($post_id));
}
}//end function checked_closed
private function valiate_blocked($post_id){
$sec_validatio_post = $this -> sec_validatio_post;
/******************************/
//בדיקת הזמן המותר והשמה למשנה//
if(get_field('exp_true', 'option')){
if(get_field('extra_dey_user', $post_id)){
$sec_validation = (int)get_field('dey_user_indevedual', $post_id)*86400;
}else{
$sec_validation = (int)get_field('dey_play_for_user', 'option')*86400;
}
}else{
$sec_validation = (int)get_field('dey_play_for_user', 'option')*86400;
}
/********************/
$this -> simulator_timing = $sec_validation;
if($sec_validatio_post > $sec_validation){
return($this -> error_msg = "blocked");
}
}
}
אבל גילית דבר חשוב, ברגע ששמתי את הקלאס בתקייה של הקובץ שמייבא אותו זה עובד מצויין
שימוש בפונקצייה המובנת בוורדפרס
get_stylesheet_directory_uri()
או דומה לזה, ואפי' גישה ישירה עם נתיב מלא פשוט מחזיר את השגיאה הנ"ל