| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPPIZZA_MARKUP_OPTIONS Class |
| 4 |
* |
| 5 |
* @package WPPIZZA |
| 6 |
* @subpackage WPPizza Options |
| 7 |
* @copyright Copyright (c) 2015, Oliver Bach |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 3.12.14 |
| 10 |
* |
| 11 |
*/ |
| 12 |
if ( ! defined( 'ABSPATH' ) ) exit;/*Exit if accessed directly*/ |
| 13 |
|
| 14 |
/* ================================================================================================================================= * |
| 15 |
* |
| 16 |
* |
| 17 |
* SIMPLY OUTPUTS SOME WPPIZZA OPTIONS SET BY SHORTCODE |
| 18 |
* CLASS - WPPIZZA_MARKUP_OPTIONS |
| 19 |
* |
| 20 |
* |
| 21 |
* |
| 22 |
* ================================================================================================================================= */ |
| 23 |
|
| 24 |
class WPPIZZA_MARKUP_OPTIONS{ |
| 25 |
|
| 26 |
/****************************************************************************** |
| 27 |
* |
| 28 |
* |
| 29 |
* [construct] |
| 30 |
* |
| 31 |
* |
| 32 |
*******************************************************************************/ |
| 33 |
function __construct() { |
| 34 |
} |
| 35 |
|
| 36 |
/****************************************************************************** |
| 37 |
* |
| 38 |
* |
| 39 |
* [methods] |
| 40 |
* |
| 41 |
* |
| 42 |
*******************************************************************************/ |
| 43 |
/*************************************** |
| 44 |
[apply attributes] |
| 45 |
***************************************/ |
| 46 |
function attributes($atts=null){ |
| 47 |
/**get markup**/ |
| 48 |
$markup = $this->get_markup($atts); |
| 49 |
return $markup; |
| 50 |
} |
| 51 |
|
| 52 |
/*************************************** |
| 53 |
[markup] |
| 54 |
***************************************/ |
| 55 |
function get_markup($atts){ |
| 56 |
global $wppizza_options; |
| 57 |
|
| 58 |
if(empty($atts['page']) || empty($atts['parameter'])){ |
| 59 |
return ''; |
| 60 |
} |
| 61 |
//only non arrays (otherwsie simply using the global $wppizza_options would be more appropriate one would think) |
| 62 |
if(!empty($wppizza_options[$atts['page']][$atts['parameter']]) && !is_array($wppizza_options[$atts['page']][$atts['parameter']])){ |
| 63 |
$markup = $wppizza_options[$atts['page']][$atts['parameter']]; |
| 64 |
return $markup; |
| 65 |
}else{ |
| 66 |
return ''; |
| 67 |
} |
| 68 |
return; |
| 69 |
} |
| 70 |
|
| 71 |
} |
| 72 |
?> |