bilimokur adlı üyeden alıntı

Çünkü kod eksik. Verdiğim linkteki kodları aynen yapıştırın.


Hocam Allah razı olsun ilgileniyorsunuz tekrardan teşekkür ederim kodlar bu şekilde bir eksiklik mi var?


/*
Plugin Name: My Widget Plugin
Plugin URI: http://www.wpexplorer.com/create-widget-plugin-wordpress/
Description: This plugin adds a custom widget.
Version: 1.0
Author: AJ Clarke
Author URI: http://www.wpexplorer.com/create-widget-plugin-wordpress/
License: GPL2
*/
// The widget class
class My_Custom_Widget extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'my_custom_widget',
__( 'My Custom Widget', 'text_domain' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'title' => '',
'text' => '',
'textarea' => '',
'checkbox' => '',
'select' => '',
);

// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>





















/>









// Update widget settings
public function update( $new_instance, $old_instance ) { ?>

}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
// Check the widget options
$title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
$text = isset( $instance['text'] ) ? $instance['text'] : '';
$textarea = isset( $instance['textarea'] ) ?$instance['textarea'] : '';
$select = isset( $instance['select'] ) ? $instance['select'] : '';
$checkbox = ! empty( $instance['checkbox'] ) ? $instance['checkbox'] : false;
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
echo '
';
// Display widget title if defined
if ( $title ) {
echo $before_title . $title . $after_title;
}
// Display text field
if ( $text ) {
echo '

' . $text . '

';
}
// Display textarea field
if ( $textarea ) {
echo '

' . $textarea . '

';
}
// Display select field
if ( $select ) {
echo '

' . $select . '

';
}
// Display something if checkbox is true
if ( $checkbox ) {
echo '

Something awesome

';
}
echo '
';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// Register the widget
function my_register_custom_widget() {
register_widget( 'My_Custom_Widget' );
}
add_action( 'widgets_init', 'my_register_custom_widget' );