LLMS_Shortcode_Membership_Link
Source Source
File: includes/shortcodes/class.llms.shortcode.membership.link.php
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | class LLMS_Shortcode_Membership_Link extends LLMS_Shortcode { /** * Shortcode tag * * @var string */ public $tag = 'lifterlms_membership_link' ; /** * Retrieve the actual content of the shortcode * * $atts & $content are both filtered before being passed to get_output() * output is filtered so the return of get_output() doesn't need its own filter * * @return string * @since 3.4.3 * @version 3.4.3 */ protected function get_output() { return '<a href="' . get_permalink( $this ->get_attribute( 'id' ) ) . '">' . $this ->get_content() . '</a>' ; } /** * Retrieves an array of default attributes which are automatically merged * with the user submitted attributes and passed to $this->get_output() * * @return array * @since 3.4.3 * @version 3.4.3 */ protected function get_default_attributes() { return array ( 'id' => get_the_ID(), ); } /** * Retrieves a string used for default content which is used if no content is supplied * * @return string * @since 3.4.3 * @version 3.4.3 */ protected function get_default_content( $atts = array () ) { return apply_filters( 'lifterlms_membership_link_text' , get_the_title( $this ->get_attribute( 'id' ) ), $this ->get_attribute( 'id' ) ); } } |
Expand full source code Collapse full source code View on GitHub
Methods Methods
- get_default_attributes — Retrieves an array of default attributes which are automatically merged with the user submitted attributes and passed to $this->get_output()
- get_default_content — Retrieves a string used for default content which is used if no content is supplied
- get_output — Retrieve the actual content of the shortcode
Changelog Changelog
Version | Description |
---|---|
3.4.3 | Unknown. |
3.0.0 | Introduced. |