LLMS_Controller_Achievements::get_text( int $text_type, array $variables = array() )
Returns a translated text of the given type.
Parameters Parameters
- $text_type
-
(int) (Required) One of the LLMS_Abstract_Controller_User*Engagements::TEXT* constants.
- $variables
-
(array) (Optional) variables that are used in sprintf().
Default value: array()
Return Return
(string)
Source Source
File: includes/controllers/class.llms.controller.achievements.php
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | protected function get_text( $text_type , $variables = array () ) { switch ( $text_type ) { case self::TEXT_SYNC_AWARDED_ENGAGEMENT_INSUFFICIENT_PERMISSIONS: return sprintf( /* translators: %1$d: awarded achievement ID */ __( 'Sorry, you are not allowed to edit the awarded achievement #%1$d.' , 'lifterlms' ), ( $variables [ 'engagement_id' ] ?? 0 ) ); case self::TEXT_SYNC_AWARDED_ENGAGEMENT_INVALID_TEMPLATE: return sprintf( /* translators: %1$d: awarded achievement ID */ __( 'Sorry, the awarded achievement #%1$d does not have a valid achievement template.' , 'lifterlms' ), ( $variables [ 'engagement_id' ] ?? 0 ) ); case self::TEXT_SYNC_AWARDED_ENGAGEMENTS_INSUFFICIENT_PERMISSIONS: return __( 'Sorry, you are not allowed to edit awarded achievements.' , 'lifterlms' ); case self::TEXT_SYNC_AWARDED_ENGAGEMENTS_INVALID_NONCE: return __( 'Sorry, you are not allowed to sync awarded achievements.' , 'lifterlms' ); case self::TEXT_SYNC_MISSING_AWARDED_ENGAGEMENT_ID: return __( 'Sorry, you need to provide a valid awarded achievement ID.' , 'lifterlms' ); case self::TEXT_SYNC_MISSING_ENGAGEMENT_TEMPLATE_ID: return __( 'Sorry, you need to provide a valid achievement template ID.' , 'lifterlms' ); default : return parent::get_text( $text_type ); } } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |