Caldera Learn - LoopConf WP API + Angular FTW WorkshopCalderaLearn
The WordPress REST API combined with a JavaScript MVC framework opens up new possibilities for better, more intuitive interfaces that solve scaling and other challenges. In this workshop we will use AngularJS, the best — because we said so — and the WordPress REST API to create custom applications. First we will walk through creating custom API routes and endpoints to interact with your data, followed by two unique ways to use AngularJS to create better interfaces for your projects. This will include a decoupled front-end and single page web app as a plugin interface.
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...WordCamp Sydney
Many developers know how to write code in php but that doesn't mean they can write code for Wordpress.
When developing sites for clients in Wordpress, it sometimes preferably to write a custom function that will simplify data input, management and display.
The Wordpress coding framework is continually evolving and provides a number of hooks (through actions & filters) to allow developers to quickly and easily grab functions to create world class websites.
Charly will speak about the power of hooks and filters and explain some of the most common ones to use if you want to write your own custom functions, to make the management of your wordpress websites a breeze.
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCalderaLearn
The WordPress REST API combined with a JavaScript MVC framework opens up new possibilities for better, more intuitive interfaces that solve scaling and other challenges. In this workshop we will use AngularJS, the best — because we said so — and the WordPress REST API to create custom applications. First we will walk through creating custom API routes and endpoints to interact with your data, followed by two unique ways to use AngularJS to create better interfaces for your projects. This will include a decoupled front-end and single page web app as a plugin interface.
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...WordCamp Sydney
Many developers know how to write code in php but that doesn't mean they can write code for Wordpress.
When developing sites for clients in Wordpress, it sometimes preferably to write a custom function that will simplify data input, management and display.
The Wordpress coding framework is continually evolving and provides a number of hooks (through actions & filters) to allow developers to quickly and easily grab functions to create world class websites.
Charly will speak about the power of hooks and filters and explain some of the most common ones to use if you want to write your own custom functions, to make the management of your wordpress websites a breeze.
On February 18th, 2010 was O'Reilly's "Exploring Rails 3" online conference and these are Gregg Pollack's slides. They are by no means a complete record of improvements in Rails 3, but they should serve to get your appetite wet.
Introducing Assetic: Asset Management for PHP 5.3Kris Wallsmith
The performance of your application depends heavily on the number and size of assets on each page. Even your blazingly fastest Symfony2 application can be bogged down by bloated Javascript and CSS files. This session will give you a basic introduction to PHP's new asset management framework, Assetic, and explore how it integrates with Symfony2 for a pleasant, common sense developer experience.
Over the years there have been countless technical and social presentations doting on 5, 10, 12 ways to improve this, that and the other.
I will go through various performance tweaks (not tweets) for Oracle Application Express without limiting myself to a golden number.
These improvements will vary from simple PL/SQL refactoring; to monitoring for bottlenecks in your application; to cutting down maintenance time - which relates to the performance of you as an Oracle developer with only 24 hours in a day.
We may even visit a little APEX instrumentation on the way.
Writing code as an individual and writing code as part of the team are two very different things. Learn the tips and tricks for writing JavaScript code as part of the team so that your code will continue to work for years to come.
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.upstatement.com/timber
- https://roots.io/bedrock
- https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
- https://github.com/zendframework/zend-diactoros
- https://www.php-fig.org
- http://php-di.org
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- rareloop.com/careers
- https://www.rareloop.com/posts/comparing-modern-mvc-wordpress-frameworks/
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.youtube.com/watch?v=uQUxJObxTUs
- https://www.upstatement.com/timber
- https://roots.io/bedrock
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
On February 18th, 2010 was O'Reilly's "Exploring Rails 3" online conference and these are Gregg Pollack's slides. They are by no means a complete record of improvements in Rails 3, but they should serve to get your appetite wet.
Introducing Assetic: Asset Management for PHP 5.3Kris Wallsmith
The performance of your application depends heavily on the number and size of assets on each page. Even your blazingly fastest Symfony2 application can be bogged down by bloated Javascript and CSS files. This session will give you a basic introduction to PHP's new asset management framework, Assetic, and explore how it integrates with Symfony2 for a pleasant, common sense developer experience.
Over the years there have been countless technical and social presentations doting on 5, 10, 12 ways to improve this, that and the other.
I will go through various performance tweaks (not tweets) for Oracle Application Express without limiting myself to a golden number.
These improvements will vary from simple PL/SQL refactoring; to monitoring for bottlenecks in your application; to cutting down maintenance time - which relates to the performance of you as an Oracle developer with only 24 hours in a day.
We may even visit a little APEX instrumentation on the way.
Writing code as an individual and writing code as part of the team are two very different things. Learn the tips and tricks for writing JavaScript code as part of the team so that your code will continue to work for years to come.
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.upstatement.com/timber
- https://roots.io/bedrock
- https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
- https://github.com/zendframework/zend-diactoros
- https://www.php-fig.org
- http://php-di.org
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- rareloop.com/careers
- https://www.rareloop.com/posts/comparing-modern-mvc-wordpress-frameworks/
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.youtube.com/watch?v=uQUxJObxTUs
- https://www.upstatement.com/timber
- https://roots.io/bedrock
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
With a very low barrier to entry, developing with WordPress has become particularly popular in the past few years. However, this sometimes means that standards and best practices aren’t well respected.
This talk will cover WordPress coding standards, best practices, and technical tools to become a better developer. This will be a resourceful presentation for anyone beginning, interested in, and those who have been developing with WordPress for a long time. Some of the topics covered will be proper usage of hooks and filters, creating your own plugins (instead of always using that functions.php), making use of the mu-plugins folder, how to properly escape and sanitize user-generated content, security gotchas and more.
The talk is geared at beginning developers as much as it is for advanced developers. Basic php knowledge is strongly recommended, though not required.
Stepping into theme development can be daunting. Sure anyone with a little PHP skill and a basic understanding of the loop can create theme templates, but there are a number of things you can learn which can take your theme development to the next level. We’ll discuss the skills that can take you from a beginner theme developer to a master.
Brad Williams, the co-author of Professional WordPress Plugin Development, gives his presentation on Intro to WordPress Plugin Development to the NYC WordPress Meetup group in March 2011.
Stepping into theme development can be daunting. Sure anyone with a little PHP skill and a basic understanding of the loop can create theme templates, but there are a number of things you can learn which can take your theme development to the next level. We’ll discuss the skills that can take you from a beginner theme developer to a master.
A video of this talk given in Boston, MA can be seen at https://www.youtube.com/watch?v=IdMEOO0JmZA
(Updated for 2017)
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
Getting to The Loop - London Wordpress Meetup July 28thChris Adams
This is a slightly modified version of the talk I gave at the London Wordpress meetup.
I'm putting it up here a) for people who were taking notes last night and b) to shame me into putting a polished version up here for people who couldn't make it.
thanks for @folletto for providing the graphics that split up the endless code snippets.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
Italy Agriculture Equipment Market Outlook to 2027harveenkaur52
Agriculture and Animal Care
Ken Research has an expertise in Agriculture and Animal Care sector and offer vast collection of information related to all major aspects such as Agriculture equipment, Crop Protection, Seed, Agriculture Chemical, Fertilizers, Protected Cultivators, Palm Oil, Hybrid Seed, Animal Feed additives and many more.
Our continuous study and findings in agriculture sector provide better insights to companies dealing with related product and services, government and agriculture associations, researchers and students to well understand the present and expected scenario.
Our Animal care category provides solutions on Animal Healthcare and related products and services, including, animal feed additives, vaccination
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfFlorence Consulting
Quattordicesimo Meetup di Milano, tenutosi a Milano il 23 Maggio 2024 dalle ore 17:00 alle ore 18:30 in presenza e da remoto.
Abbiamo parlato di come Axpo Italia S.p.A. ha ridotto il technical debt migrando le proprie APIs da Mule 3.9 a Mule 4.4 passando anche da on-premises a CloudHub 1.0.
3. 3
To Cover
• URLs We Love
• How Do URLs Get Routed?
• How to see your Rewrite Rules
• Review the Rewrite API Functions & Hooks
• Ways to Add Rewrite Rules
• flush_rewrite_rules() & generate_rewrite_rules()
• Full-control Manual URL Routing
• Link Generation: Beyond Routing
• Other Stuff we Won't Cover
4. 4
Download the PDF!
Because there's SOOO much to cover
I'm going to be going fast & furious
So you'll need the PDF to follow along.
http://hardcorewp.com/2014/hardcore-url-routing-for-wordpress/
10. 10
• /products/{product_name}/details/
• Post type => 'product'
• /products/{prod_cat}/{product_name}/
• Post type => 'product', Taxonomy ('prod_cat') term
• /{permalink_path}/json/
• A JSON version of your post
• /comments/{year}/{monthnum}/{day}/
• Archive of all comments not related to a specific post
• /api/{api_request}/
• “Virtual” URL for Custom code
URLs We Love
11. 11
• /{automaker}/
• Post type => 'automaker'
• /{automaker}/{model}/
• Post type => 'automaker', Post type => 'model'
• /{user_nicename}/
• Specified user
• Other?
• Taking requests....
More URLs We Love
12. 12
• WP Matches URL Path to a Rewrite Pattern
• Rewrite Patterns are Regular Expressions
• Example URL Path:
• /2014/03/15/hello-world/
• Matching Regular Expression
• ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$
• Rewrite Pattern:
• index.php?year=$matches[1]&monthnum=$matches[2]&
day=$matches[3]&name=$matches[4]&page=$matches[5]
• Resultant Query String:
• index.php?year=2014&monthnum=03&day=15&name=hello-world&page=
How Do URLs Get Routed?
13. 13
index.php in Rewrite Pattern?
# 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
See: .htaccess:*
* If on IIS then web.config which has a different format.
14. 14
• Stored in $wp->query_vars
• Processed by WP_Query() for The Loop
The Resultant Query String
// Not exactly this, but similar
$query_vars = 'year=2014&monthnum=03&day=15&name=hello-world&page=';
$query= new WP_Query( $query_vars );
$query = new WP_Query( array(
'year' => 2014,
'monthnum' => 3,
'day' => 15,
'name' => 'hello-world',
'page' => '',
));
• Essentially the same as this:
15. 15
See your Rewrite Rules
<?php
/*
* Filename: /rewrite-rules.php
* REMEMBER TO SET YOUR PERMALINKS! Settings > Permalinks
*/
include __DIR__ . '/wp-load.php';
$rewrite_rules = get_option( 'rewrite_rules' );
header( 'Content-type: text/plain;' );
print_r( $rewrite_rules );
17. 17
Best Way to SeeYour Rulez
• Monkeyman Rewrite Analyzer
• http://wordpress.org/plugins/monkeyman-rewrite-analyzer/
18. 18
The WordPress Rewrite API
• Rewrite API Functions
• Related Functions
• Rewrite API Hooks
• Related Hooks
19. 19
The Rewrite API Functions
• register_post_type()* and register_taxonomy()*
• flush_rewrite_rules()
• add_rewrite_rule() and add_rewrite_tag()
• get_query_var()*
• register_activation_hook() and
register_deactivation_hook()
*Related functions
40. 40
Adding an External Rule
/api/{whatevah}/
RewriteRule ^api/?.*$ /wp-content/themes/wp38/api.php [QSA,L]
Adds the following to .htaccess:
add_action( 'init', 'x_init' );
function x_init() {
global $wp_rewrite;
$local_path = substr( __DIR__ . '/api.php', strlen( ABSPATH ) );
$wp_rewrite->add_external_rule( 'api/?.*$', $local_path );
// Flush your Rewrite Rules!
}
41. 41
Recognizing the External Rule
/api/{whatevah}/
<?php
/* Filename: api.php
* This is only if you need WordPress loaded.
* The "/../../.." assumes in a plugin directory.
*/
require( __DIR__ . '/../../../wp-load.php' );
$url_path = $_SERVER['REQUEST_URI'];
$request = preg_replace( '#^/api/(.*)$#', '$1', $url_path );
echo "Your API request was: {$request}";
42. 42
The generate_rewrite_rules() Function
• This is where it gets really ugly.
• This can turn your brain to mush.
• You might even switch to Drupal!
• Not really. Who'd want Drupal
if they can haz WordPress?!?
• But I digress...
57. 57
Whew!
• I hope you never have to use any of that!
• But if you do, you are now equipped.
• (Assumed your brain didn't turn to mush.)
58. 58
The 'do_parse_request' Hook
• This is the strong magic.
• Using 'do_parse_request' is like....
• ...getting the Glengarry Leads!!!
• Seriously! It's omni-powerful!
• But Theme/Plugin Devs beware...
• The magic might overpower you.
59. 59
Context Specific URLs
• WordPress only supports Context Free URLs
• But we often want Context Sensitive URLs
• 'do_parse_request' makes it possible
• But, it's not without risk
• Plugins and Themes won't expect it
• And you can have one URL hide another
• With Great Power Comes Great Responsibility
65. 65
Reveal the QueryVars
add_action( 'shutdown', 'x_shutdown' );
function x_shutdown() {
if ( ! is_admin() ) {
global $wp;
echo '<pre><code><font size="7">';
echo '$wp->query_vars: ';
print_r( $wp->query_vars );
echo '</font></code></pre>';
}
}
66. 66
Performance Optimization
• Cache Top N URLs in wp_options
• In array; key=URL, value=$wp->query_vars
• Periodically Recalculate Top N
• Even Better if using Memcache
• This is your Homework!
67. 67
Warning:
May Be Incompatible
• Highly Custom Sites:
• A-OK
• Normal Websites or Blog:
• Plugins and themes might be incompatible
• Plugins or Themes for Distribution:
• Be very careful; this is non-standard routing
• Also...
• Very easy to create ambiguity in routing
68. 68
The Dispatch Library
• Using URI Templates as Patterns
• Inspecting URLs by Segment
• Plan to do lots of caching
• Still PRE-ALPHA
• github.com/newclarity/dispatch
69. 69
But Routing Ain't Enough
• Link Generation
• Allow Editing the Slug
• Changing the Permalink Sample
70. 70
Generate the Link
add_filter( 'post_type_link', 'x_post_type_link', 10, 2 );
function x_post_type_link( $post_link, $post ) {
switch ( $post->post_type ) {
case 'x_product':
$post_link = home_url( "/{$post->post_name}/" );
break;
case 'x_model':
$product_link = x_post_type_link( false, get_post( $post->post_parent )
);
$post_link = "{$product_link}{$post->post_name}/";
break;
}
return $post_link;
}
/{product_name}/{model_name}/
74. 74
In Review
• How WordPress Routes URLs
• index.php and .htaccess
• That URLs ultimately create $args for WP_Query()
• Rewrite Rules and how to see/test them.
• How and why to Flush Rules
• The Rewrite API Functions
• Especially add_rewrite_rule() and add_rewrite_tag()
• The Rewrite API Hooks
• Especially 'parse_request'and 'do_parse_request'
What We Learned Today
75. 75
In Review (cont'd)
• About Endpoints, Permastructs and External Rules
• How abysmal generate_rewrite_rules() is
• All them crazii hooks when generating.
• The Strong Magic: do_parse_request
• Provides Context Sensitive URLs
• How to discover the query vars needed to route URLs
• Generating links, editing elugs and changing samples.
• And finally the logic flow for URL rewriting/routing.
What Else We Learned Today
76. 76
And Stuff I Wrote for the Intro
• But I decided it didn't flow.
• Like how scenes gets left...
• on the cutting room floor.
• So I added to the DVD. ;-)
79. 79
Archive URL Patterns
Tag Archive /tag/{tag}/
Category Archive /category/{category}/
Author Archive /author/{author_name}/
Search Results
/search/{s}/ and /s?={s}
Post Format Archive /type/{post_format}/
Custom Post Type Archive /{post_type_slug}/
Also Day, Month and Year Archives.
80. 80
Feed URL Patterns
Feed* /feed/{feed|rdf|rss|rss2|atom}/
Category Feed* /category/{category}/feed/{feed_type}/
Tag Feed* /tag/{tag}/feed/{feed_type}/
Comment Feed* /comment/feed/{feed_type}/
Search Results Feed* /search/{s}/feed/{feed_type}/
Author Feed* /author/{author_name}/feed/{feed_type}/
* {feed_type} = feed, rss, rdf, rss2, atom
Also Attachment, Post, Page, Day, Month and Year Feeds. (Why?)
81. 81
Other URL Patterns
Robots /robots.txt
Register /{whatever}/wp-register.php
Comments /{post_url}/comment-page-{cpage}/
Trackback /{post_url}/trackback/{whatever}
And some... I’m sure I forgot about.
82. 82
• The mapping of a URL Path of an HTTP Request
identifying the Resource on yourWordPress site
for which you want an
HTTP Response to return a Representation.
• Whew! What a mouthful!
What is URL Routing?
83. 83
•Because we want to control what
Representation is returned for a
given URL Path.
•So let’s define those terms...
Why Do We Care?
84. 84
What is a URL Path?
• Example URL:
• http://example.com/2014/03/15/hello-world/
• The URL Path is:
• /2014/03/15/hello-world/
85. 85
What is an HTTP Request?
It’s when you type a URL into your browser and press Enter!
86. 86
What is a Resource?
• It’s the idea of the thing you want, the thing located
at the URL you type into your browser.
• Don’t worry, nerd types have argued over this
definition for years!
• A Representation is simply the HTML file,
image or other file you want when you enter a URL.
87. 87
What is an HTTP Response?
• It is what your WordPress website packages up and
sends back to your browser and is based on the URL
path you request.
88. 88
It’s what gets downloaded when you
request a URL with your browser.
What is a Representation?
89. 89
So in review:
URL Routing is the mapping of a URL Path
of an HTTP Request identifying the Resource
on yourWordPress site for which you want an
HTTP Response to return a Representation.
See,That Wasn’t Hard!
90. 90
Future Reading
The Rewrite API:The Basics
http://code.tutsplus.com/tutorials/the-rewrite-api-the-basics--wp-25474
The Rewrite API: PostTypes &Taxonomies
http://code.tutsplus.com/articles/the-rewrite-api-post-types-taxonomies--wp-25488
A (Mostly) Complete Guide to the WordPress Rewrite API
http://o.pmg.co/a-mostly-complete-guide-to-the-wordpress-rewrite-api
Some background on rewrite rules
http://wordpress.stackexchange.com/a/5478/89
91. 91
Me, in More Detail
President, NewClarity LLC
Boutique WordPress consulting firm with a small but expert team.
Specialize in complex sites & vertical market products
Offering: Back-end architecture, implementation, training, code reviews.
375+ Answers at WordPress Answers
Was a founding moderator
Have blogged at HardcoreWP.com
Hope to find time again (doh!)
Several "Libraries" for WordPress at github.com/newclarity
Exo - "MVC that doesn't changeWordPress, it just makes it stronger."
Sunrise - Code-based Forms and Fields
Dispatch - Hardcore URL Routing forWordPress
Contact us for more of the "Strong Magic"
mike@newclarity.net
92. 92
Thanks for Attending
May all your URLs be pretty
and may they all match
their intended patterns
Mike Schinkel
@mikeschinkel
mike@newclarity.net
Editor's Notes
T
If I started talking about myself I&apos;d not know where to stop and bore you to death!
REALLY DIFFICULT. Problem = WHAT to include. A WEEKS of potential material
2nd choice. Knew Much, Assumed More. Learned LOTS. Best way to learn; teach it!
In DESCENDING ORDER OF POTENTIAL SUCCESS
Mention root usability, like Twitter. Mention the WordPress Rewrite API can&apos;t handle.
Ask for any burning needs for URL routing.
Marvel at the regular expression!
Ask if any write that correctly on the first try?
POINT OUT index.php before the next slide!
Mention Permalinks must be SAVED and not ?p={post_id} to have this.
Mention that some servers don&apos;t have permissions to save.
Mention Multisite differs. Also /blog/ differs.
Tell story about training examples and code review 6 months later!
Recommend Classes vs. prefixing functions
Your Mom&apos;s taught you good hygiene, I&apos;m sure!
Rules are expensive to generate. Can&apos;t easily tell if they need to be generated.
You all use WP_DEBUG, right?!?!? SHOW Settings &gt; Permalinks.
Make sure to always register and/or add rewrites BEFORE flushing.
Otherwise ... it&apos;s a waste.
Setting $wp-&gt;query_vars( &apos;post_type&apos; =&gt; true ) &quot;fails&quot; query.
Setting $wp-&gt;query_vars( &apos;error&apos; =&gt; &apos;404&apos; ) forces a 404.
Still need status_header( 404 ) and nocache_headers().
Parameters shown are all defaults.
IMO, added to support register_post_type(), register_taxonomy().
Permastruct looks easier then add_rewrite_rule(); hah!
WordPress (AFAIK) doesn&apos;t provide a way to recognize a permastruct
Show http://wp38.dev/comments/2014/
Show http://wp38.dev/rewrite-rules2.php
Change $args passed and show differences.
Mention conflicts with other rules, conflicts with it&apos;s own rules.
Show .htaccess
These are the $regexes I like
BEWARE because the WordPress rewrite system doesn&apos;t know about it. Also easy to create conflicts
Tell the story of Otto and Andy SkeltonKEY POINTS: 1) $_SERVER[&apos;REQUEST_URI&apos;] contains URL. 2.) $wp-&gt;query_vars gets same thing that WordPress would set. 3.) $continue must be set to false. Also, set rewrite =&gt; false and query_var=&gt; false to disable default rewrite.
SHOULD have checked for empty( $url_path )
KEY POINTS: 1) $_SERVER[&apos;REQUEST_URI&apos;] contains URL. 2.) $wp-&gt;query_vars gets
same thing that WordPress would set. 3.) $continue must be set to false.
Also, set rewrite =&gt; false and query_var=&gt; false to disable default rewrite.
SHOULD have checked for empty( $url_path )
Not URL rewriting, but need to associate child to parent
redirect_guess_404_permalink() is called by redirect_canonical() when is_404(). Looks for post_name for any post type. UGH!
Homework because I didn&apos;t finish Dispatch in time for presentation
Note when a Model I&apos;m not passing $leavename to Product
Actually the reason you&apos;d want to is to bypass WordPress&apos; abbreviation of the URL in the sample.
These are just reference
This is just background
Great other source of information about URL Rewriting/Routing
Interested in a Hardcore WordPress Bootcamp? 3-5 days? $600/day
How many people are hiring developers?