* @license GPL-2.0+ * @link http://webgilde.com * @copyright 2014 Thomas Maier, webgilde GmbH * * Class containing information about the plain text/code ad type * * see ad-type-content.php for a better sample on ad type * */ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract{ /** * ID - internal type of the ad type * * * @since 1.0.0 */ public $ID = 'plain'; /** * set basic attributes * * @since 1.0.0 */ public function __construct() { $this->title = __( 'Plain Text and Code', 'advanced-ads' ); $this->description = __( 'Any ad network, Amazon, customized AdSense codes, shortcodes, and code like JavaScript, HTML or PHP.', 'advanced-ads' ); $this->parameters = array( 'content' => '' ); } /** * output for the ad parameters metabox * * this will be loaded using ajax when changing the ad type radio buttons * echo the output right away here * name parameters must be in the "advanced_ads" array * * @param obj $ad ad object * @since 1.0.0 */ public function render_parameters($ad){ // load content $content = (isset($ad->content)) ? $ad->content : ''; ?>
render_php_allow($ad); $this->render_shortcodes_allow( $ad ); ?>content)) ? $ad->content : ''; // check if php is allowed if ( isset($ad->output['allow_php']) ){ $allow_php = absint( $ad->output['allow_php'] ); } else { /** * for compatibility for ads with php added prior to 1.3.18 * check if there is php code in the content */ if ( preg_match( '/\<\?php/', $content ) ){ $allow_php = 1; } else { $allow_php = 0; } } ?>