| @@ -80,25 +80,8 @@ | ||
| 80 | 80 | $lp_course_item = $course_item; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * Check if current course item is viewing is a $type | |
| 85 | - * | |
| 86 | - * @param string $type | |
| 87 | - * | |
| 88 | - * @return bool | |
| 89 | - */ | |
| 90 | - public static function is_course_item_type( $type ) { | |
| 91 | - $item = self::course_item(); | |
| 92 | - | |
| 93 | - if ( $item ) { | |
| 94 | - return $type === get_post_type( $item->get_id() ); | |
| 95 | - } | |
| 96 | - | |
| 97 | - return false; | |
| 98 | - } | |
| 99 | - | |
| 100 | - /** | |
| 101 | 84 | * @param bool $get_only_id |
| 102 | 85 | * Todo: new call not use $get_only_id, only call LP_Global::courses() |
| 103 | 86 | * Recommend use learn_press_get_course() |
| 104 | 87 | * |
| @@ -121,9 +104,13 @@ | ||
| 121 | 104 | return $lp_course; |
| 122 | 105 | } |
| 123 | 106 | } |
| 124 | 107 | |
| 108 | + /** | |
| 109 | + * @deprecated 4.1.7.3 | |
| 110 | + */ | |
| 125 | 111 | public static function set_course( $course ) { |
| 112 | + _deprecated_function( __FUNCTION__, '4.1.7.3' ); | |
| 126 | 113 | global $lp_course; |
| 127 | 114 | |
| 128 | 115 | if ( self::$_course === false ) { |
| 129 | 116 | self::$_course = $lp_course; |
| @@ -143,25 +130,8 @@ | ||
| 143 | 130 | return $lp_user; |
| 144 | 131 | } |
| 145 | 132 | |
| 146 | 133 | /** |
| 147 | - * Set global user | |
| 148 | - * | |
| 149 | - * @param LP_User $user | |
| 150 | - */ | |
| 151 | - // public static function set_user( $user = null ) { | |
| 152 | - // global $lp_user; | |
| 153 | - // | |
| 154 | - // var_dump(debug_backtrace()); | |
| 155 | - // | |
| 156 | - // if ( false === self::$_user ) { | |
| 157 | - // self::$_user = $lp_user; | |
| 158 | - // } | |
| 159 | - // | |
| 160 | - // $lp_user = $user; | |
| 161 | - // } | |
| 162 | - | |
| 163 | - /** | |
| 164 | 134 | * Alias of course item for highlighting in dev |
| 165 | 135 | * |
| 166 | 136 | * @return LP_Quiz|bool |
| 167 | 137 | */ |
| @@ -181,10 +151,12 @@ | ||
| 181 | 151 | } |
| 182 | 152 | |
| 183 | 153 | /** |
| 184 | 154 | * Reset global variables to default |
| 155 | + * @deprecated 4.1.7.3 | |
| 185 | 156 | */ |
| 186 | 157 | public static function reset() { |
| 158 | + _deprecated_function( __FUNCTION__, '4.1.7.3' ); | |
| 187 | 159 | global $lp_user, $lp_course, $lp_course_item, $lp_quiz_question; |
| 188 | 160 | |
| 189 | 161 | if ( self::$_user ) { |
| 190 | 162 | $lp_user = self::$_user; |
| @@ -207,33 +179,17 @@ | ||
| 207 | 179 | */ |
| 208 | 180 | public static function profile( $global = false, $reset = false ) { |
| 209 | 181 | global $profile; |
| 210 | 182 | |
| 211 | - if ( ! $profile ) { | |
| 212 | - //self::$_profile = $profile = LP_Profile::instance( get_current_user_id() ); | |
| 213 | - } | |
| 214 | - | |
| 215 | 183 | return LP_Profile::instance(); |
| 216 | - | |
| 217 | - /** | |
| 218 | - * Get origin global $profile (stored in class) if $global = TRUE | |
| 219 | - */ | |
| 220 | - if ( $global ) { | |
| 221 | - | |
| 222 | - /** | |
| 223 | - * If $reset = TRUE then set global $profile to origin global $profile (stored in class) | |
| 224 | - */ | |
| 225 | - if ( ! $reset ) { | |
| 226 | - return self::$_profile; | |
| 227 | - } | |
| 228 | - | |
| 229 | - $profile = self::$_profile; | |
| 230 | - } | |
| 231 | - | |
| 232 | - return $profile; | |
| 233 | 184 | } |
| 234 | 185 | |
| 186 | + /** | |
| 187 | + * @deprecated 4.2.6.2 | |
| 188 | + */ | |
| 235 | 189 | public static function init() { |
| 190 | + _deprecated_function( __METHOD__, '4.2.6.2' ); | |
| 191 | + return; | |
| 236 | 192 | global $profile; |
| 237 | 193 | self::$_profile = $profile = LP_Profile::instance( get_current_user_id() ); |
| 238 | 194 | } |
| 239 | 195 | |
| @@ -347,16 +303,6 @@ | ||
| 347 | 303 | } |
| 348 | 304 | } |
| 349 | 305 | |
| 350 | 306 | return self::$object_support_features[ $object_type ]; |
| 351 | - } | |
| 352 | - | |
| 353 | - /** | |
| 354 | - * @param $user | |
| 355 | - * | |
| 356 | - * @return false | |
| 357 | - * @deprecated 4.0.0 | |
| 358 | - */ | |
| 359 | - public function set_user( $user ) { | |
| 360 | - return false; | |
| 361 | 307 | } |
| 362 | 308 | } |