Articles of plugins

Custom media upload content for inserting custom post shortcode

I’m working on a plugin that creates custom post type “portfolio” along with shortcode to insert in any page or post. The shortcode is: [portfolio option1=“1” option2=“0” option3=“1” ] And it works just fine, it shows all custom posts via custom WP_query. But I want to go further. Create a custom button next to upload […]

How to change a user's password programatically

I am trying to create a totally different profile page (not the one provided by WordPress), since the layout and feel of the default profile page is too “WordPress” for the users. Now I am successful in being able to present a page that can modify user meta data like firstname, lastname, city, zip code, […]

How to prevent a post from being deleted?

For auditing issue, I only want a post can be trashed, but not deleted – for all users. So I have a plugin like add_action(‘before_delete_post’, function($id) { wp_die(0); }); But seems not all delete action are ajax, so it will be show a black screen with return an error page with result “0” Feature wise […]

How to create a flexible abstraction for WP_Query?

My question is about php but it involves wordpress as i am creating a plugin. The case is that i have 5 questions, each question have 6 choices and one choice to choose from each. Now the person would select any choice from each or just few. I have created the if condition that is […]

List all sidebar names?

I’m listing all sidebars like that: global $wp_registered_sidebars; echo ‘<pre>’; print_r($wp_registered_sidebars); echo ‘</pre>’ So I’m getting something like: Array ( [sidebar-1] => Array ( [name] => Sidebar #1 [id] => sidebar-1 [description] => Sidebar number 1 [before_widget] => [after_widget] => [before_title] => [after_title] => ) (…) ) But I’d love to display them as a […]

Getting Path To Uploaded Attachment Image After Upload

After you have uploaded an attachment in WordPress using the media upload screen, is there a hook or filter I can run after the image has been uploaded where I can get the path to the uploaded image so I can analyse it? I am building a plugin that will analyse an image after it […]

Difference between a theme and a plugin?

I’m curious as to what the specific differences are between a theme and a plugin. I get the gist of it…themes have to do with look and feel (html / css) and plugins have to do with adding functionality (code / php). However, a theme like the popular twitter inspired P2 seems to add functionality…not […]

How to automatically install default WordPress plugins?

I setup a decent number of WordPress installations clients/friends. There are a number of plugins that I use on every instance. Is there a good way to automatically have these plugins installed on every instance? Does simply copying the plugins folder to a new installation do the job?

Is it possible to stop selected plugins from loading on certain template pages?

I have a template page that has form on that is only used once in my site. The form uses form validation using jquery validate plugin (such a great plugin). Once the cart66 Plugin is loaded, the form validation stops working. Rather spending ages looking for the conflict, I thought it would be easiest to […]

WooCommerce: List All Categories

I’m using the WooCommerce plugin with WordPress and within my theme I’d like to list all categories within a navigation menu with PHP. I’ve tried using woocommerce_product_categories(); but I don’t want the images, or other HTML elements, just their names (and maybe permalinks). How can I get that data?