WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Call to a member function add_shortcode() (3 posts)

  1. 8MediaCentral
    Member
    Posted 1 year ago #

    Trying to get the plugin to work and get the following error. WP 3.5 - any idea?

    Call to a member function add_shortcode() on a non-object in XXXXXXXXXX/wp-content/plugins/contact-form-7/includes/shortcodes.php on line 174

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    Try deactivating all other plugins and switching to the default theme.

  3. 8MediaCentral
    Member
    Posted 1 year ago #

    Thanks for the reply, but I wasn't happy with just deactivating everything. It would appear that the wpcf7_shortcode_manager doesn't work outside the core, which was causing a conflict with one of my plugins, to fix the issue I added a conditional if to the shortcodes.php file around line 174 thus:

    global $wpcf7_shortcode_manager;
    if(isset($wpcf7_shortcode_manager)){
    return $wpcf7_shortcode_manager->add_shortcode( $tag, $func, $has_name );
    }

    Both plugins now work, may be useful to someone else having the same issues.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.