Giter VIP home page Giter VIP logo

public-transit-custom-posts's Introduction

No Maintenance Intended

Transit Custom Posts Plugin

This Wordpress plugin is designed to make creating and maintaining transit websites as simple as possible. It supplies Route, Timetable, Alert, and Board Meeting custom post types, pulls in route and timetable information programmatically from GTFS data, and features and API with many convenience functions for common transit site problems.

Read more about the API and how to use the plugin.

Installation

If you download a compatible theme such as Transit Base Template, it will direct you to automatically install this plugin. Otherwise, if you would like to use it on its own to develop your own theme or integrate it with an existing theme:

  • Download ZIP
  • Install from WP Admin area in Plugins > Add New > Upload Plugin

Afterward, you can configure the plugin from the WP Admin screen in the Transit Custom Posts submenus. More documentation is available on the Github site for this project.

Developer Notes

Hooks and Filters

The Transit Custom Posts plugin offers several hooks and filters for easily extending and customizing core plugin functions. These include:

  • Route Title - add_filter('tcp_filter_route_title', function( $html ){}, 10, 1);

  • Route Name - add_filter('tcp_route_name', function( $format ){}, 10, 1);

  • Route Circle - add_filter('get_route_circle', function( $post_id ){}, 10, 1);

  • Route URL - add_filter('tcp_filter_route_url', function( $post_id ){}, 10, 1);

  • Timetable days of the week - add_filter('tcp_timetable_filter_days_of_week', function( $days_of_week ){}, 10, 1);

  • Routes text file path - add_filter('tcp_filter_route_txt_path', function( $routes_txt ){}, 10, 1);

  • Timetable text file path - add_filter('tcp_filter_timetables_txt_path', function( $timetables_txt ){}, 10, 1);

  • GTFS download feed directory - add_filter('tcp_gtfs_download_feed_dir', function( $feed_dir ){}, 10, 1);

  • Above filter overrides where GTFS update data is being pulled from when applicable.
  • GTFS update route pages - add_action( 'tcp_gtfs_update_routes’, function( $routes_txt ){}, 10, 1);
  • GTFS update timetable pages - add_action( 'tcp_gtfs_update_timetables’, function( $timetables_txt ){}, 10, 1);
  • GTFS Timetable directory - add_filter( 'tcp_filter_timetable_directory', function( $timetable_dir ), {}, 10, 1);
  • After route update - add_action( 'after_tcp_route_update’, function( $post_to_update_id, $route ){}, 10, 2);
  • After timetable update - add_action( 'after_tcp_timetable_update’, function( $post_to_update_id, $timetable ){}, 10, 2);

Use with WP Transit Alerts Plugin

You can use Transit Custom Posts with the WP Transit Alerts Plugin by checking the override Transit Custom Posts alerts option in the Transit Custom Posts settings. A few additional alerts api options are provided to help make the transition easier. These additional alerts arguments or options include:

  • alerts-title: Default 'Current Alerts '
  • alerts-id: This is the id for the alerts container
  • custom-classes: This is an array of preset keys to help customize a single alert. They include options for:
    • alert-container - Allows addition of custom class for the alert container
    • alert-title - Allows addition of a custom class for the alert title
    • alert-desc - Allows addition of custom class for the alert description
    • alert-dates - Allows addition of custom class for the alert dates or meta

How to Contribute

Issues/bugs, pull-requests, feedback, and documentation are always appreciated. Please see the issue log for currently open and unassigned tasks.

The Wordpress ecosystem could use more themes compatible with this plugin! Feel free to hack away at our starter template as a working example and help us make public transit more accessible and easy-to-use with beautiful websites and quality software. It's all GPLv2, so take what you want to make your own awesome implementation.

Credits

Created by Trillium Solutions, inc for the Northwest Oregon Transit Alliance

Author: NomeQ 2017

public-transit-custom-posts's People

Contributors

ekeaton avatar lisaattrillium avatar lslangley avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.