Do you clean up your self-written plugins’ at deactivation?

After developing some plugins for myself, some of them is ready to be published. For all, I’ve written deactivation functions, which deletes the set options, the database, etc. after themselves. But I’m having doubts about the reason for these, for example, what if it’s only a temporary inactivation? What do you think, does a process … Read more

how to include javascript file and css file in wordpress

I am creating new plugin so i need add a java script file and css file. These are my javascript files jquery.min.js jquery-1.3.2.min.js jquery.tabify.js Css file: newstyle.css 1 Answer 1 WordPress already ships with jQuery. There is no need to include it in your theme. Javascript Let’s say your jquery.tabify.js file is located in /js/jquery.tabify.js … Read more

How to show large image in checkout page using WP Ecommerce plugin [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 7 … Read more

Plugin development: How many plugin and WordPress version combinations to support?

I’m developing a plugin (my first plugin), and I wonder how to think about [supporting and testing various plugin version and WordPress version combinations]. For example, if I develop a plugin, and release versions 1.0 and 1.1 and 2.0. Meanwhile, WordPress releases versions 3.2, 3.3 and 3.4. Now, at the one extreme: Should I assume … Read more

Failed to invoke other hook from the init hook

Related to this question (Use wp init hook to call other hooks?) but not the same. Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g. Not Work: add_action(‘init’,’my_init’); function my_init() { add_filter(‘locale’, … } Work: add_action(‘init’,’my_init’); add_filter(‘locale’, … Of course some hooks/filters will just work okay … Read more

OOP Plugin and Menu – Call to undefined function register_setting()

WordPress documentation seems spotty on object-oriented code. I’m setting up a few plugins and the first should register settings and a menu page. It’s throwing “undefined” for the register_setting() or add_settings_field() calls. Should these go elsewhere? I’m not seeing the admin settings page get created either? Thanks for any help. <?php //$c = new mySettings(); … Read more

Creating table with plugin is not working

After reading many question and answers and many had asked the same question I have been following the same instruction as the people instructed but my bad it’s not working I have used dbDelta($sql) $wpdb->query($sql) It’s not working sample code <?php /* Plugin Name: ContactUs Plugin URI: Description: Simple Plugin Developed for Testing purpose Version: … Read more

Current user in plugin returns NULL

I am currently developing a plugin and I am trying to make use of the $current_user global. class Something { public function __construct() { $this->get_user(); var_dump( $this->user ); } private function get_user() { require_once( ABSPATH . ‘/wp-includes/pluggable.php’ ); $this->user = wp_get_current_user(); } } This actually works. However, I need to call pluggable.php file which shouldn’t … Read more