Plugin Directory

Get Custom Field Values

Version: 3.3.1 Use widgets, shortcodes, and/or template tags to easily retrieve and display custom field values for posts or pages.

Download Version 3.3.2

3.3.1

  • Fix fatal shortcode bug by updating widget framework to v005 to make a protected class variable public
  • Update widget version to 003

3.3

  • Modify c2c_get_random_custom() to support returning multiple random values (function now accepts additional arguments)
  • Rename widget class from 'GetCustomWidget' to 'c2c_GetCustomWidget'
  • Enable shortcode support for custom field values
  • Update widget framework to v004
  • Document shortcode
  • Note compatibility through WP 3.2+
  • Minor code formatting changes (spacing)
  • Minor readme.txt formatting changes
  • Add plugin homepage and author links in description in readme.txt
  • Add .pot
  • Update copyright date (2011)

3.2

  • Fix 'Send to Editor' for shortcode builder
  • (widget) Full re-implementation using C2C_Widget_002
  • (widget) Full localization support
  • (widget) Fix bug with saving widget
  • (shortcode) Output JS in footer instead of head
  • Add if(!function_exists()) checks around all functions
  • Change description
  • Add PHPDoc documentation
  • Remove docs from top of plugin file (all that and more are in readme.txt)
  • Add package info to top of file
  • Note compatibility with WP 3.0+
  • Drop compatibility with version of WP older than 2.8
  • Minor code reformatting (spacing)
  • Add Upgrade Notice section to readme.txt
  • Remove trailing whitespace
  • Update copyright date
  • Update screenshots

3.1

  • (Not publicly released.)

3.0.1

  • Added additional check to prevent error when running under WP older than 2.8

3.0

  • Added widget support (widgetized the plugin)
  • Added shortcode support ([custom_field])
  • Added c2c_get_post_custom() : Useful when you know the ID of the post whose custom field value you want.
  • Added c2c_get_random_custom() : Retrieve the value of a random instance of the specified custom field key, as long as the field is associated with a published posted, non-passworded post
  • Added c2c_get_random_post_custom() : Retrieve the value of a random instance of the specified custom field key for a given post
  • Added c2c_get_recent_custom() : Retrieves the most recent (according to the associated post's publish date) value of the specified custom field.
  • Used $wpdb->prepare() to safeguard queries
  • Updated copyright
  • Noted compatibility through 2.8+
  • Dropped compatibility with versions of WP older than 2.6
  • Tweaked description and docs

2.5

  • Modified SQL query code for c2c_get_recent_custom() to explicitly look for post_type of 'post' and then optionally of 'page'
  • Per-custom field filter name is now made using a sanitized version of the field key
  • Minor code reformatting
  • Removed pre-WP2.0 compatibility and compatibility checks
  • Changed description
  • Updated copyright date and version to 2.5
  • Added readme.txt
  • Tested compatibility with WP 2.3.3 and 2.5

2.1

  • Removed the $filter argument from c2c_get_custom() and c2c_get_recent_custom()
  • Replaced $filter argument with more robust filtering approach: filter every custom field via the action 'the_meta', filter specific custom fields via 'the_meta_$field'
  • Add argument $include_static (defaulted to true) to c2c_get_recent_custom(); static posts (i.e. "pages") can be optionally excluded from consideration
  • Verified to work for WP 1.5 (and should still work for WP 1.2)

2.02

  • Minor bugfix

2.01

  • Minor bugfix

2.0

  • Added the new function c2c_get_recent_custom() that allows retrieving custom/meta data from outside "the loop"
  • Better filtering (on meta field itself instead of final output string)
  • Per-call filtering of meta fields
  • Prepended all functions with "c2c_" to avoid potential function name collision with other plugins or future core functions. NOTE: If you are upgrading from an earlier version of the plugin, you'll need to change your calls from get_custom() to c2c_get_custom()
  • Changes to make the plugin WordPress v1.3 ready (as-yet unverified)
  • Switched to MIT license

1.0

  • Added argument of $before_last (which, when $between is also defined, will be used to join the next-to-last and last items in a list)
  • Added invocation of an action called 'the_meta' so that you can do add_filter('the_meta', 'some_function') and get custom field values filtered as they are retrieved
  • To faciliate use of this plugin as the argument to another function, this plugin no longer echoes the value(s) it retrieves (user must prepend 'echo' to the call to get_custom())

0.91

  • Minor bugfix

0.9

  • Initial release

Requires: 2.8 or higher
Compatible up to: 3.3.1
Last Updated: 2011-8-18 Downloads: 58,276

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(25 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
75,4,3
100,1,1
100,2,2
100,4,4
100,1,1
100,2,2
50,2,1
50,2,1
0,1,0
0,2,0 33,3,1
0,2,0