call_user_func_array() expects parameter 1 to be a valid callback

wp_slider_info_page is method of a class. Function in class has to be set like this: array( $this, ‘wp_slider_info_page’ ) only then WP knows that it is part of current class. Replace add_menu_page(‘wp Slider’, ‘wp Slider’, ‘administrator’, ‘slider-info’, ‘wp_slider_info_page’, ‘dashicons-format-video’); with add_menu_page(‘wp Slider’, ‘wp Slider’, ‘administrator’, ‘slider-info’, array( $this, ‘wp_slider_info_page’ ), ‘dashicons-format-video’);

Where are theme codes located for WordPress?

They’re probably referring to the functions file in your theme, functions.php. This file is loaded by WordPress during setup, and gives you an opportunity to do things or register hooks and filters. Note that this file is optional, and not every theme has a functions.php, if that’s the case just create one yourself Keep in … Read more

How passing values ​​to construct function with Actions?

<?php class someClass { public function __construct($options = null, $initialize = true, $error_messages = null, $path, $qnty) { //construct what you see fit here…. } //etc.. } // Action listener add_action( ‘action_name’, create_function(”, “new someClass(implode(‘,’,func_get_args()));”), 10, 5 // IMPORTANT, number of arguments your construct function accept ); // Call the action $options = “options”; $initialize … Read more

WordPress Plugin manipulate have_posts()

The standard query for posts uses orderby => ‘post_date’ and order => ‘DESC’. The best candidate for arbitrary sort of posts would be orderby => ‘menu_order’ and order => ‘ASC’. The menu_order is not generally used for posts but it is safe to be used. As suggested by Pieter Goosen use action hook pre_get_posts: add_action( … Read more

woocommerce with custom post type

I don’t think you’ll be able to pull this off directly. All of the admin screens, objects and hooks are tied to the “product” post type. What you should probably do is add a new product type (a sister to the simple/variable product types). This new product type could be called “Custom_Type”. You can then … Read more