• Resolved gsitu322

    (@gsitu322)


    Just installed this plugin and it looks like there was an error that said that this function was undefined. Looking for a direction to go to or a possible fix.

    Fatal error: Call to undefined method RWMB_Heading_Field::input_description() in {localWPFolder}/wp-content/plugins/meta-box/inc/fields/heading.php on line 41

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter gsitu322

    (@gsitu322)

    Yup looks like wp-content/plugins/meta-box/inc/fields/heading.php is just missing the function to return the description. Adding the method fixes everything.

    Plugin Author Anh Tran

    (@rilwis)

    Hello, the field heading inherits that method input_description from its parent RWMB_Field. Would you mind sharing the code you use to register the heading field? And can you try re-install the plugin to make sure all files are presented?

    Thanks

    Thread Starter gsitu322

    (@gsitu322)

    I added this function below. Although as I’m looking through the code again it looks like it might be trying to call the input_description function in my theme’s RWMB_Field’s abstract class instead of from the plugin’s.

    
        /**
         * Display field description.
         *
         * @param array $field Field parameters.
         * @return string
         */
        protected static function input_description( $field ) {
            $id = $field['id'] ? ' id="' . esc_attr( $field['id'] ) . '-description"' : '';
            return $field['desc'] ? "<p{$id} class='description'>{$field['desc']}</p>" : '';
        }
    Plugin Author Anh Tran

    (@rilwis)

    Oh, I see. However, how does it call the function in your theme? Do you integrate the plugin inside the theme? But even that, the plugin still has that method for the heading field.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error: Call to undefined method RWMB_Heading_Field::input_description()’ is closed to new replies.