WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] Trying to disable TEC wp_insert_post action on certain page. Help? (3 posts)

  1. brackishwaters
    Member
    Posted 1 year ago #

    I am developing a site that allows users to add and edit posts from the frontend. We also use TEC on this site. On the page where the user can add the post we get an error coming from the-events-calendar.class.php

    The problem is, on our post adding page, our code uses:

    do_action('wp_insert_post', 'wp_insert_post');

    However, because TEC is installed, we also see on line 230 of the above file mentioned:

    add_action( 'wp_insert_post', array( $this, 'addPostOrigin' ), 10, 2 );

    This causes an issue where the site displays an error on the post adding page:

    Warning: Missing argument 2 for TribeEvents::addPostOrigin() in F:\xampp\htdocs\sitename\wp-content\plugins\the-events-calendar\lib\the-events-calendar.class.php on line 1813

    What I would like to find out, is there a way to use remove_action to disable this function on this page only?
    http://codex.wordpress.org/Function_Reference/remove_action

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. brackishwaters
    Member
    Posted 1 year ago #

    I ended up just hiding these errors though I would rather have found a remove solution instead. Here is the code I added to wp-config to handle this error output:

    @ini_set('log_errors','On');
    @ini_set('display_errors','Off');
    @ini_set('error_reporting', 4339 ); //only log errors you will want to know about
    define('WP_DEBUG', false);
    define('WP_DEBUG_LOG', false);
    define('WP_DEBUG_DISPLAY', false);
  3. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Awesome to hear you got this sorted, brackishwaters. Thanks for confirming as much and for posting the approach you took. The good news is that the 3.0 release we're working on now, and should have out soon, likely fixes this. (If you wanted to have access to the beta, to test it out and see if you find this issue persists, let me know...happy to hook you up).

    Let me know what you're thinking. Thanks for your support and patience so far.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic