Andy Fragen

Forum Replies Created

Viewing 15 posts - 361 through 375 (of 529 total)
  • Author
    Posts
  • in reply to: Starting Day of Week #24679
    Andy Fragen
    Moderator

    It’s located in the WordPress Settings > General just above the Save button. It is not part of the plugin.

    in reply to: Programmatically setting Additional Fields #24417
    Andy Fragen
    Moderator

    Barry, you are ‘the man’ !!

    in reply to: Programmatically setting Additional Fields #24415
    Andy Fragen
    Moderator

    Barry, thanks. I was only using “\n” not “\r\n”. Now it seems to be working. Off to more testing.

    in reply to: Programmatically setting Additional Fields #24411
    Andy Fragen
    Moderator

    Now I’m trying to figure out how to call ‘Save Changes’ after the new field has been added.

    in reply to: Programmatically setting Additional Fields #24407
    Andy Fragen
    Moderator

    Just one more thing. It seems I need to also ‘Save Changes’ for the formatting to work correctly, otherwise every item shows up on same line no as distinct dropdown items.

    in reply to: Programmatically setting Additional Fields #24399
    Andy Fragen
    Moderator

    Barry, that seems to be the key. Looks like it’s working. Thanks a bunch.

    in reply to: Programmatically setting Additional Fields #24377
    Andy Fragen
    Moderator

    But it does create the Additional Field 😉

    in reply to: Programmatically setting Additional Fields #24376
    Andy Fragen
    Moderator

    Barry, code looks very promising but I get the following error.

    Call to a member function flush_rules() on a non-object in /…/wp-content/plugins/the-events-calendar/lib/the-events-calendar.class.php on line 1386

    I’m calling this in add_action( ‘plugins_loaded’, ‘myscript’ );

    in reply to: Programmatically setting Additional Fields #24325
    Andy Fragen
    Moderator

    Yes, I have set up an Additional Field via Events > Settings > Additional Fields. I couldn’t get it to happen programatically, that’s what I was originally after. As TribeEventsCustomMeta::save_meta_options is more of a filter than an action.

    I’ve settled for just making a warning if there is no Alarm field present. I went into the code of TribeEventsCustomMeta::get_custom_field_by_label to do the checking. Using the method directly just doesn’t work. I assume you mean that being the bug I stumbled upon.

    in reply to: Programmatically setting Additional Fields #24318
    Andy Fragen
    Moderator

    FWIW, I did the following

    var_dump(TribeEventsCustomMeta::get_custom_field_by_label(‘Alarm’));

    or

    $alarm = TribeEventsCustomMeta::get_custom_field_by_label(‘Alarm’);
    var_dump($alarm);

    The result is always bool(false)

    in reply to: Programmatically setting Additional Fields #24314
    Andy Fragen
    Moderator

    Barry, thanks for the explanation and PHP teaching. I can always use more.

    As for the purpose of my question, I guess it’s really not practical to try and set this Additional Field within the plugin code, better to just report that it’s necessary for the plugin. If this is truly the case, consider this thread closed.

    Thanks again.

    in reply to: Programmatically setting Additional Fields #24273
    Andy Fragen
    Moderator

    OK, I got rid of all the errors, but it doesn’t create an Additional Field. I’m calling this from my Events Calendar PRO Alarm plugin. I want to create the required Additional Field if it doesn’t exist. But it’s not working.

    Am I misreading the class TribeEventsCustomMeta? Is there no method to directly save data and create an Additional Field?

    in reply to: Programmatically setting Additional Fields #24262
    Andy Fragen
    Moderator

    Thanks Barry. gist updated but now I get a real interesting error.

    Class ‘TribeEvents’ not found in /path-to-plugins/events-calendar-pro/lib/tribe-ecp-custom-meta.class.php on line 151

    Andy Fragen
    Moderator

    Steven, you could effectively create 2 (and only 2) overlapping genres by using both the left border color and background color for a category. This will require 3 categories though, rock, jazz and rock + jazz. As for icons, all you would really have to do is look at the CSS generated by the plugin and for each category selector create something like the following.
    .tribe-events-calendar .cat_rock { background: (‘path/to/image.png’) no-repeat left }

    If you do this for every category/image and place it in your override events.css file it should do the trick.
    In order to have multiple images you might have to have a single image file with multiple images in it. When making separate categories for these icons you would just set the category colors options to transparent. That might work.

    Andy Fragen
    Moderator

    Try this.

    $description = $eventPost->post_content;

    It’s possible the strip_tags was also removing stuff.

Viewing 15 posts - 361 through 375 (of 529 total)