WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Get Custom Field Values

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

3.5 (2014-01-17)

  • Includes a significant number of changes from the unreleased v3.4
  • Hide shortcode wizard by default (won't change existing setting for users)
  • Show shortcode wizard for new posts as well
  • Cast all intended integer arguments as absint() instead of intval()
  • Update widget version to 006
  • Update widget framework to 008
  • Use explicit path for require_once()
  • Discontinue use of PHP4-style constructor
  • Minor documentation improvements
  • Minor code reformatting (spacing, bracing)
  • Note compatibility through WP 3.8+
  • Drop compatibility with version of WP older than 3.6
  • Update copyright date (2014)
  • Regenerate .pot
  • Change donate link
  • Update screenshots
  • Add banner

3.4 (unreleased)

  • Display shortcode wizard metabox for all post types
  • Add filter 'c2c_get_custom_field_values_post_types' to allow override of what post_types should get the shortcode wizard metabox
  • Add 'id' and 'class' as shortcode attributes to set same-named HTML attributes on 'span' tag
  • Wrap output in 'span' tag if either 'id' or 'class' shortcode attribute is defined
  • Shortcode wizard now omits 'between' and 'before_last' values if 'limit' was set to 1
  • Update widget version to 005
  • Update widget framework to 007
  • Return widget body content in widget_body() instead of echoing (to facilitate non-display of empty widgets)
  • Hook output of JS and creation of metaboxes to 'load-post.php', which eliminates use of pagenow
  • For class c2c_GetCustomFieldValuesShortcode, add register_post_page_hooks() and do_meta_box()
  • For class c2c_GetCustomFieldValuesShortcode, remove admin_menu()
  • Add checks to prevent execution of code if file is directly accessed
  • Re-license as GPLv2 or later (from X11)
  • Add 'License' and 'License URI' header tags to readme.txt and plugin file
  • Discontinue use of explicit pass-by-reference for objects
  • Remove ending PHP close tag
  • Note compatibility through WP 3.5+
  • Update copyright date (2013)
  • Move screenshots into repo's assets directory

3.3.2

  • Fix bugs in widget preventing proper display of custom field for current post (props Ross Higgins)
  • Trim and/or intval widget input fields in validate()
  • For shortcode widget's JS, output via 'admin_print_footer_scripts' instead of 'admin_footer'
  • Note compatibility through WP 3.3
  • Add 'Domain Path' directive to top of main plugin file
  • Add link to plugin directory page to readme.txt
  • Update copyright date (2012)

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.8.3
Last Updated: 2014-1-17
Downloads: 83,475

Ratings

4 stars
4.7 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

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
100,2,2
100,1,1
100,2,2
0,1,0
100,2,2