1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72:
<?php
if (!class_exists('CTA_Dynamic_Widget')) {
class CTA_Dynamic_Widget extends WP_Widget {
public function __construct() {
$widget_ops = array('classname' => 'class_CTA_Dynamic_Widget', 'description' => __('Use this widget to accept Calls to Action placements.', 'inbound-pro'));
parent::__construct('id_wp_cta_dynamic_widget', __('Call to Action Placement Holder', 'inbound-pro'), $widget_ops);
}
public function widget($args, $instance) {
do_action('wp_cta_cta_dynamic_widget');
}
public function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
return $instance;
}
public function form($instance) {
$defaults = array();
$instance = wp_parse_args((array)$instance, $defaults); ?>
<!-- Widget Title: Text Input -->
<p>
<?php _e('This call to action area is dynamic. It will be completely empty unless you have toggled on a call to action on the individual pages settings and selected the "sidebar" option.', 'inbound-pro'); ?>
</p>
<?php
}
}
function cta_load_dynamic_widget() {
register_widget('CTA_Dynamic_Widget');
}
add_action('widgets_init', 'cta_load_dynamic_widget');
}