Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 527011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:50:14+00:00 2026-05-13T08:50:14+00:00

I’m trying to use a widget within a plugin in wordpress and I’m seeing

  • 0

I’m trying to use a widget within a plugin in wordpress and I’m seeing this error within the widget box:

Warning: extract() [function.extract]: First argument should be an array in /nfs/c03/h04/mnt/57957/domains/rab.qbessi.com/html/wp-content/plugins/register-plus/dash_widget.php on line 24

This is the code from Line 24:

    // Output the widget contents
    function widget( $args ) {
        extract( $args, EXTR_SKIP );

Here’s the dash_widget.php code

<?php
if( !class_exists('RegisterPlusWidget') ){
    class RegisterPlusWidget{
        function RegisterPlusWidget() { //contructor
            // Add the widget to the dashboard
            add_action( 'wp_dashboard_setup', array($this, 'register_widget') );
            add_filter( 'wp_dashboard_widgets', array($this, 'add_widget') );       
        }
        function register_widget() {
            wp_register_sidebar_widget( 'regplus_invite_tracking', __( 'Invitation Code Tracking', 'regplus' ), array($this, 'widget'), array( 'settings' => 'options-general.php?page=register-plus' ) );
        }
        // Modifies the array of dashboard widgets and adds this plugin's
        function add_widget( $widgets ) {
            global $wp_registered_widgets;

            if ( !isset($wp_registered_widgets['regplus_invite_tracking']) ) return $widgets;

            array_splice( $widgets, 2, 0, 'regplus_invite_tracking' );

            return $widgets;
        }
        // Output the widget contents
        function widget( $args ) {
            extract( $args, EXTR_SKIP );

            echo $before_widget;

            echo $before_title;
            echo $widget_name;
            echo $after_title;

            global $wpdb;
            $regplus = get_option( 'register_plus' );
            $codes = $regplus['codepass'];
            $usercodes = array();
            foreach($codes as $code){
                $users = $wpdb->get_results( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key='invite_code' AND meta_value='$code'" );
                echo '<h3>' . $code . ': <small style="font-weight:normal">' . count($users) . ' Users Registered.</small></h3>';
            }       
            echo $after_widget;
        }
    }
} # End Class RegisterPlusWidget

// Start this plugin once all other plugins are fully loaded
add_action( 'plugins_loaded', create_function( '', 'global $regplus_widget; $regplus_widget = new RegisterPlusWidget();' ) );
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:50:14+00:00Added an answer on May 13, 2026 at 8:50 am

    The widget() function is being called with no parameters. Why, is hard to tell without digging deeply into the plugin. You should ask the plugin’s author.
    You can try adding

    // Output the widget contents
    function widget( $args ) {
        if (is_array($args))  // Add this
        extract( $args, EXTR_SKIP );
    

    and see whether the output still makes sense then. That effectively just suppresses the action that causes the warning. If it’s a badly programmed plugin that was developed with warnings turned off, that already may do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 387k
  • Answers 387k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I've made some headway on getting this all working so… May 15, 2026 at 12:15 am
  • Editorial Team
    Editorial Team added an answer Not a but but a poor visual designer. Its generally… May 15, 2026 at 12:15 am
  • Editorial Team
    Editorial Team added an answer Use the multiprocessing module of the standard library -- it… May 15, 2026 at 12:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.