Giter Site home page Giter Site logo

taco-2016-boilerplate's Introduction

Taco

WordPress custom post types that feel like CRUD models

See the wiki for complete documentation.

Setup

  1. Add Taco and Util to composer.json
{
  "require": {
    "tacowordpress/tacowordpress": "dev-master"
  }
}
  1. Include Composer’s autoload in wp-config.php
// Composer autoloader
// Add to the top of wp-config.php
require_once realpath(__DIR__.'/../vendor/autoload.php');
  1. Initialize Taco in functions.php
// Initialize Taco
\Taco\Loader::init();

Usage

Once you have Taco setup, you can start creating your custom post types. Follow the getting started instructions for a simple example.

PHPUnit tests

If you want to contribute, you should create corresponding PHPUnit tests for your functionality or fix. You will need to create a database and configure db-config.php with your database credentials. Then pull down the latest Composer updates which includes PHPUnit, and run the PHPUnit tests:

$ composer update
$ cd tests
$ ../vendor/bin/phpunit

If you want to login to the WordPress admin UI for the test suite, you need to:

  1. Create a hosts entry:

     127.0.0.1 taco-phpunit-test.vera
    
  2. Create an Apache vhosts entry, modifying the path as necessary. If you are having trouble, make sure that your vhost file is being loaded by Apache.

     <VirtualHost *:80>
       DocumentRoot "/path/to/taco/tests/lib/wordpress"
       ServerName taco-phpunit-test.vera
       <Directory /path/to/taco/tests/lib/wordpress>
         AllowOverride All
         Order allow,deny
         Allow from all
       </Directory>
     </VirtualHost>
    
  3. Visit http://taco-phpunit-test.vera/wp-admin/

     u: admin
     p: admin
    

Changelog

v1.0

  • Updating to work with PHP 7

v0.9

  • Tagging last version of Taco to run on PHP 5

taco-2016-boilerplate's People

Contributors

a-dg avatar bansay avatar jasand-pereza avatar mhectic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

taco-2016-boilerplate's Issues

Consider moving singles and default templates to new templates folder

I'm not sure when this is going to mean that there's too much stuff in the templates folder, or too little in the theme directory (if that's even an issue). Perhaps we should have a separate folder for singles, which could also include what's now in page.php and post.php. In any case, the code is very simple:

function get_single_template($single_template) {
  global $post;
  if($post->post_type == 'grant') {
    $single_template = __DIR__.'/../templates/tmpl-single-grant.php';
  }
  return $single_template;
}
add_filter('single_template', 'get_single_template');

And we would obviously make that dynamic so that it works for any post type. This example is from the single_template filter reference. I dumped this into functions-generic.php.

line 200 in get_app_icons wrong path

/wp-content/themes/taco-theme/_/img/app-icons/favicon.ico is correct, what's on the file is not!

creating issue will try to fix or someone else can.

wp-config.php should not be committed under version control?

My suggestion / solution i think may resolve this is if we have a wp-config-sample.php that essentially is what wordpress does by default... sets up the page with everything it will need, but we keep the wp-config.php not under version control and on the .gitignore,

thoughts?

Remove CSS for hiding form labels

This should be the responsibility of the site-specific CSS. Also, display: none is not an accessible way to hide labels.

Remove this plz:

<style scoped><!--
.hide_label { display: none; }
--></style>

Add robots.txt redirect to .htaccess

I'm still not a huge fan of putting tmp-robots-txt.php in the templates folder, but whatevs.

# robots.txt
RewriteRule ^robots\.txt$ /wp-content/themes/taco-theme/templates/tmpl-robots-txt.php [L]

Consider folder naming

Is there any kind of include other than what would go in incl-theme? If not, does it make sense to just call this includes?

Likewise with theme-functions. Should it just be functions?

And as long as we're lumping files by purpose, does it make sense to have a templates folder? Is that even allowed by WordPress?

WpUpdateHooks doesn't work on staging

Error message upon running composer install: "Class WpHooks\WpUpdateHooks is not autoloadable, can not call post-install-cmd script". Running it again manually in the theme directory works fine.

Yoast SEO changing Titles, interfering with function app_get_page_title()

We ran into an issue with app_get_page_title and Yoast, by default, essentially doing the same thing - and having the final title turn into:

FPSB Page Title - FPSB | FPSB | Financial Planning Standards Board,

Because,

FPSB Page Title - FPSB is what Yoast is doing by default (you can choose your separator to be - | etc., but it will grab the site title and do what app_get_page_title does),

So the result, with " | FPSB | Financial Planning Standards Board" is what the Site Title was set to in the General Defaults,

Either way,
Decision has been made to check if Yoast isn't turned on to run app_get_page_title, else just do the page title and let Yoast handle the rest. Give the options in the admin side for SEO team to finalize.

Running Composer twice creates extra folder

If you run Composer again at the top level, it creates a wordpress-temp folder. Guessing that it doesn't know what to do if it finds that WordPress is already installed.

Rename ThemeOption.php and remove ThemeOptionBase.php

The name "Theme Options" conflicts with some core WordPress nomenclature. This doesn't come up often, but it has happened.

I've been using AppOption.php, with a method to customize the menu name:

public function getSingular() {
  return 'Mott Option';
}

Also, ThemeOptionBase.php appears to be unused. Can we get rid of it?

app_image_path function does not work with newest version of taco regarding getFields 'type'=>'image'

taco has recently been updated to use the newest and greatest pop-up for Add Media Uploader, specifically regarding input type image,

in functions, we have the app_image_path function which lets you select which custom image size to use, of images... currently it is not working with the latest taco.

our plan is to create versions for the old app_image_path to be used on old taco sites, if necessary, while updating the app_image_path function for future-forward use with the new pop-up.

stay tuned,
assigned to Jasand hes PTO until next week.

App-specific library files should not be in lib by default

AppArr.php and AppStr.php are currently in lib by default. These are intended to be app-specific, and only created as needed. We should consider doing one of the following:

  • Come up with a better way of extending the default library classes
  • Move the library classes a separate repo, so they can be improved independently of projects or the boilerplate itself
  • Integrate methods from AppArr.php and AppStr.php that are useful beyond their original project

Missing lines in wp-config.php

We used to have these in the 2015 boilerplate. Are they necessary?

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('WP_AUTO_UPDATE_CORE', false);

Remove [if IE] switches around <html> opening tag

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->

Should be this:
<html class="no-js" <?php language_attributes(); ?>>

Move WordPress rewrites to bottom of .htaccess

Currently, WordPress doesn't know that its rewrite rules are already in place. When you rebuild permalinks, it places a redundant set of rewrites at the bottom of .htaccess. Move these rules to a separate block so that WordPress knows they are there.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Figure out where documentation and functional specs should go

Documentation is currently in docs within wp-content. With all of the core files having been moved to the theme, it seems to make sense that the documentation should also be there. Does it belong in taco-theme/app?

And if we're going to store functional specs in a similar fashion, I imagine it would need to be next to docs, wherever it ends up.

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.