| 1 |
<?php |
| 2 |
/** |
| 3 |
* ManageWP_Widget Class |
| 4 |
*/ |
| 5 |
class ManageWP_Widget extends WP_Widget { |
| 6 |
|
| 7 |
|
| 8 |
/** constructor -- name this the same as the class above */ |
| 9 |
function ManageWP_Widget() { |
| 10 |
parent::WP_Widget(false, $name = 'ManageWP', array('description' => 'ManageWP widget.')); |
| 11 |
} |
| 12 |
|
| 13 |
/** @see WP_Widget::widget -- do not rename this */ |
| 14 |
function widget($args, $instance) { |
| 15 |
extract( $args ); |
| 16 |
$instance['title'] = 'ManageWP'; |
| 17 |
$instance['message'] = 'We are happily using <a href="http://managewp.com" target="_blank">ManageWP</a>'; |
| 18 |
$title = apply_filters('widget_title', $instance['title']); |
| 19 |
$message = $instance['message']; |
| 20 |
?> |
| 21 |
<?php echo $before_widget; ?> |
| 22 |
<?php if ( $title ) |
| 23 |
echo $before_title . $title . $after_title; ?> |
| 24 |
<ul> |
| 25 |
<li><?php echo $message; ?></li> |
| 26 |
</ul> |
| 27 |
<?php echo $after_widget; ?> |
| 28 |
<?php |
| 29 |
} |
| 30 |
|
| 31 |
/** @see WP_Widget::form -- do not rename this */ |
| 32 |
function form($instance) { |
| 33 |
$title = 'ManageWP'; |
| 34 |
$message = 'We are happily using <a href="http://managewp.com" target="_blank">ManageWP</a>'; |
| 35 |
echo '<p>'.$message.'</p>'; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
} // end class example_widget |
| 40 |
|
| 41 |
$mwp_worker_brand = get_option("mwp_worker_brand"); |
| 42 |
$worker_brand = 0; |
| 43 |
if(is_array($mwp_worker_brand)){ |
| 44 |
if($mwp_worker_brand['name'] || $mwp_worker_brand['desc'] || $mwp_worker_brand['author'] || $mwp_worker_brand['author_url']){ |
| 45 |
$worker_brand= 1; |
| 46 |
} |
| 47 |
} |
| 48 |
if(!$worker_brand){ |
| 49 |
add_action('widgets_init', create_function('', 'return register_widget("ManageWP_Widget");')); |
| 50 |
} |
| 51 |
|
| 52 |
?> |