WP_Widget Deprecated

Replace your code with this. This warning is because PHP4 style constructors are depreciated since WordPress 4.3 /** * @Agents(s) list widget Class */ if ( ! class_exists( ‘cs_agentlist’ ) ) { class cs_agentlist extends WP_Widget { /** * Outputs the content of the widget * @param array $args * @param array $instance */ /** … Read more

Create a Custom menu item fetched by Product Categories and Sub Categories

You could use the wp_get_nav_menu_items filter add_filter(‘wp_get_nav_menu_items’, ‘prefix_add_categories_to_menu’, 10, 3); Then you could do something like this: function prefix_add_categories_to_menu($items, $menu, $args) { // Make sure we only run the code on the applicable menu if($menu->slug !== ‘replace_this’ || is_admin()) return $items; // Get all the product categories $categories = get_categories(array( ‘taxonomy’ => ‘product_cat’, ‘orderby’ => … Read more

On Install, which code sets the ‘home’ option?

When the installer runs it calls wp_install(), that in turn calls populate_options() defined in wp-admin/includes/schema.php, which runs the following.. if ( !__get_option(‘home’) ) update_option(‘home’, $guessurl); Prior to that $guessurl is defined by.. $guessurl = wp_guess_url(); The guess URL function is defined in wp-includes/functions.php and looks like this. function wp_guess_url() { if ( defined(‘WP_SITEURL’) && ” … Read more

How wp_ajax_nopriv since WordPress 3.1

Site you referred to is likely being updated in automated fashion. The reason it wrongfully claims that action is deprecated is because: you are looking at page for wp_ajax_nopriv_{$_POST[action]} while in recent WP versions actual code is wp_ajax_nopriv_{$_REQUEST[action]} (also documented on that site). So action is not deprecated, its functionality is not changed (only the … Read more

Retrieve and display data from custom db table in admin area?

Working code for adding widget to wp dashboard with information from custom DB: /** * Add application widget to the dashboard. */ function addApplicationWidget() { wp_add_dashboard_widget( ‘submitted_applications’, ‘Submitted Applications’, ‘showApplicants’ ); } add_action( ‘wp_dashboard_setup’, ‘addApplicationWidget’ ); function showApplicants() { global $wpdb; $appTable = $wpdb->prefix . “applications”; $query = $wpdb->prepare(“SELECT * FROM $appTable WHERE %d >= … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)