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