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

  • SEARCH
  • Home
  • 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 9208155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:33:21+00:00 2026-06-18T00:33:21+00:00

I write that code <?php /** * @package ppa * @version 0.1 */ /*

  • 0

I write that code

<?php
/**
* @package ppa
* @version 0.1
*/
/*
Plugin Name: PPAPlugin
Description: PPAPlugin desct
Author: Sekhmet
Version: 0.1
*/

    register_activation_hook( plugin_basename( __FILE__ ), array( 'PPA', 'activate' ) );
    register_deactivation_hook( plugin_basename( __FILE__ ), array( 'PPA', 'deactivate' ) );
    register_uninstall_hook( plugin_basename( __FILE__ ), array( 'PPA', 'uninstall' ) );


    class PPA
    {
        const NAME = "PPA";

        public static function activate() {
        self :: ppa_add_dashboard();
        }

        public static function deactivate() {
        }

        public static function uinstall() {
        }

        function ppa_add_dashboard() {
            wp_add_dashboard_widget( 'ppa_widget', self :: NAME , array($this, 'ppa_dashboard_widget') );
        }

        function ppa_dashboard_widget() {
        }
    }


?>

But when I trying enable it on ACP i get that messange:

Fatal error: Call to undefined function wp_add_dashboard_widget() in
/home/muffinki/domains/muffinki.org/public_html/wp-content/plugins/ppa/ppa.php
on line 35

WordPress version 3.5.1(latest).

  • 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-06-18T00:33:22+00:00Added an answer on June 18, 2026 at 12:33 am

    Hook your ppa_add_dashboard() function into the wp_dashboard_setup action so it’s called at the correct time.

    public static function activate() {
        add_action( 'wp_dashboard_setup', array( __CLASS__, 'ppa_add_dashboard' ) );
    }
    

    References:

    http://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget

    http://codex.wordpress.org/Dashboard_Widgets_API

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

Sidebar

Related Questions

I'm trying to write PHP code that will display the logged in user's name.
I want to write a php code that can search for multiple keywords separated
Basically I want to write php code that lists all the contents that are
MongoDB's excellent PHP driver allows me to write to write PHP code that looks
I'm working on some PHP code (that I didn't write). Here and there inside
I m trying write code that after reset set up rrpmax as 3000. It
I'm trying to write code that will load an image from a resource, and
Sometimes I have to write code that alternates between doing things and checking for
I've been trying to write code that loads a .png file, attaches hotspot information,
Sometimes while writing Java in Eclipse, I write code that generates warnings. A common

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.