lightspeeddevelopment /
lsx-sharing
| 1 | <?php |
||||||
| 2 | /** |
||||||
| 3 | * LSX_Sharing_Frontend |
||||||
| 4 | * |
||||||
| 5 | * @package lsx-sharing |
||||||
| 6 | */ |
||||||
| 7 | |||||||
| 8 | namespace lsx\sharing\classes; |
||||||
| 9 | |||||||
| 10 | /** |
||||||
| 11 | * LSX Sharing front-end class. |
||||||
| 12 | * |
||||||
| 13 | * @package lsx-sharing |
||||||
| 14 | */ |
||||||
| 15 | class Frontend { |
||||||
| 16 | |||||||
| 17 | |||||||
| 18 | /** |
||||||
| 19 | * Holds class instance |
||||||
| 20 | * |
||||||
| 21 | * @since 1.0.0 |
||||||
| 22 | * |
||||||
| 23 | * @var object \lsx\sharing\classes\Frontend() |
||||||
| 24 | */ |
||||||
| 25 | protected static $instance = null; |
||||||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||||
| 26 | |||||||
| 27 | /** |
||||||
| 28 | * Holds the output class. |
||||||
| 29 | * |
||||||
| 30 | * @var object \lsx\sharing\classes\frontend\Output() |
||||||
| 31 | */ |
||||||
| 32 | public $output = null; |
||||||
| 33 | |||||||
| 34 | /** |
||||||
| 35 | * Constructor. |
||||||
| 36 | */ |
||||||
| 37 | public function __construct() { |
||||||
|
0 ignored issues
–
show
|
|||||||
| 38 | $this->load_classes(); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 39 | |||||||
| 40 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 41 | |||||||
| 42 | /** |
||||||
| 43 | * Return an instance of this class. |
||||||
| 44 | * |
||||||
| 45 | * @since 1.0.0 |
||||||
| 46 | * |
||||||
| 47 | * @return object \lsx\sharing\classes\Frontend() A single instance of this class. |
||||||
| 48 | */ |
||||||
| 49 | public static function get_instance() { |
||||||
| 50 | // If the single instance hasn't been set, set it now. |
||||||
|
0 ignored issues
–
show
|
|||||||
| 51 | if ( null == self::$instance ) { |
||||||
|
0 ignored issues
–
show
|
|||||||
| 52 | self::$instance = new self(); |
||||||
| 53 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 54 | return self::$instance; |
||||||
| 55 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 56 | |||||||
| 57 | /** |
||||||
| 58 | * Loads the plugin functions. |
||||||
| 59 | */ |
||||||
| 60 | private function load_classes() { |
||||||
| 61 | include_once LSX_SHARING_PATH . '/classes/frontend/class-button.php'; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 62 | include_once LSX_SHARING_PATH . '/classes/frontend/class-output.php'; |
||||||
| 63 | $this->output = \lsx\sharing\classes\frontend\Output::get_instance(); |
||||||
| 64 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 65 | |||||||
| 66 | /** |
||||||
|
0 ignored issues
–
show
|
|||||||
| 67 | * Backwards compatabile function for the sharing buttons. |
||||||
| 68 | */ |
||||||
| 69 | public function sharing_buttons( $buttons = array( 'facebook', 'twitter', 'pinterest' ), $echo = false, $post_id = false ) { |
||||||
| 70 | wc_deprecated_function('LSX_Sharing_Frontend::sharing_buttons()', '1.2.0', 'lsx_sharing()->frontend->output->sharing_buttons()'); |
||||||
|
0 ignored issues
–
show
The function
wc_deprecated_function was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 71 | $this->output->sharing_buttons($buttons, $echo, $post_id); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 72 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 73 | } |
||||||
| 74 |