You should be familiar with the wordpress codex!
The thumbnail grid plugin can be extended by developers using filters. Please refer to the WordPress Codex for more information about filters
Example: Create rounded corners tor the image:
add_filter(‘sfly_tbgrid_image_style’, ‘sfly_tgrid_rounded’);
function sfly_tgrid_rounded($style) {
$style .= “border-width: 1px; border-style: solid; border-color: #ccc; position: relative; z-index: 50; border-radius: 28px; box-shadow: 0 1px 1px rgba(153,153,153,0.4); padding: 0; margin: 0;”; return $style;
}
sfly_tbgrd_settings process and return modified shortcode attributes.
add_filter( ‘sfly_tbgrd_settings’, ‘callbackfunction’ )
function callbackfunction($atts) //atts - shortcode attributes
{
extract( shortcode_atts( array(
'myparam' => FALSE,
), $atts ) );
unset($atts["myparam"])
}
sfly_tbgrid_grid_nav _content Returns content that displays above or below the grid (usually navigation content) add_filter( ‘sfly_tbgrid_grid_nav_content’, ‘callbackfunction’, 10, 3)
function callbackfunction($page, $location, $max)
//page – current page (only for paged posts) location – ‘top’ or ‘bottom’ max – maximum number of pages
{
return “<div class=”$location”>Page $page</div>”
}
sfly_tbgrid_extra_info Returns content that displays under the title text (This has been modified. To replace the actual title, use sfly_tbgrd_title instead)
add_filter( ‘sfly_tbgrid_extra_info’, ‘callbackfunction’);
function callbackfunction($id) //id for post
{
return "under thumb " . $id;
}
sfly_tbgrd_title Modify the title
add_filter( ‘sfly_tbgrid_title’, ‘callbackfunction’);
function callbackfunction($title, $id=NULL) //id for post
{
return "hello " . $title . " " . $id;
}
sfly_tbgrid_grid_style Returns styles applied to the grid
add_filter(‘sfly_tbgrid_grid_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_grid_class Return classes applied to grid
add_filter(‘sfly_tbgrid_grid_class’, callbackfunction)
{
$class .= $class . “, myclass”;
}
sfly_tbgrid_image_style Modify the style of the image.
add_filter(‘sfly_tbgrid_image_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_image_class Modify the class of the image.
add_filter(‘sfly_tbgrid_image_class’, callbackfunction)
{
$class .= $class . “, myclass”;
}
sfly_tbgrid_postimagediv _style Modify the style of the image container.
add_filter(‘sfly_tbgrid_postimagediv_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_postimagediv _class Modify the class of the image.
add_filter(‘sfly_tbgrid_postimagediv_class’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_griditem _style Modify the style of the cell in the grid (the cell contains an image and the caption. add_filter(‘sfly_tbgrid_griditem_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_griditem _class Modify the class of the image.
add_filter(‘sfly_tbgrid_griditem_class’, callbackfunction)
{
$class .= $class . “, myclass”;
}
sfly_tbgrid_title_style Modify the style of the title container
add_filter(‘sfly_tbgrid_title_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_title_class Modify the class of the title container.
add_filter(‘sfly_tbgrid_title_class’, callbackfunction)
function callbackfunction($class) //class – current class
{
$class .= $class . “, myclass”;
}
sfly_tbgrid_titlelink_style Modify the style of the title link.
add_filter(‘sfly_tbgrid_title_style’, callbackfunction)
function callbackfunction($style) //style – current style
{
$style .= “width:75%;”;
}
sfly_tbgrid_titlelink _class Modify the class of the title link.
add_filter(‘sfly_tbgrid_title_class’, callbackfunction)
function callbackfunction($class) class – current class
shfly_tgrd_posts_join Modify the post sql query (see posts_join in the WordPress Codex documentation).
add_filter(‘shfly_tgrd_posts_join’, callbackfunction)
function callbackfunction($join) join – //current join
shfly_tgrd_posts_where Modify the where portion of the post sql query (see posts_where in the WordPress Codex documentation).
add_filter(‘shfly_tgrd_posts_where’, callbackfunction)
function callbackfunction($where) //style – current where
{
$where .= ” And something=somethingelse”;
return $where;
}
shfly_tgrd_posts_orderby Modify the order by section of the post sql query (see posts_orderby in the WordPress Codex).
add_filter(‘shfly_tgrd_posts_orderby’, callbackfunction)
function callbackfunction($orderby) //orderby – current orderby
{
$orderby = “(field1, field2) DESC”;
return $orderby;
}