Settings';
array_unshift($links, $settings_link);
return $links;
}
}
add_filter("plugin_action_links_".plugin_basename(__FILE__), 'aklamatorPro_plugin_settings_link',10 ,2);
/*
* Activation Hook
*/
register_activation_hook( __FILE__, 'set_up_optionsPro' );
function set_up_optionsPro(){
add_option('aklamatorProApplicationID', '');
add_option('aklamatorProPoweredBy', '');
add_option('aklamatorProSingleWidgetID', '');
add_option('aklamatorProPageWidgetID', '');
add_option('aklamatorProSingleWidgetTitle', '');
// Ads codes
add_option('aklamatorProAds', '');
add_option('aklamatorProAds2', '');
add_option('aklamatorProAds3', '');
// Custom Ads names
add_option('aklamatorProAds1Name', '');
add_option('aklamatorProAds2Name', '');
add_option('aklamatorProAds3Name', '');
}
/*
* Uninstall Hook
*/
register_uninstall_hook(__FILE__, 'aklamatorPro_uninstall');
function aklamatorPro_uninstall()
{
delete_option('aklamatorProApplicationID');
delete_option('aklamatorProPoweredBy');
delete_option('aklamatorProSingleWidgetID');
delete_option('aklamatorProPageWidgetID');
delete_option('aklamatorProSingleWidgetTitle');
// Ads codes
delete_option('aklamatorProAds');
delete_option('aklamatorProAds2');
delete_option('aklamatorProAds3');
// Custom Ad names
delete_option('aklamatorProAds1Name');
delete_option('aklamatorProAds2Name');
delete_option('aklamatorProAds3Name');
}
if (!function_exists("bottom_of_every_postPro")) {
function bottom_of_every_postPro($content)
{
/* we want to change `the_content` of posts, not pages
and the text file must exist for this to work */
if (is_single()) {
$widget_id = get_option('aklamatorProSingleWidgetID');
} elseif (is_page()) {
$widget_id = get_option('aklamatorProPageWidgetID');
} else {
/* if `the_content` belongs to a page or our file is missing
the result of this filter is no change to `the_content` */
return $content;
}
$title = "";
if (get_option('aklamatorProSingleWidgetTitle') !== '') {
$title .= "
" . get_option('aklamatorProSingleWidgetTitle') . "
";
}
if (strlen($widget_id) > 7) {
return $content . $title . stripslashes(htmlspecialchars_decode($widget_id)) . "";
} else {
/* append the text file contents to the end of `the_content` */
return $content . $title . "
" . "
";
}
}
}
// Include Admin section
require_once('aklamator-pro-adsense-admin.php');
// Widget section
add_action( 'after_setup_theme', 'vw_setup_vw_widgets_init_aklamatorPro' );
function vw_setup_vw_widgets_init_aklamatorPro() {
add_action( 'widgets_init', 'vw_widgets_init_aklamatorPro' );
}
function vw_widgets_init_aklamatorPro() {
register_widget( 'Wp_widget_aklamatorPro' );
}
class Wp_widget_aklamatorPro extends WP_Widget {
private $default = array(
'supertitle' => '',
'title' => '',
'content' => '',
);
public function __construct() {
// widget actual processes
parent::__construct(
'wp_widget_aklamatorPro', // Base ID
'Aklamator Digital PR Pro', // Name
array( 'description' => __( 'Display Aklamator Widgets in Sidebar')) // Args
);
}
function widget( $args, $instance ) {
extract($args);
//var_dump($instance); die();
$supertitle_html = '';
if ( ! empty( $instance['supertitle'] ) ) {
$supertitle_html = sprintf( __( '%s', 'envirra' ), $instance['supertitle'] );
}
$title_html = '';
if ( ! empty( $instance['title'] ) ) {
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base);
$title_html = $supertitle_html.$title;
}
echo $before_widget;
if ( $instance['title'] ) echo $before_title . $title_html . $after_title;
?>
show_widget(do_shortcode( $instance['widget_id'] )); ?>
7)
echo $widget_id;
else { ?>
default );
$supertitle = strip_tags( $instance['supertitle'] );
$title = strip_tags( $instance['title'] );
$content = $instance['content'];
$widget_id = $instance['widget_id'];
if($widget_data->api_data->data[0]->uniq_name != 'none'): ?>
Please make sure that you configured Aklamator plugin correctly
Click here to configure Aklamator plugin