Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /proc/self/cwd/wp-content/themes/catalyst/lib/widgets/ |
Upload File : |
<?php
/**
* Builds and registers the Catalyst PHP Text Widget.
*
* @package Catalyst
*/
/**
* Build the Catayst PHP Text Widget class and function.
*
* @package Catalyst
* @since 1.0
*/
class catalyst_php_text_widget extends WP_Widget {
function __construct()
{
$widget_setup = array( 'classname' => 'php-text', 'description' => __( 'Allows the execution of PHP code', 'catalyst' ) );
$widget_panel = array( 'width' => 400, 'height' => 350, 'id_base' => 'php-text' );
$this->WP_Widget( 'php-text', __( 'Catalyst | PHP Text', 'catalyst' ), $widget_setup, $widget_panel );
}
function widget( $args, $options )
{
extract( $args );
$recovery_mode = 'off';
$title = apply_filters( 'widget_title', empty( $options['title'] ) ? '' : $options['title'], $options );
$text = apply_filters( 'widget_execphp', $options['text'], $options );
echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
if( $recovery_mode == 'off' )
{
ob_start();
eval( '?>' . $text );
$text = ob_get_contents();
ob_end_clean();
}
?>
<div class="php-textwidget"><?php echo $options['filter'] ? wpautop( $text ) : $text; ?></div>
<?php
echo $after_widget;
}
function update( $new_options, $old_options )
{
$options = $old_options;
$options['title'] = strip_tags( $new_options['title'] );
if ( current_user_can( 'unfiltered_html' ) )
$options['text'] = $new_options['text'];
else
$options['text'] = stripslashes( wp_filter_post_kses( $new_options['text'] ) );
$options['filter'] = isset( $new_options['filter'] );
return $options;
}
function form( $options )
{
$options = wp_parse_args( ( array )$options, array( 'title' => '', 'text' => '' ) );
$title = strip_tags( $options['title'] );
$text = format_to_edit( $options['text'] );
?>
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
<textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo $text; ?></textarea>
<p><input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox" <?php checked( isset( $options['filter'] ) ? $options['filter'] : 0 ); ?> /> <label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs.' ); ?></label></p>
<?php
}
}
function catalyst_php_text_widget_register() {
register_widget( 'catalyst_php_text_widget' );
}
add_action( 'widgets_init', 'catalyst_php_text_widget_register' );
//end lib/widgets/catalyst-php-text-widget.php