call_user_func_array() expects parameter 1 to be a valid callback
-
Hello I have problem with my plugin :/
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘wp_slider_info_page’ not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 496
I found many topics about this warning but I still don’t know what is wrong.. :/
if ( !class_exists( 'wp_slider' ) ) { class wp_slider{ function __construct() { add_action( 'admin_menu', array( $this, 'wp_slider_info' ) ); add_action( 'slider-style', array( $this, 'slider_styles') ); add_action( 'slider-script', array( $this, 'slider_scripts') ); add_filter( 'the_content', array( $this, 'wp_slider_info_page') ); register_activation_hook( __FILE__, array( $this, 'wp_install' ) ); register_deactivation_hook(__FILE__, array( $this, 'wp_uninstall' ) ); } function wp_slider_info(){ add_menu_page('wp Slider', 'wp Slider', 'administrator', 'slider-info', 'wp_slider_info_page', 'dashicons-format-video'); } function wp_install(){ global $wpdb; $table_name=$wpdb->prefix.'wp_slider'; $sql="CREATE TABLE $table_name ( id int(11) NOT NULL AUTO_INCREMENT, image varchar(255) NOT NULL, link varchar(255) NOT NULL, title varchar(255) NOT NULL, content text NULL, UNIQUE KEY id (id) );"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $sql ); } function wp_uninstall(){ global $wpdb; $table_name=$wpdb->prefix.'wp_slider'; $sql='DROP TABLE '.$table_name; $wpdb->query($sql); } public function slider_scripts() { if (!is_admin()) { wp_register_style('slider-script', plugins_url('slider-script.js', __FILE__), array( 'jquery' )); wp_enqueue_style('slider-script'); } } public function slider_styles( $page ) { wp_register_style('slider-style', plugins_url('slider-style.css', __FILE__)); wp_enqueue_style('slider-style'); } function wp_slider_info_page( $content ){ return $content . '<p>Test</p>'; } } new wp_slider(); }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘call_user_func_array() expects parameter 1 to be a valid callback’ is closed to new replies.