| Server IP : 89.108.64.180 / Your IP : 216.73.217.92 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/calluna-core/widgets/ |
Upload File : |
<?php
/**
* Calluna Twitter widget
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Start widget class
if( !class_exists('Calluna_Core_Twitter_Widget') ){
class Calluna_Core_Twitter_Widget extends WP_Widget {
/**
* Register widget with WordPress.
*
*/
function __construct() {
parent::__construct(FALSE, $name = esc_html__('Calluna Twitter Feed', 'calluna-td'), array(
'description' => esc_html__('Show your twitter tweets.', 'calluna-td')
));
}
/**
* Front-end display of widget.
*
*/
function widget( $args, $instance ) {
echo $args['before_widget'];
if ( ! empty( $instance['title'] ) )
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];
if ( isset( $instance['username'] ) )
echo '<div class="twitter-feed"><div class="tweets-feed" data-widget-id="'. $instance['username'] .'"></div></div>';
echo $args['after_widget'];
}
// Widget Form
function form( $instance ) {
$defaults = array(
'title' => 'Twitter Tweets',
'username' => ''
);
$instance = wp_parse_args((array) $instance, $defaults);
extract($instance);
?>
<p>
<label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php esc_html_e( 'Title:', 'calluna-td' ); ?></label>
<input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
</p>
<p>
<label for="<?php echo esc_attr($this->get_field_id( 'username' )); ?>"><?php echo sprintf( wp_kses( __( 'Twitter Username', 'calluna-td' ), array( 'code' => array( ) ) ) ) ?>
</label>
<input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'username' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'username' )); ?>" type="text" value="<?php echo esc_attr( $username ); ?>">
</p>
<?php
}
// Update the widget
function update( $new_instance, $old_instance ) {
return $new_instance;
}
}
}
// Register the Calluna Twitter Widget
if ( ! function_exists( 'calluna_core_register_twitter_widget' ) ) {
function calluna_core_register_twitter_widget() {
register_widget( 'Calluna_Core_Twitter_Widget' );
}
}
add_action( 'widgets_init', 'calluna_core_register_twitter_widget' );