Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-15 17:18:24

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Alex kinda brings txp tags to wordpress

So I was going through the support pages of the Wordpress site (since their forums tend to be pretty silent for questions passed the beginner level), and I fell on this page, which contained a tiny snippet of code that instantly clicked:

// [bartag foo="bar"]
function bartag_func($atts) {
	extract(shortcode_atts(array(
		'foo' => 'no foo',
		'baz' => 'default baz',
	), $atts));

	return "foo = {$foo}";
}
add_shortcode('bartag', 'bartag_func');

Within a second I realized that Alex was bringing txp tag like functionality to Wordpress. Now granted you can only refer to these tags in posts and pages, but hopefully they’ll soon start to allow them in templates and themes. It would certainly make my life easier designing WP sites, if it contained even part of the greatness that TXP brings to the table.

Offline

#2 2008-07-15 18:18:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Alex kinda brings txp tags to wordpress

That does look remarkably similar to the parser in TXP 4.0.6 and lower…

Offline

#3 2008-07-15 18:28:09

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Alex kinda brings txp tags to wordpress

Yup – it lacks the greatness of the new parser in 4.0.7

Offline

#4 2008-07-15 18:28:52

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Alex kinda brings txp tags to wordpress

Here’s the full explanation in the code: Add hook for shortcode tag

I’ve been perusing the Wordpress 2.6 code today, maybe I’ll make the switch ;)

Offline

#5 2008-07-15 18:44:31

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Alex kinda brings txp tags to wordpress

hcgtv wrote:

[…] maybe I’ll make the switch ;)

The Switch? Can’t be done…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2008-07-16 08:21:42

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Alex kinda brings txp tags to wordpress

variaas wrote:

Now granted you can only refer to these tags in posts and pages, but hopefully they’ll soon start to allow them in templates and themes.

Don’t get too excited MT – it’s for shortcodes only, not theme templates. […] I’ve been slowly noodling with some code for txp-style theme templates in WordPress — Alex Shiels

Offline

Board footer

Powered by FluxBB