Support » Plugin: More Fields » [Plugin: More Fields] Bug in implementation of more_fields_field_types filter

  • I’ve been trying to add my own field types and was finding that even though the code looked correct they weren’t showing up.

    Looking through the plugin code I discovered that my more_fields_field_types filter was being executed before the plugin’s own, and the plugin’s more_fields_field_types function was resetting the array.

    I’ve patched my local copy to make it work, the diff for more-fields-field-types.php is:

    7,10c7
    < 	function more_fields_field_types () {
    <
    < 		$f = array();
    <
    ---
    > 	function more_fields_field_types ($f = array()) {
Viewing 1 replies (of 1 total)
  • Thread Starter jystewart

    (@jystewart)

    Having just installed the 2.0.5 upgrade I had to address this again.

    This time rather than patch the plugin I changed the priority on my filter so that WP ran it after the plugin’s own filter, which means I’m no longer reliant on patching the plugin.

    That was okay for me to implement, but the way this works is still unclear and adds unnecessary confusion. Ideally the patch I provided above would be applied, but at the very least the priority of the internal filter ought to be set to something lower than the default value of 10 so that the plugin’s internal filter will be run before other filters defined with the default settings.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: More Fields] Bug in implementation of more_fields_field_types filter’ is closed to new replies.