background preloader

WordPress

Facebook Twitter

Developer Docs - GravityForms. Introduction We believe in keeping Gravity Forms simple and easy to use, and a lot of thought goes into adding new functionality.

Developer Docs - GravityForms

Still, users often find the need to add/modify functionality to meet their needs. This section of the documentation offers guidelines and references for anyone wishing to modify or extend Gravity Forms. Using Dynamic Population - GravityForms. Using dynamic population in Gravity Forms allows you to dynamically populate a field with a value (or values depending on the field type).

Using Dynamic Population - GravityForms

This value can be passed via Query Strings, Shortcode and/or Hooks. This walk-through will give you and example of how to use each method of dynamic population to dynamically populate a field on your form! Getting Started There are three steps to configuring dynamic population: specify which field should be populated configure how the field should be populated determine what value the field should be populated with. Command line interface for WordPress. Japh/Safe-Search-Replace. Php - Wordpress function when file is uploaded, deleted or edited. Generating Specific Image Sizes with the Custom Image Sizes Plugin.

Working with WordPress’ media library and images can be at once and pleasure and a pain.

Generating Specific Image Sizes with the Custom Image Sizes Plugin

I tend to like the manner in which images are managed in the admin; however, I have been left wanting when it comes to using images in the frontend of site. In particular, I have experienced difficulties displaying images at a specific size in posts or pages. While one can use CSS or the img tag attributes height and width to display the precise image size, it is far more efficient to create an image of the exact size to display. Austin Matzko’s excellent Custom Image Sizes plugin helps ease this process by extending the functionality of the some of the main image display functions in WordPress.

By default, WordPress creates up to four images when an image is uploaded, which include: thumbnail (150 x 150) medium (proportionally sized; 300 x 300 max) large (proportionally sized; 640 x 640 max) full (original image size) Or, perhaps, you can display the large size using the following: Create Native Admin Tables In WordPress The Right Way. Advertisement List tables are a common element in WordPress’ administration interface.

Create Native Admin Tables In WordPress The Right Way

They are used on nearly all default admin pages with lists, and developers often integrate them into their plugins. But creating one of these tables is not really intuitive if you haven’t done it before, and I’ve seen people try to replicate it by using WordPress CSS classes in custom markup and even by replicating the CSS from scratch. In this article, we’ll see how WordPress provides functionality that can be used to generate native admin tables.

We’ll look at a typical WordPress table and its different components and show how to implement it the right way. Media upload finished hook. Add Custom Meta Fields to Media Attachments in WordPress. WordPress allows you to add a description, caption, title and link onto any media attachment.

Add Custom Meta Fields to Media Attachments in WordPress

But what if you want to add custom fields to your images, video or audio files? This can be done by manipulating data with the attachment_fields_to_edit and attachment_fields_to_save filters. Adding Additional Fields This function will remove, edit the order and add additional custom fields to the Media attachment edit and add view in WordPress for both Posts and the Media Library. Passing arguments with WordPress add_action. Most WordPress developers are familiar with using add_action, but as you may have discovered the information on passing arguments to your callback function is hard to find.

After a couple of hours of Googling, throwing a hissy fit, and good old trial and error I found a working solution, so I thought I’d share. The problem I wanted to run a function on admin_init, which would need arguments passed as an array. Running the function is easy enough: Add_action does accept a third parameter, but it’s not what I hoped it was. How To Create Custom Post Meta Boxes In WordPress. Advertisement Meet SmashingConf San Francisco 2017, featuring front-end ingredients, UX recipes and design beats from the hidden corners of the web.

How To Create Custom Post Meta Boxes In WordPress

Only practical, real-life techniques that you can learn from. Get your ticket! What seems like one of the most complicated bits of functionality in WordPress is adding meta boxes to the post editing screen. This complexity only grows as more and more tutorials are written on the process with weird loops and arrays. Creating custom meta boxes is extremely simple, at least it is once you’ve created your first one using the tools baked into WordPress’ core code. Creating meta boxes.Using meta boxes with any post type.Handling data validation.Saving custom meta data.Retrieving custom meta data on the front end.

