Articles of plugins

Plugin generated unexpected output – No PHP errors

I’m creating a plugin that creates a custom post type I’m working on. I followed this tutorial. I have just changed it from movie_reviews to staff members. I don’t get any syntax errors in PHP and it all looks alright, but when I activate the plugin in WordPress it says it generated 3 characters of […]

How to call a function in wordpress plugin from another site

I create a plugin and install it in any wordpress sites. For any reason I need to call a function on those plugin from another site (not wordpress site). I’ve already try to using cURL and file_get_contents to call the function, in some wordpress site it’s worked well, but in some another wordpress site it’s […]

Auto delete WordPress users according to time

On my WordPress site I require registration with email confirmation to help filter out spam users. How do I delete users that haven’t activated their accounts by email automatically? Is it possible to automatically delete users that are X days old? For example: if the user is 7 days old and not active, then the […]

Hook Scripts and Styles in WordPress

As explained in this page, I have created a WordPress custom dashboard. Everthing works fine right now. But now I can’t hook scripts and styles. Here is my code for hooking scripts and styles. add_action(‘wp_enqueue_scripts’,array(&$this,’register_scripts_styles’)); function register_scripts_styles(){ wp_enqueue_script(‘jquery’); wp_register_script( ‘virtual-script’, plugins_url(‘js/virtual-script.js’, __FILE__)); wp_register_style(‘virtual-css’,plugins_url(‘css/virtual.css’,__FILE__));*/ wp_enqueue_script( ‘virtual-script’); wp_enqueue_style( ‘virtual-css’); } //end registering scripts and styles

Custom Template for wordpress cpt plugin

I am creating a wp custom post type plugin. Which supports the custom meta datas as well.Now my question is i have to create a archive page with custom template file. I have added the appropriate function for archive page and as well as single page. Single.php file work fine whereas archive.php is not working. […]

How can I store data from custom fields to custom tables?

I know how to make custom fields for my custom post types. I also know there is the Advanced Custom Fieldsplugin. But I need to know how I can store my custom fields in my custom post type to my custom DB tables. I’ve been looking for tutorials, but I only find how to create […]

How can I create a plugin installation link?

Currently, my code is generating the wrong nonce, I guess. Here is the code: $action = ‘install-plugin’; $plugin = ‘akismet’; wp_nonce_url( add_query_arg( array( ‘action’ => $action, ‘plugin’ => $plugin ), admin_url( ‘update.php’ ) ), $action ); Which generates the following url: When it should generate (notice the different nonce): http://localhost/WordpressEN/wp-admin/update.php?action=install-plugin&plugin=akismet&_wpnonce=a625535dd6 clicking on the first […]

Building a plugin into a theme

Firstly, I know this is ‘bad’ practice for several different reasons, but for reasons that I won’t waste your time with it’s something I need to do. Using a fairly simple plugin and I’ve tried copying it into functions.php and updating the file paths and dependences, but I’m having some trouble. Plugin file looks like […]

See which user installed a plugin?

Are there any DB entries made when a plugin is installed, and if so does this indicate which user did so?

WordPress plugin DB upgrade

I am writing plugin. I have added 1 custom table in database. Suppose my plugin’s current version is 1.0 After few days i am upgrading plugin and now its version 1.2. Same for after some time and now version is 1.3 and ….. 1.4 Now for every release of plugin version I have made some […]