wordpress snippets last updated   : August 18, 2014
we now have 638 snippets
category admin

Set default attachment display settings, alignment, link to, size in wordpress

wordpress snippet

Have you ever wanted to change the default options when inserting media into a post? Setting the default alignment to “left” or the default size to “large” ? This may not appear to be a big deal but if you are constantly changing the settings to the same thing over and over again for each image this is a must have snippet. We are updating the options “image_default_align, image_default_link_type, image_default_size”. Keep in mind that this just changes the default settings of these options within the add media popup. The method we use to update these options can be used for a number of other options including what you can find in this options reference.

read more

Show absolutely all custom fields for each post

wordpress snippet

This snippet will display absolutely all custom fields for each post. Even custom fields you may not even be aware exist like _edit_lock and others. We have Justin Sternberg to thank for writing this snippet that was submitted a while ago as part of his tutorial on wordpress custom fields. Since this snippet is not available other than in the tutorial I figure it should be posted separately.

read more

Change wordpress admin post columns order

wordpress snippet

I have needed to move a post column like “date, tags, author” or even a custom column within the wordpress admin. This is a simple method that I used to change the order of columns within the admin. What you have is two variables you will need to change $move and $before. Move is the name of the column you would like to move. Before is the name of the column you would like to move it before. The following snippet will let you move the author column before the post title column.

read more

Change default role names “Administrator, Editor, Author, Contributor, Subscriber” to anything

wordpress snippet

Have you ever wanted to change the default role names “Administrator, Editor, Author, Contributor, Subscriber” within wordpress? Add this little snippet to the functions.php of your wordpress theme. This snippet will let you change any of the existing role names to anything that you would like. This will of course display within the role select menu for users.

“Please note this does not add a new role or permanently change the name”

read more

Block admin for all users but administrator

wordpress snippet

If you need to block all users but the administrators from wp-admin just add this snippets to the functions.php of your wordpress theme. This snippet will redirect everyone but the admin back to the primary domain.

read more

Display post attachment count in admin column

wordpress snippet

Sometimes you have a post with multiple attachments and it would be nice to see a count of the total media attached to a post. Adding this snippet to the functions.php of your wordpress theme will display the post attachment count in a custom admin column.

read more
jqsnipp.com | we just launched jquery snippets website