I am trying to create custom widget it appear into a ACF (Advanced Custom Fields) plugin but "Widget Menu is not appearing below appearance menu. here are my codes.
my functions.php
<?php
## import the dependency functions
require get_template_directory() . '/inc/functions-admin.php';
require get_template_directory() . '/inc/widgets.php';
my inc/widgets.php
<?php
/*
@package ManishAgarwal
==================
WIDGET CLASS
==================
*/
class CustomWidget extends WP_Widget {
public function __construct() {
// Instantiate the parent object
$widget_ops = array(
'classname' => 'ma-home-widget',
'description' => 'Custom Home Content Widget',
);
parent::__construct('ma_home_content','MA Home Content', $widget_ops );
}
}
function ma_register_widgets() {
register_widget( 'CustomWidget' );
}
add_action( 'widgets_init', 'ma_register_widgets' );
please suggest where i am doing wrong in above code snippet.