Note: When I use the term “post” throughout this tutorial, I’m referring to a post of any post type, not just the default blog post type bundled with WordPress. A post meta box is a draggable box shown on the post editing screen. Sharing media libraries across network sites in WordPress - ChannelEaton. This is part of a larger project I’m developing at work.

Sharing media libraries across network sites in WordPress - ChannelEaton

The ultimate goal is to have a central blog where the department can serve up sanctioned images, video, and audio for students to use on their portfolios – also hosted in the same WordPress multisite network. After realizing that a (good) solution does not yet exist, I set out to create my own. The first hurdle was to create a new tab in the Upload/Insert media page. This task was made easy by a great tutorial here . The second and most difficult hurdle was solved by looking through the core code. Now for the last step. Export csv functionality into my plugin. Function Reference/wp upload dir. Function Reference/wp upload dir Description Returns an array of key => value pairs containing path information on the currently configured uploads directory.

Function Reference/wp upload dir

Checks the 'upload_path' option, which should be from the web root folder, and if it isn't empty it will be used. If it is empty, then the path will be 'WP_CONTENT_DIR/uploads'. If the 'UPLOADS' constant is defined, then it will override the 'upload_path' option and 'WP_CONTENT_DIR/uploads' path. The upload URL path is set either by the 'upload_url_path' option or by using the 'WP_CONTENT_URL' constant and appending '/uploads' to the path. If the 'uploads_use_yearmonth_folders' is set to true (checkbox if checked in the administration settings panel), then the time will be used. If the path couldn't be created, then an error will be returned with the key 'error' containing the error message. On success, the returned array will have many indices: Usage. Support » Change file upload folders on WordPress 3.0 multi-site.

WordPress hooks database - action and filter hooks for wp plugin developers. What is a hook?

WordPress hooks database - action and filter hooks for wp plugin developers

In brief, WordPress hooks enable you to change how WordPress behaves without editing any core files. Because you leave the WordPress files untouched, you can painlessly upgrade your blog with each new version of WordPress. It's this hooks architecture that makes WordPress the best blogging solution. If you don't know what WordPress hooks are for, read the Plugin API or this tutorial. If you're new to web design, you might also enjoy my easy PHP tutorial. Administration Menus. Administration Menus.

Administration Menus

Plugin API. Plugin API Languages: বাংলা • English • Español • Français • 日本語 • 한국어 • Português do Brasil • ไทย • 中文(简体) • Русский • (Add your language) Introduction This page documents the API (Application Programming Interface) hooks available to WordPress plugin developers, and how to use them. This article assumes you have already read Writing a Plugin, which gives an overview (and many details) of how to develop a plugin. This article is specifically about the API of "Hooks", also known as "Filters" and "Actions", that WordPress uses to set your plugin in motion. These hooks may also be used in themes, as described here. Hooks, Actions and Filters. Uploads - Saving Media - Which Hook is Fired. Ten Things Every WordPress Plugin Developer Should Know.

Advertisement Plugins are a major part of why WordPress powers millions of blogs and websites around the world. A Crash-Course in WordPress Plugin Development. Despite an extensive codex, many WordPress users remain unfamiliar with how to create their own custom plugins. In today's screencast, we'll start from scratch and build our first usable plugin. Richmond Virginia Web Developer · Francis Yaconiello. I’ve noticed that a bunch of the how-to-write-a-plugin articles out there focus on demonstrating the minimum amount of code needed to get a plugin going.

Not many focus on good plugin structure or convention. This tutorial explains how to create a class based WordPress plugin that makes sense. Start with a Directory WordPress plugins can be defined in a single file or a directory of files. Starting with a directory gives you more flexibility and allows you to use common structures and folder layouts between projects and will add a level of maintainability.

Generally, I use the following folder tree: wp-plugin-name.php Every plugin begins with a docblock PHP comment describing the plugin. <? After the plugin definition comment, you need to define your main plugin logic.