Login or register.

Find out more about our WordPress plugins or purchase license for Plugins bundle or Individual plugins

GD Simple Widgets: Documentation

System Requirements

  • PHP: 4.4.x or 5.x.x
  • mySQL: 4.0, 4.1 or 5.x
  • WordPress: 2.7 or newer

Basic Installation

  • Plugin folder in the WordPress plugins folder must be gd-press-tools.
  • Upload folder gd-press-tools to the /wp-content/plugins/ directory
  • Activate the plugin through the 'Plugins' menu in WordPress

Version 2.0.4 Pro / march 28 2010

  • fix incorrect plugins settings link

Version 2.0.3 Pro / march 28 2010

  • fix invalid author link for the authors widget
  • fix few other minor problems

Version 2.0.2 Pro / march 22 2010

  • edit updated info files
  • edit minor code tweaking and cleanup of sql queries
  • fix invalid results for popular posts widget using categories filter
  • fix minor problems with main widget class
  • fix creating excerpts is not stripping HTML

Version 2.0.1 Pro / january 2 2010

  • new spanish and serbian translation

Version 2.0.0 Pro / september 28 2009

  • new widget: gdws simple search
  • new widget: gdws linkedin badge
  • new t2 templates system
  • edit improved files loading and inclusion

Version 1.5.6 / november 9 2009

  • fix related posts init problem for categories
  • fix cache authors problems
  • fix some warnings and notices

Version 1.5.5 / october 25 2009

  • new pre-caching of data to minimize the number of queries
  • new chinese translation
  • new korean translation

Version 1.5.4 / october 16 2009

  • edit updated basic widget class and forms loading
  • fix several basic rendering css classes missing or invalid
  • fix problem with non-standard users database table location

Version 1.5.3 / october 1 2009

  • new filters for modifying data before rendering
  • new filters for modifying widget sql queries
  • edit improved basic widget class
  • edit improved forming of widget sql queries

Version 1.5.2 / september 27 2009

  • edit updated gdragon shared library
  • fix minor updates and changes

Version 1.5.1 / september 20 2009

  • fix minor initialization problems

Version 1.5.0 / september 10 2009

  • new widget: gdws simple 125 ads
  • edit some updates to base widget class

Version 1.4.2 / september 1 2009

  • fix invalid urls for most commented widget
  • fix widgets source files ending

Version 1.4.1 / august 30 2009

  • edit updated shared gdragon libraries
  • fix several notices and warnings

Version 1.4.0 / august 25 2009

  • new related posts widget
  • new info file with functions reference
  • new polish translation
  • edit updated integration functions
  • fix invalid post limit for authors widget
  • fix several css classes missing from some widgets
  • fix main widget class minor order problem

Version 1.3.3 / august 18 2009

  • fix unwanted echoing the data

Version 1.3.2 / august 16 2009

  • edit several small updates
  • fix several missing translation strings
  • fix getting data for popular posts widget

Version 1.3.1 / august 8 2009

  • fix some of the functions

Version 1.3.0 / august 4 2009

  • new functions for getting widgets results
  • new functions for rendering widgets
  • fix invalid style names for some widgets

Version 1.2.1 / july 21 2009

  • edit some small updates

Version 1.2.0 / june 22 2009

  • new widget: gdws random posts
  • new popular posts filter today parameter
  • edit updated readme text file with changelog section
  • fix removed post url for the future posts

Version 1.1.2 / june 16 2009

  • edit plugin update check improved
  • fix another recent comments spam bug

Version 1.1.1 / june 12 2009

  • edit better class settings for widgets
  • fix popular post widgets incorect sql
  • fix recent comments displayed spam

Version 1.1.0 / june 7 2009

  • new base widget class
  • new danish translation
  • new spanish translation
  • edit widgets code optimization and cleanup
  • fix problem with post excerpt creation
  • fix loading translations
  • fix update check function problem

Version 1.0.0 / june 2 2009

  • new insert excerpt for posts widgets
  • new insert post date for posts widgets
  • edit minor changes to sql queries

Version 0.8.0 / may 28 2009

  • new widget: gdws popular posts
  • edit more improvements for the info files
  • fix few smaller bugs in the main settings panel

Version 0.7.0 / may 24 2009

  • new widget: gdws future posts
  • edit few minor changes
  • fix missing recent posts display settings
  • fix logging of sql queries
  • fix debug into file settings
  • fix missing default debug file

Version 0.6.0 / may 21 2009

  • first public release

English

Serbian

Spanish

Danish

Chinese

Korean

Polish

gdws_future_posts_render ( instance = array(),
echo = true  
)

Render results for Future Posts widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_future_posts_results ( instance = array()  ) 

Get results for Future Posts widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_category: category id to filter with
  • display_css: additional css class(es) to be added to widget
  • display_excerpt: 1 will show post excerpt
  • display_excerpt_length: number of words to display from excerpt
  • display_post_date: 1 will show post date
  • display_post_date_format: php format for post date
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_most_commented_render ( instance = array(),
echo = true  
)

Render results for Most Commented widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_most_commented_results ( instance = array()  ) 

