public static function placeholder_to_course_image($show, $post_id) { $course_id = !empty($post_id) ? get_post_meta($post_id, 'course_id', true) : 0; if (!empty($course_id)) { self::$course_id = $course_id; add_filter('mp_default_product_img', array(__CLASS__, 'replace_image')); return 1; } return $show; }