| 1 |
<?php |
| 2 |
/** |
| 3 |
* The abstract class of the plugin. |
| 4 |
* |
| 5 |
* @package Smart_Post_Show |
| 6 |
* @subpackage Smart_Post_Show/views/sp-framework/classes |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die; } // Cannot access directly. |
| 11 |
|
| 12 |
if ( ! class_exists( 'SP_PC_Abstract' ) ) { |
| 13 |
/** |
| 14 |
* |
| 15 |
* Abstract Class |
| 16 |
* |
| 17 |
* @since 1.0.0 |
| 18 |
* @version 1.0.0 |
| 19 |
*/ |
| 20 |
abstract class SP_PC_Abstract { |
| 21 |
|
| 22 |
/** |
| 23 |
* $abstract variable |
| 24 |
* |
| 25 |
* @var string |
| 26 |
*/ |
| 27 |
public $abstract = ''; |
| 28 |
|
| 29 |
/** |
| 30 |
* $output_css variable |
| 31 |
* |
| 32 |
* @var string |
| 33 |
*/ |
| 34 |
public $output_css = ''; |
| 35 |
|
| 36 |
/** |
| 37 |
* $typographies variable |
| 38 |
* |
| 39 |
* @var array |
| 40 |
*/ |
| 41 |
public $typographies = array(); |
| 42 |
|
| 43 |
/** |
| 44 |
* Constructor of the class. |
| 45 |
*/ |
| 46 |
public function __construct() { |
| 47 |
|
| 48 |
// Check for embed custom css styles. |
| 49 |
if ( ! empty( $this->args['output_css'] ) ) { |
| 50 |
add_action( 'wp_head', array( &$this, 'add_output_css' ), 100 ); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Add output CSS. |
| 56 |
* |
| 57 |
* @return void |
| 58 |
*/ |
| 59 |
public function add_output_css() { |
| 60 |
|
| 61 |
$this->output_css = apply_filters( "SP_PC_{$this->unique}_output_css", $this->output_css, $this ); |
| 62 |
|
| 63 |
if ( ! empty( $this->output_css ) ) { |
| 64 |
echo '<style type="text/css">' . esc_html( $this->output_css ) . '</style>'; |
| 65 |
} |
| 66 |
} |
| 67 |
} |
| 68 |
} |
| 69 |
|