Ben

Forum Replies Created

Viewing 8 posts - 46 through 53 (of 53 total)
  • Author
    Posts
  • in reply to: Calendar Page Title #1129029
    Ben
    Participant

    I notice that you have some code in Templates.php and Template_Factory.php to try and deal with this situation (see below). Wouldn’t it be easier to publish an app note for theme developers on how to be compatible with your plug-in? That would help me and other users to get this resolved. Maybe you’ve already done this and I can’t find it. I don’t want to install patches that I have to maintain to make the Event Calendar work properly, so please don’t refer me to those threads. Thanks. –Gene

    Template_Factory.php

    // implement a filter for the page title. Support WordPress < 4.4
    add_filter( 'wp_title', array( $this, 'title_tag' ), 10, 2 );

    // implement a filter for the page title. Support WordPress >= 4.4
    add_filter( 'document_title_parts', array( $this, 'title_tag' ) );

    // implement a filter for the page title. Support WordPress < 4.4
    add_filter( 'wp_title', array( $this, 'title_tag' ), 10, 2 );

    // implement a filter for the page title. Support WordPress >= 4.4
    add_filter( 'document_title_parts', array( $this, 'title_tag' ) );

    Templates.php

    /**
    * Fix issues where themes display the_title() before the main loop starts.
    *
    * With some themes the title of single events can be displayed twice and, more crucially, it may result in the
    * event views such as month view prominently displaying the title of the most recent event post (which may
    * not even be included in the view output).
    *
    * There's no bulletproof solution to this problem, but for affected themes a preventative measure can be turned
    * on by adding the following to wp-config.php:
    *
    * define( 'TRIBE_MODIFY_GLOBAL_TITLE', true );
    *
    * Note: this reverses the situation in version 3.2, when this behaviour was enabled by default. In response to
    * feedback it will now be disabled by default and will need to be turned on by adding the above line.
    *
    * @see issues #24294, #23260
    */
    public static function maybe_modify_global_post_title() {
    global $post;

    // We will only interfere with event queries, where a post is set and this behaviour is enabled
    if ( ! tribe_is_event_query() || ! defined( 'TRIBE_MODIFY_GLOBAL_TITLE' ) || ! TRIBE_MODIFY_GLOBAL_TITLE ) {
    return;
    }
    if ( ! isset( $post ) || ! $post instanceof WP_Post ) {
    return;
    }

    // Wait until late in the wp_title|document_title_parts hook to actually make a change - this should allow single event titles
    // to be used within the title element itself
    add_filter( 'document_title_parts', array( __CLASS__, 'modify_global_post_title' ), 1000 );
    add_filter( 'wp_title', array( __CLASS__, 'modify_global_post_title' ), 1000 );
    }

    /**
    * Actually modifies the global $post object's title property, setting it to an empty string.
    *
    * This is expected to be called late on during the wp_title action, but does not in fact alter the string
    * it is passed.
    *
    * @see Tribe__Events__Templates::maybe_modify_global_post_title()
    *
    * @param string $title
    *
    * @return string
    */
    public static function modify_global_post_title( $title = '' ) {
    global $post;

    // Set the title to an empty string (but record the original)
    self::$original_post_title = $post->post_title;
    $post->post_title = apply_filters( 'tribe_set_global_post_title', '' );

    // Restore as soon as we're ready to display one of our own views
    add_action( 'tribe_pre_get_view', array( __CLASS__, 'restore_global_post_title' ) );

    // Now return the title unmodified
    return $title;
    }

    /**
    * Restores the global $post title if it has previously been modified.
    *
    * @see Tribe__Events__Templates::modify_global_post_title().
    */
    public static function restore_global_post_title() {
    global $post;
    $post->post_title = self::$original_post_title;
    remove_action( 'tribe_pre_get_view', array( __CLASS__, 'restore_global_post_title' ) );
    }

    in reply to: Reviewing Events before Publishing #1129021
    Ben
    Participant

    Hi Goeff, I did as you suggested. In the meantime, is there any way we could get the community events list extended to show description and cost as a bug fix? Seems like that is an oversight to me.

    in reply to: Easy way to make description not required. #1128928
    Ben
    Participant

    Must have copied the code incorrectly. The mod is working now. However, it would be nice to have a setting that allows selection of required fields rather than having to maintain a patch. Thanks –Gene

    in reply to: Easy way to make description not required. #1128921
    Ben
    Participant

    I added the following code to the end of my Illustrious theme’s functions file. The entire file is below. It isn’t working–I get a bunch of errors, also below. Could you point me to the place where the required files are defined in the Community Events plugin?

    <?php if(!isset($content_width)) $content_width = 640;
    define(‘CPOTHEME_ID’, ‘illustriouspro’);
    define(‘CPOTHEME_NAME’, ‘Illustrious Pro’);
    define(‘CPOTHEME_VERSION’, ‘1.3.0’);
    //Other constants
    define(‘CPOTHEME_LOGO_WIDTH’, ‘195’);
    define(‘CPOTHEME_USE_SLIDES’, true);
    define(‘CPOTHEME_USE_FEATURES’, true);
    define(‘CPOTHEME_USE_PORTFOLIO’, true);
    define(‘CPOTHEME_THUMBNAIL_WIDTH’, ‘600’);
    define(‘CPOTHEME_THUMBNAIL_HEIGHT’, ‘400’);

    //Load Core; check existing core or load development core
    $core_path = get_template_directory().’/core/’;
    if(defined(‘CPOTHEME_CORE’)) $core_path = CPOTHEME_CORE;
    require_once $core_path.’init.php’;

    $include_path = get_template_directory().’/includes/’;

    //Main components
    require_once($include_path.’setup.php’);

    add_filter( ‘tribe_events_community_required_fields’, ‘my_community_required_fields’, 10, 1 );

    function my_community_required_fields( $fields ) {
    $fields = array(
    ‘post_title’,
    );
    }

    Warning: array_merge(): Argument #1 is not an array in /home/jsowebmaster/jazzoregon.com/wp-content/plugins/the-events-calendar-community-events/src/Tribe/Captcha/Abstract_Captcha.php on line 121
    My Events
    Not Gene Forte? Log Out

    Warning: array_merge(): Argument #1 is not an array in /home/jsowebmaster/jazzoregon.com/wp-content/plugins/the-events-calendar-community-events/src/Tribe/Captcha/Abstract_Captcha.php on line 121

    Warning: in_array() expects parameter 2 to be array, null given in /home/jsowebmaster/jazzoregon.com/wp-content/plugins/the-events-calendar-community-events/src/functions/template-tags.php on line 482
    Event Title:

    Warning: array_merge(): Argument #1 is not an array in /home/jsowebmaster/jazzoregon.com/wp-content/plugins/the-events-calendar-community-events/src/Tribe/Captcha/Abstract_Captcha.php on line 121

    Warning: in_array() expects parameter 2 to be array, null given in /home/jsowebmaster/jazzoregon.com/wp-content/plugins/the-events-calendar-community-events/src/functions/template-tags.php on line 482
    Event Description:

    in reply to: Please fix the [list_venues] shortcode #1128919
    Ben
    Participant

    This reply is private.

    in reply to: Required Fields #1128050
    Ben
    Participant

    Hi Cliff, I looked at your reference, but I think it is overlay complex for what I need. I simply want to remove the requirement to enter a description when it is not needed/wanted. Is there a simple way to do that directly without getting into how to add more required fields? Thanks, Gene

    • This reply was modified 9 years, 10 months ago by Ben.
    Ben
    Participant

    This reply is private.

    • This reply was modified 9 years, 10 months ago by Ben.
    in reply to: Events Settings Page Broken #1127449
    Ben
    Participant

    This reply is private.

Viewing 8 posts - 46 through 53 (of 53 total)