MSE Now Supporting MIME Type And Date Filters

The latest update for my Media Search Enhanced (MSE) plugin will be supporting MIME type and date filters in the Media Library. It’s funny that I never use these filters myself, so in the past two years there was such a major bug in the plugin and I never noticed. Read More…

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!

Inserting Media Search Form Into Posts Or Templates

I’ve got lots of plugin ideas but don’t have much time on developing recently, due to I’m fascinated by AngularJS since last November and prepare to grow my freelancing business. Despite that I still try to take some time to update my plugins based on suggestions from users.

Today I just pushed the latest version of Media Search Enhanced to WP.org, the major updates are inspired by a comment left here last week. Basically Don requested if I can make the plugin work on the frontend, so website visitors can search for media by all fields (title, caption, alt text, filename and terms).

I found it interesting because I’ve considered to implement functions like that but not sure if it’s of use enough. According to Don’s comment, it will be a very good idea.

So I made a major change that moved all main functions from admin class to public class in my plugin, and create a shortcode mse-search-form to insert a media search form into posts or templates. The media search form is a default WordPress search form but customized:

  1. Add a hidden field to force it only to search for attachment post type.
  2. Add a class name mse-search-form to help if user would like to modify the form with CSS.
  3. Two custom filters in the form: mse_search_form_class to change the form class name, mse_search_form_placeholder to change the input placeholder.

For now the frontend media search form might not be that helpful that it just display all media as posts in search results page. You have to custom the page to make sense of it, so maybe I should improve it in the next release by adding a media search results page or creating a media search results shortcode.

Other comments on the WP.org support forum proposed to display the media search results but group them by post id, and search for meta values. These opinions are useful to some extend so I’ll keep in mind. Your feedback is always welcome. Let’s improve the media search workflow together!

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!

Use Radio Buttons in Your Categories Metabox

Users can select multiple Categories for a post by default, that’s why WordPress use checkboxes in the Categories metabox. If you need to force the user select only one category, I have this little plugin for you.

Categories Metabox Enhanced is a new plugin released by us today. After installing it, you could replace the checkboxes with radio buttons or a select drop-down in the plugin’s Settings page. That’s how you can force the user select only one category.

The plugin is based on a useful library Taxonomy_Single_Term created by WebDevStudios, I found it when I did the research work on creating Categories Metabox Enhanced. For it’s not actually a WordPress plugin and only hosted on GitHub, I decided to integrated it to the plugin and implemented the options on the Settings. Read More…

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!

A Quicker Way to Add Child Pages

banner-772x250

Quick Add Child joined the 1Fix.io plugin family today. If you need to add lots of child posts for your WordPress site, the little one is for you.

I found it very annoying when I need to select the Parent Page from 30+ pages. It might be rare, but when this is the case, you’ll be thankful if you don’t have to select the Parent manually.

Quick Add Child creates 2 links on a hierarchical post (like Page) editing screen, just right after the “Add New” link. The 2 links are “Add New Sibling” and “Add New Child“. As the names indicate, the links will open in new browser tabs, the cool part is if you take a look at the “Parent” field in “Page Attributes” metabox, it has been selected automatically.

Add links to H2 tag on the post editing screen

To Add links to H2 tag after the “Add New”, the only way I figured out is inserting the HTML code with JavaScript. Unlike the page_row_actions filter built in WordPress Core, there is no such a hook for this. I add new links with the jQuery function below:

Since we could add links to it, we could also remove the “Add New” with JavaScript. I create an option on the Settings page for you to decide if you’d like to hide the “Add New” link.

screenshot-2

page_attributes_dropdown_pages_args does the trick

The other key function for this plugin is to pre-select the Parent in Page Attributes metabox. Luckily we’ve got a filter to use this time.

page_attributes_dropdown_pages_args is a filter to let you modify the arguments which will be passed to wp_dropdown_pages later. The defaults for the arguments are:

So we could pre-select the Parent by setting $dropdown_args['selected'] to a specific value, in this case, a $_GET variable ($_GET[‘parent_id’]) passed from the “Add New Sibling / Child” link.

Bonus tips: create a banner for the WordPress plugin repository

It’s the first time I create a banner for the plugins of 1Fix.io. For the simplicity of Quick Add Child, I hope people could get the idea of what it’s all about at first glance.

I’d like to address the 2 links “Add New Sibling” and “Add New Child” added by the plugin, here’s what I did:

  1. Make a screenshot of the page editing screen.
  2. Resize the image by 110%.
  3. Rotate the image just 3 degree counterclockwise.
  4. Crop the image to fit the right size for the banner (772*250 px).

With such simple steps, I create a pretty straightforward banner for Quick Add Child. When people visit the plugin repository on WordPress.org, they’ll get the idea before reading the description.

Any feedback or comments are welcome. Stay tuned to get more plugin updates from 1Fix.io!

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!

Customize the Featured Image Metabox

Back to WordPress 2.9, people are thrilling about a new feature called “Post Thumbnails”, I was one of them. Before it was a core feature, it was already a requirement for any premium theme in the market. Without doubt, add “thumbnail” to theme support was definitely a big moment in WordPress history. Later with WordPress 3.0, the name was changed from “Post Thumbnails” to “Featured Image”.

I love this feature from day one. I quickly add it to themes in clients’ projects, and they are as happy as I expected. After the name changed to “Featured Image”, things became a little different. Clients were still happy about the UI, I just got asked about the same question more often. Read More…

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!

Display screen information in contextual help

http://wp.tutsplus.com/articles/tips-articles/quick-tip-get-the-current-screens-hooks/

Seriously, I always get headaches when think about which page hooks to use on certain WordPress admin pages. I found this code snippet form WP Tutsplus is very useful and each developer should keep it in functions.php.

I'm a senior web developer helping clients build their websites to grow businesses. Currently I'm based in Taipei, Taiwan. I write things about WordPress, AngularJS and life. Whenever you'd like to find someone to talk about these topics, just get in touch!