How can I pass value to function in add_menu_page?

Don’t use a function for the callback, use a class. Something like this: class Competition_Manager_Page { private $extra; public function set_extra( $value ) { $this->extra = $value; } public function render() { // show you page content, then: print $this->extra; } } You can extend the class’ functionality later. Now, when you register the menu, … Read more

wp_customize_image_control default value

I had the same problem a few minutes ago. Here is what I used in the src tag: <?php if (get_theme_mod( ‘custom_logo_image’ )) : echo get_theme_mod( ‘custom_logo_image’); else: echo get_template_directory_uri().’/inc/images/default_logo.png’; endif; ?> It seemed to solve my problem. Let me know if it works for you.

Link to a admin submenu item using a custom link

If I understand correctly what you are asking, you need the $menu_slug used when adding your menu pages: //add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); //add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); $your_link_url = admin_url( ‘admin.php?page=”.$menu_slug, “http’ ); OR SPECIFICALLY FOR YOU $your_link_url = admin_url( ‘admin.php?page=nes_vendor_new’, ‘http’ ); You can always verify … Read more

Database custom table issues – incorrect result displayed

Not sure why you’re getting a WSOD, but immediately I can see that in the following: $selectedSchoolName = $wpdb->get_results( “SELECT Name FROM tblYBSSchool WHERE SchoolID=”.$SelectedSchoolID ); // get selected location name $selectedLocationName = $wpdb->get_results( “SELECT Name FROM tblYBSLocality WHERE LocalityID=”.$SelectedLocationID ); // get route ID $getRouteID = $wpdb->get_results( “SELECT * FROM tblYBSRoute WHERE RouteID IN … Read more