Get results for Most Commented widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_published: when post is published. lwek: last week, tmnt: last month, tyea: last year.
  • filter_category: category id to filter with
  • display_css: additional css class(es) to be added to widget
  • display_comments_count: show number of comments
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_popular_posts_render ( instance = array(),
echo = true  
)

Render results for Popular Posts widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_popular_posts_results ( instance = array()  ) 

Get results for Popular Posts widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_category: category id to filter with
  • filter_recency: what date range to use. tday: today, lday: last 24 hours, lwek: last week, tmnt: last month, tyea: last year.
  • filter_type: what to use: postpage, post, page
  • filter_views: all, users, visitors
  • display_css: additional css class(es) to be added to widget
  • display_views: show number of post/page views count
  • display_excerpt: 1 will show post excerpt
  • display_excerpt_length: number of words to display from excerpt
  • display_post_date: 1 will show post date
  • display_post_date_format: php format for post date
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_post_authors_render ( instance = array(),
echo = true  
)

Render results for Post Authors widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_post_authors_results ( instance = array()  ) 

Get results for Post Authors widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_category: category id to filter with
  • filter_min_posts: minimal number of posts
  • display_css: additional css class(es) to be added to widget
  • display_gravatar: post author gravatar
  • display_gravatar_size: gravatar size in pixels
  • display_posts_count: display number of posts
  • display_full_name: display authorts full name
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_random_posts_render ( instance = array(),
echo = true  
)

Render results for Random Posts widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_random_posts_results ( instance = array()  ) 

Get results for Random Posts widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_category: category id to filter with
  • filter_recency: what date range to use. tday: today, lday: last 24 hours, lwek: last week, tmnt: last month, tyea: last year.
  • filter_type: what to use: postpage, post, page
  • display_css: additional css class(es) to be added to widget
  • display_excerpt: 1 will show post excerpt
  • display_excerpt_length: number of words to display from excerpt
  • display_post_date: 1 will show post date
  • display_post_date_format: php format for post date
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_recent_comments_render ( instance = array(),
echo = true  
)

Render results for Recent Comments widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_recent_comments_results ( instance = array()  ) 

Get results for Recent Comments widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_type: what types of comments to use. comm, ping, both.
  • filter_category: category id to filter with
  • display_css: additional css class(es) to be added to widget
  • display_gravatar: 1 will show comment author gravatar
  • display_gravatar_size: gravatar size in pixels
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_recent_posts_render ( instance = array(),
echo = true  
)

Render results for Recent Posts widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_recent_posts_results ( instance = array()  ) 

Get results for Recent Posts widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • filter_category: category id to filter with
  • display_css: additional css class(es) to be added to widget
  • display_excerpt: 1 will show post excerpt
  • display_excerpt_length: number of words to display from excerpt
  • display_post_date: 1 will show post date
  • display_post_date_format: php format for post date
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_related_posts_render ( instance = array(),
echo = true  
)

Render results for Related Posts widget.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_related_posts_results ( instance = array()  ) 

Get results for Related Posts widget.

Array with widget settings contains several parameters:

  • count: number of posts to show
  • hide_empty: 1 will not render widget with no results found
  • show_only_single: 1 will show widget only on single post pages
  • filter_related: what to use for related calculations: tagcat, tag, cat.
  • display_css: additional css class(es) to be added to widget
  • display_excerpt: 1 will show post excerpt
  • display_excerpt_length: number of words to display from excerpt
  • display_post_date: 1 will show post date
  • display_post_date_format: php format for post date
Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

gdws_widget_render ( widget,
instance = array(),
echo = true  
)

Render results for any of the supported widgets.

Parameters:
string  $widget widget code name
array  $instance widget settings
bool  $echo echo results if true return if false
Returns:
array results

gdws_widget_results ( widget,
instance = array()  
)

Get results for any of the supported widgets.

Parameters:
string  $widget widget code name
array  $instance widget settings
Returns:
array results

This is the list of filters and actions added by the plugin. You can use them as any standard WordPress filters and actions from other plugins or themes. Parameters, if they are existing, are colored red. What needs to be returned is colored blue. If the return is misisng for the filter.

  • gdsw_results_$widget: $results, $instance, $results filter for modifying data array before rendering.
  • gdsw_sql_select_$widget: $select, $instance, $select filter for modifying select part of the sql query.
  • gdsw_sql_from_$widget: $from, $instance, $select filter for modifying from part of the sql query.
  • gdsw_sql_where_$widget: $where, $instance, $select filter for modifying where part of the sql query.
  • gdsw_sql_group_$widget: $group, $instance, $select filter for modifying group part of the sql query.
  • gdsw_sql_order_$widget: $order, $instance, $select filter for modifying order part of the sql query.
  • gdsw_sql_limit_$widget: $limit, $instance, $select filter for modifying limit part of the sql query.

Values for $widget:

  • futureposts: for GDSW Future Posts widget
  • mostcommented: for GDSW Most Commented widget
  • popularposts: for GDSW Popular Posts widget
  • postsauthors: for GDSW Posts Authors widget
  • randomposts: for GDSW Random Posts widget
  • recentcomments: for GDSW Recent Comments widget
  • recentposts: for GDSW Recent Posts widget
  • relatedposts: for GDSW Related Posts widget
  • simple125ads for GDSW Simple 125 Ads widget