<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Teleogistic &#187; plugin</title>
	<atom:link href="http://teleogistic.net/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://teleogistic.net</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 17:59:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>New WordPress plugin: Add User Autocomplete</title>
		<link>http://teleogistic.net/2011/11/new-wordpress-plugin-add-user-autocomplete/</link>
		<comments>http://teleogistic.net/2011/11/new-wordpress-plugin-add-user-autocomplete/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 15:50:39 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[dev.wpmued]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Add User Autocomplete]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[CUNY Academic Commons]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1573</guid>
		<description><![CDATA[Site admins on a WordPress Network can add existing network members to their site on the Dashboard > Users > Add New panel. But the interface requires that one know either the email address or the username of the user in question. My new plugin, Add User Autocomplete, makes the Add Existing User workflow a [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1574" class="wp-caption alignright" style="width: 310px"><a href="http://teleogistic.net/wp-content/uploads/2011/11/add-user-autocomplete.jpg"><img src="http://teleogistic.net/wp-content/uploads/2011/11/add-user-autocomplete-300x194.jpg" alt="Add User Autocomplete" title="Add User Autocomplete" width="300" height="194" class="size-medium wp-image-1574" style="border: 1px solid #000" /></a><p class="wp-caption-text">Add User Autocomplete</p></div>
<p>Site admins on a WordPress Network can add existing network members to their site on the Dashboard > Users > Add New panel. But the interface requires that one know either the email address or the username of the user in question. My new plugin, <a href="http://wordpress.org/extend/plugins/add-user-autocomplete/">Add User Autocomplete</a>, makes the Add Existing User workflow a bit easier, by adding autocomplete/autosuggest to the Email Address/Username field. Just start typing, and the plugin will return matching users; arrow down or click on the intended user to add her to the Add User list.</p>
<p>A few additional bonuses provided by the plugin, aside from autocomplete:</p>
<ul>
<li>In addition to return email address and username matches, the plugin also checks against the display_name and user_url fields. So if my username is &#8216;admin&#8217;, and my email address is &#8216;bgorges@boonebgorges.com&#8217;, but my display name around the site is &#8216;Boone Gorges&#8217;, you&#8217;ll be able to find me by searching on &#8216;Boone&#8217;.</li>
<li>You can add many users to a blog at once. Search for one user, select and hit Return, and then search for another.</li>
<li>Prettier success messages. When you submit the Add New User page, your success message will give you a list of the users invited, instead of a generic &#8220;Invitations have been sent&#8221; type message.</li>
</ul>
<p>Add User Autocomplete requires WP 3.1 and JavaScript. The plugin was developed for the <a href="http://commons.gc.cuny.edu">CUNY Academic Commons</a>. Check out the plugin at <a href="http://wordpress.org/extend/plugins/add-user-autocomplete/">wordpress.org</a> or follow its development at <a href="http://github.com/boonebgorges/add-user-autocomplete">Github</a>.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2010/08/new-wordpress-plugin-simple-import-users/' rel='bookmark' title='New WordPress plugin: Simple Import Users'>New WordPress plugin: Simple Import Users</a></li>
<li><a href='http://teleogistic.net/2011/05/new-wordpress-plugin-unconfirmed/' rel='bookmark' title='New WordPress plugin: Unconfirmed'>New WordPress plugin: Unconfirmed</a></li>
<li><a href='http://teleogistic.net/2010/09/using-github-with-wordpress-org-plugin-svn/' rel='bookmark' title='Using Github with wordpress.org plugin SVN'>Using Github with wordpress.org plugin SVN</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/11/new-wordpress-plugin-add-user-autocomplete/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>BuddyPress Docs 1.1: Doc History</title>
		<link>http://teleogistic.net/2011/05/buddypress-1-1-doc-history/</link>
		<comments>http://teleogistic.net/2011/05/buddypress-1-1-doc-history/#comments</comments>
		<pubDate>Wed, 25 May 2011 13:36:37 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[edtech]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[buddypress docs]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Revisions]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1310</guid>
		<description><![CDATA[I&#8217;ve just released version 1.1 of BuddyPress Docs, my collaborative editing software for BuddyPress. The big new feature in version 1.1 is the History tab. After upgrading, you&#8217;ll notice that what used to be a single Edit button has been reorganized into three tabs: Read, Edit, and History. History allows you to brows the entire [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1311" class="wp-caption alignright" style="width: 310px"><a href="http://teleogistic.net/wp-content/uploads/2011/05/docs-history.png"><img src="http://teleogistic.net/wp-content/uploads/2011/05/docs-history-300x247.png" alt="BuddyPress Docs History" title="docs-history" width="300" height="247" class="size-medium wp-image-1311" style="border:1px solid #000" /></a><p class="wp-caption-text">BuddyPress Docs History</p></div>
<p>I&#8217;ve just released version 1.1 of <a href="http://github.com/boonebgorges/buddypress-docs">BuddyPress Docs</a>, my collaborative editing software for BuddyPress.</p>
<p>The big new feature in version 1.1 is the History tab. After upgrading, you&#8217;ll notice that what used to be a single Edit button has been reorganized into three tabs: Read, Edit, and History. History allows you to brows the entire revision history of a document, to compare the differences between two revisions side by side, to view a single revision, or to restore to any point in the document&#8217;s history. Access to the History tab can be limited in the same way that access to the Edit tab can be, on a doc-by-doc basis.</p>
<p>This new feature will, I hope, bring some of the best qualities of wikis to BuddyPress Docs, and make Docs an even better way to collaborate.</p>
<p>Download BuddyPress Docs from the <a href="http://wordpress.org/extend/plugins/buddypress-docs/">wordpress.org plugin repo</a> or follow development at <a href="http://github.com/boonebgorges/buddypress-docs">Github</a>.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2011/03/new-buddypress-plugin-buddypress-docs/' rel='bookmark' title='New BuddyPress plugin: BuddyPress Docs'>New BuddyPress plugin: BuddyPress Docs</a></li>
<li><a href='http://teleogistic.net/2011/01/group-announcements-tab-in-buddypress/' rel='bookmark' title='Group Announcements tab in BuddyPress'>Group Announcements tab in BuddyPress</a></li>
<li><a href='http://teleogistic.net/2010/05/new-buddypress-plugin-bp-external-activity/' rel='bookmark' title='New BuddyPress plugin: BP External Activity'>New BuddyPress plugin: BP External Activity</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/05/buddypress-1-1-doc-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WordPress plugin: Boone&#8217;s Sortable Columns</title>
		<link>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-sortable-columns/</link>
		<comments>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-sortable-columns/#comments</comments>
		<pubDate>Mon, 23 May 2011 19:25:21 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Boone's Pagination]]></category>
		<category><![CDATA[Boone's Sortable Columns]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[invite anyone]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[unconfirmed]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1287</guid>
		<description><![CDATA[Boone&#8217;s Sortable Columns is a new WordPress plugin to make it easier for developers of WordPress plugins and themes to create sortable data tables and lists. Like my recent Boone&#8217;s Pagination, this is not a plugin for end users but for developers. (And, by the way, Boone&#8217;s Sortable Columns goes with Boone&#8217;s Pagination like strawberries [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/boones-sortable-columns/">Boone&#8217;s Sortable Columns</a> is a new WordPress plugin to make it easier for developers of WordPress plugins and themes to create sortable data tables and lists. Like my recent <a href="http://teleogistic.net/2011/05/new-wordpress-plugin-boones-pagination/">Boone&#8217;s Pagination</a>, this is not a plugin for end users but for developers. (And, by the way, Boone&#8217;s Sortable Columns goes with Boone&#8217;s Pagination like strawberries go with rhubarb. More on that in a minute.)</p>
<p>If you&#8217;re building a client site, you can activate the plugin directly in the WordPress Dashboard, and instantiate the class anywhere in your installation. Or, if you&#8217;re the developer of a theme or plugin that you&#8217;ll be distributing for wide use, you can simply copy the file boones-sortable-columns.php into your own plugin/theme (I recommend a directory called &#8216;lib&#8217;), and then require it manually when you want to do some sortin&#8217;.</p>
<p>The plugin is <em>extensively</em> documented inline. I highly recommend that you <a href="https://github.com/boonebgorges/boones-sortable-columns/blob/master/boones-sortable-columns.php">crack open the source</a> if you have questions about the kinds of options that Boone&#8217;s Sortable Columns provides. But, as a quick introduction, here&#8217;s a simple example of how you might use the class in your own plugin. Let&#8217;s say you have a custom post type called &#8216;restaurant&#8217;, and you want to display a list of restaurants that is sortable by restaurant name, the date when the restaurant was added to the site, and the name of the person who submitted the restaurant (the post author). Here&#8217;s the code you might use for a simple table, with my comments and explanations inline.</p>
<pre class="brush: php">
// Include Boone&#039;s Sortable Columns. You only need to do this if you&#039;re not running it as a
// standalone plugin. Obviously, you&#039;ll need to put the proper path for your plugin.
require_once( WP_CONTENT_DIR . &#039;/my-plugin-name/lib/boones-sortable-columns.php&#039; );

// Define an array of column data.
// For more details on these (and more!) arguments, see the plugin&#039;s inline docs.
$cols = array(
	array(
		&#039;name&#039;		=&gt; &#039;title&#039;,
		&#039;title&#039;		=&gt; &#039;Restaurant Name&#039;,
		&#039;css_class&#039;	=&gt; &#039;restaurant-name&#039;,
		&#039;is_default&#039;	=&gt; true
	),
	array(
		&#039;name&#039;		=&gt; &#039;author&#039;,
		&#039;title&#039;		=&gt; &#039;Creator&#039;,
		&#039;css_class&#039;	=&gt; &#039;creator&#039;
	),
	array(
		&#039;name&#039;		=&gt; &#039;date&#039;,
		&#039;title&#039;		=&gt; &#039;Date Added&#039;,
		&#039;css_class&#039;	=&gt; &#039;date-added&#039;,
		&#039;default_order&#039;	=&gt; &#039;desc&#039;
	)
);

// Create the sorting object based on this column data.
$sortable = new BBG_CPT_Sort( $cols );

// Use some of the data from the $sortable object to help you build a posts query.
// In this example, I&#039;ve intentionally chosen sortable options that can be passed directly to the
// &#039;orderby&#039; param, because they are accepted directly by WP_Query (see http://codex.wordpress.org/Function_Reference/WP_Query#Order_.26_Orderby_Parameters for more details).
// In real life, your query might require something more complex, like the building of a meta_query.
$query_args = array(
	&#039;post_type&#039;	=&gt; &#039;restaurant&#039;,
	&#039;orderby&#039;	=&gt; $sortable-&gt;get_orderby,
	&#039;order&#039;		=&gt; $sortable-&gt;get_order
);

// Fire the query
$restaurants = new WP_Query( $query_args );

// Now let&#039;s create the table markup. Here&#039;s where the magic really happens.
?&gt;

&lt;?php if ( $restaurants-&gt;have_posts() ) : ?&gt;
	&lt;table&gt;
		&lt;thead&gt;
		&lt;tr&gt;
		&lt;?php /* Boone&#039;s Sortable Columns has a Loop syntax similar to WP&#039;s Loop */ ?&gt;
		&lt;?php if ( $sortable-&gt;have_columns() ) : ?&gt;
			&lt;?php while ( $sortable-&gt;have_columns ) : $sortable-&gt;the_column() ?&gt;
				&lt;?php /* Boone&#039;s Sortable Columns has some fancy methods to make life easy */ ?&gt;
				&lt;th class=&quot;&lt;?php $sortable-&gt;the_column_css_class() ?&gt;&quot;&gt;
					&lt;a href=&quot;&lt;?php $sortable-&gt;the_column_next_link( &#039;url&#039; ) ?&gt;&quot;&gt;&lt;?php $sortable-&gt;the_column_title() ?&gt;&lt;/a&gt;
				&lt;/th&gt;
			&lt;?php endwhile ?&gt;
		&lt;?php endif ?&gt;
		&lt;tr&gt;
		&lt;/thead&gt;

		&lt;tbody&gt;
		&lt;?php /* Here&#039;s where you do whatever you&#039;d normally do with your posts */ ?&gt;
		&lt;?php while ( $restaurants-&gt;have_posts() ) : $restaurants-&gt;the_post() ?&gt;
			&lt;tr&gt;
				&lt;td class=&quot;restaurant-name&quot;&gt;&lt;?php the_title() ?&gt;&lt;/td&gt;

				&lt;td class=&quot;creator&quot;&gt;&lt;?php the_author_link() ?&gt;&lt;/td&gt;

				&lt;td class=&quot;date-added&quot;&gt;&lt;?php the_date() ?&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;?php endwhile ?&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;
&lt;?php endif ?&gt;
</pre>
<p>Boone&#8217;s Sortable Columns handles everything else for you. It figures out what the current orderby/order parameters are. It figures out what the href on the column headers should be. It even creates CSS selectors for the &lt;th&gt; element that match what WP itself uses in the &#8216;widefat&#8217; tables on the Dashboard, so that you can take advantage of all the pretty JS and CSS built into the WP admin interface. In fact, if this were a Dashboard page, you could simplify the &lt;thead&gt; described above as follows:</p>
<pre class="brush: php">
&lt;thead&gt;&lt;tr&gt;
&lt;?php if ( $sortable-&gt;have_columns() ) : ?&gt;
	&lt;?php while ( $sortable-&gt;have_columns ) : $sortable-&gt;the_column() ?&gt;
		&lt;?php $sortable-&gt;the_column_th() ?&gt;
	&lt;?php endwhile ?&gt;
&lt;?php endif ?&gt;
&lt;/tr&gt;&lt;/thead&gt;
</pre>
<p>The method <code>the_column_th()</code> will build the markup for you. Ain&#8217;t that the bee&#8217;s knees?</p>
<h3>Together with Boone&#8217;s Pagination</h3>
<p>Boone&#8217;s Sortable Columns is made more scrumptious when combined with Boone&#8217;s Pagination. Here&#8217;s a compressed (uncommented) version of the example above, this time with some pagination code.</p>
<pre class="brush: php">
require_once( WP_CONTENT_DIR . &#039;/my-plugin-name/lib/boones-sortable-columns.php&#039; );
require_once( WP_CONTENT_DIR . &#039;/my-plugin-name/lib/boones-pagination.php&#039; );

$cols = array(
	array(
		&#039;name&#039;		=&gt; &#039;title&#039;,
		&#039;title&#039;		=&gt; &#039;Restaurant Name&#039;,
		&#039;css_class&#039;	=&gt; &#039;restaurant-name&#039;,
		&#039;is_default&#039;	=&gt; true
	),
	array(
		&#039;name&#039;		=&gt; &#039;author&#039;,
		&#039;title&#039;		=&gt; &#039;Creator&#039;,
		&#039;css_class&#039;	=&gt; &#039;creator&#039;
	),
	array(
		&#039;name&#039;		=&gt; &#039;date&#039;,
		&#039;title&#039;		=&gt; &#039;Date Added&#039;,
		&#039;css_class&#039;	=&gt; &#039;date-added&#039;,
		&#039;default_order&#039;	=&gt; &#039;desc&#039;
	)
);

$sortable = new BBG_CPT_Sort( $cols );

$pagination = new BBG_CPT_Pagination();

$query_args = array(
	&#039;post_type&#039;	=&gt; &#039;restaurant&#039;,
	&#039;orderby&#039;	=&gt; $sortable-&gt;get_orderby,
	&#039;order&#039;		=&gt; $sortable-&gt;get_order,
	&#039;paged&#039;		=&gt; $pagination-&gt;get_paged,
	&#039;per_page&#039;	=&gt; $pagination-&gt;get_per_page
);

$restaurants = new WP_Query( $query_args );

$pagination-&gt;setup_query( $restaurants );
?&gt;

&lt;?php if ( $restaurants-&gt;have_posts() ) : ?&gt;
	&lt;div class=&quot;pagination&quot;&gt;
		&lt;div class=&quot;currently-viewing&quot;&gt;
			&lt;?php $pagination-&gt;currently_viewing_text() ?&gt;
		&lt;/div&gt;

		&lt;div class=&quot;pag-links&quot;&gt;
			&lt;?php $pagination-&gt;paginate_links() ?&gt;
		&lt;/div&gt;
	&lt;/div&gt;

	&lt;table&gt;
		&lt;thead&gt;
		&lt;tr&gt;
		&lt;?php if ( $sortable-&gt;have_columns() ) : ?&gt;
			&lt;?php while ( $sortable-&gt;have_columns ) : $sortable-&gt;the_column() ?&gt;
				&lt;th class=&quot;&lt;?php $sortable-&gt;the_column_css_class() ?&gt;&quot;&gt;
					&lt;a href=&quot;&lt;?php $sortable-&gt;the_column_next_link( &#039;url&#039; ) ?&gt;&quot;&gt;&lt;?php $sortable-&gt;the_column_title() ?&gt;&lt;/a&gt;
				&lt;/th&gt;
			&lt;?php endwhile ?&gt;
		&lt;?php endif ?&gt;
		&lt;tr&gt;
		&lt;/thead&gt;

		&lt;tbody&gt;
		&lt;?php while ( $restaurants-&gt;have_posts() ) : $restaurants-&gt;the_post() ?&gt;
			&lt;tr&gt;
				&lt;td class=&quot;restaurant-name&quot;&gt;&lt;?php the_title() ?&gt;&lt;/td&gt;
				&lt;td class=&quot;creator&quot;&gt;&lt;?php the_author_link() ?&gt;&lt;/td&gt;
				&lt;td class=&quot;date-added&quot;&gt;&lt;?php the_date() ?&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;?php endwhile ?&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;

	&lt;div class=&quot;pagination&quot;&gt;
		&lt;div class=&quot;currently-viewing&quot;&gt;
			&lt;?php $pagination-&gt;currently_viewing_text() ?&gt;
		&lt;/div&gt;

		&lt;div class=&quot;pag-links&quot;&gt;
			&lt;?php $pagination-&gt;paginate_links() ?&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;?php endif ?&gt;
</pre>
<p>Sweet, huh? If you want to see some real-life, more complex examples of Boone&#8217;s Pagination and Boone&#8217;s Sortable Columns in use, check out <a href="https://github.com/boonebgorges/invite-anyone/blob/master/admin/admin-panel.php">Invite Anyone</a> (where the data is a custom post type, as in the example above &#8211; see method <code>invite_anyone_settings_mi_content()</code>) or <a href="https://github.com/boonebgorges/unconfirmed/blob/master/unconfirmed.php">Unconfirmed</a> (where the data actually comes from a custom query of the wp_signups table &#8211; look for the <code>admin_panel_main()</code> method).</p>
<p>You can get Boone&#8217;s Sortable Columns from the <a href="http://wordpress.org/extend/plugins/boones-sortable-columns/">wordpress.org repo</a> or follow its development on <a href="http://github.com/boonebgorges/boones-sortable-columns">Github</a>.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2011/05/new-wordpress-plugin-boones-pagination/' rel='bookmark' title='New WordPress plugin: Boone&#8217;s Pagination'>New WordPress plugin: Boone&#8217;s Pagination</a></li>
<li><a href='http://teleogistic.net/2011/05/new-wordpress-plugin-unconfirmed/' rel='bookmark' title='New WordPress plugin: Unconfirmed'>New WordPress plugin: Unconfirmed</a></li>
<li><a href='http://teleogistic.net/2011/06/working-on-a-photoblog-theme-for-wordpress/' rel='bookmark' title='Working on a photoblog theme for WordPress'>Working on a photoblog theme for WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-sortable-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WordPress plugin: Boone&#8217;s Pagination</title>
		<link>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-pagination/</link>
		<comments>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-pagination/#comments</comments>
		<pubDate>Fri, 13 May 2011 20:44:44 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1272</guid>
		<description><![CDATA[The more I use custom post types in WordPress, the more I find myself leaving until the last minute (and often forgetting) the issue of pagination. WordPress has paginate_links() and a couple other functions to help make pagination easier, but it&#8217;s still kind of a pain, and I ended up rewriting certain common functions (like [...]]]></description>
			<content:encoded><![CDATA[<p>The more I use custom post types in WordPress, the more I find myself leaving until the last minute (and often forgetting) the issue of pagination. WordPress has paginate_links() and a couple other functions to help make pagination easier, but it&#8217;s still kind of a pain, and I ended up rewriting certain common functions (like functions to get the per_page parameter out of the $_GET global, etc) in multiple projects.</p>
<p>So I took a little time to write a reusable class for a lot of these common functions. It&#8217;s called &#8211; tada! &#8211; <a href="https://github.com/boonebgorges/boones-pagination">Boone&#8217;s Pagination</a>. This is not so much a plugin in itself (though if you plan to use it a lot on a client site, you can activate it as a plugin) as it is a helper for people building themes and plugins. Here&#8217;s how you use it:</p>
<pre class="brush: php">
require_once( dirname(__FILE__) . &#039;/boones-pagination.php&#039; ); // You only need this if you don&#039;t activate it as a plugin

$pagination = new BBG_CPT_Pag;

$my_query_args = array(
	&#039;post_type&#039;	 =&gt; &#039;my_post_type&#039;,
	&#039;paged&#039;		 =&gt; $pagination-&gt;get_paged,
	&#039;posts_per_page&#039; =&gt; $pagination-&gt;get_per_page // This does all the work of fetching the pagination arguments out of the $_GET global
);

$my_query = new WP_Query( $my_query_args );
$pagination-&gt;setup_query( $my_query ); // Now that you&#039;ve run the query, finish populating the object

if ( $my_query-&gt;have_posts() ) :
	while ( $my_query-&gt;have_posts() ); $my_query-&gt;the_post();
	the_title(); // Do whatever you&#039;d normally do in The Loop
endif;

$pagination-&gt;currently_viewing_text(); // eg &quot;Viewing 11-20 of 34&quot;
$pagination-&gt;paginate_links(); // These are the links themselves
</pre>
<p>I&#8217;ll keep adding handy functions to the class as I think of them, but you should feel free to extend it yourself. I&#8217;ve also added plenty of inline docs, so crack open the source to learn more about it. <a href="https://github.com/boonebgorges/boones-pagination">Follow Boone&#8217;s Pagination on Github.</a></p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2011/05/new-wordpress-plugin-boones-sortable-columns/' rel='bookmark' title='New WordPress plugin: Boone&#8217;s Sortable Columns'>New WordPress plugin: Boone&#8217;s Sortable Columns</a></li>
<li><a href='http://teleogistic.net/2011/06/working-on-a-photoblog-theme-for-wordpress/' rel='bookmark' title='Working on a photoblog theme for WordPress'>Working on a photoblog theme for WordPress</a></li>
<li><a href='http://teleogistic.net/2010/09/using-github-with-wordpress-org-plugin-svn/' rel='bookmark' title='Using Github with wordpress.org plugin SVN'>Using Github with wordpress.org plugin SVN</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/05/new-wordpress-plugin-boones-pagination/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New BuddyPress plugin: BuddyPress Docs</title>
		<link>http://teleogistic.net/2011/03/new-buddypress-plugin-buddypress-docs/</link>
		<comments>http://teleogistic.net/2011/03/new-buddypress-plugin-buddypress-docs/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 14:38:16 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[edtech]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[buddypress docs]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1140</guid>
		<description><![CDATA[Today I am releasing the first public beta of a significant new BuddyPress plugin: BuddyPress Docs. BuddyPress Docs is a collaborative, front-end, rich-text, document editing tool for BuddyPress groups (individual user Docs are an upcoming feature). Read much more about the plugin&#8217;s features. This plugin has been developed for the CUNY Academic Commons (though it [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1145" class="wp-caption alignright" style="width: 310px"><a href="http://teleogistic.net/wp-content/uploads/2011/03/docs-shot.jpg"><img src="http://teleogistic.net/wp-content/uploads/2011/03/docs-shot-300x246.jpg" alt="BuddyPress Docs edit screen" title="docs-shot" width="300" height="246" class="size-medium wp-image-1145" style="border: 1px solid #000" /></a><p class="wp-caption-text">BuddyPress Docs edit screen</p></div>
<p>Today I am releasing the first public beta of a significant new BuddyPress plugin: <a href="http://teleogistic.net/code/buddypress/buddypress-docs/">BuddyPress Docs</a>. BuddyPress Docs is a collaborative, front-end, rich-text, document editing tool for BuddyPress groups (individual user Docs are an upcoming feature). <a href="http://teleogistic.net/code/buddypress/buddypress-docs/">Read much more about the plugin&#8217;s features.</a></p>
<p>This plugin has been developed for the <a href="http://commons.gc.cuny.edu">CUNY Academic Commons</a> (though it won&#8217;t be live there for a few weeks). Today&#8217;s release is a pre-stable beta &#8211; it should run fine, but there are bound to be bugs, and you probably won&#8217;t want to run it on a production site quite yet.</p>
<p>You can follow the plugin&#8217;s development at <a href="http://github.com/boonebgorges/buddypress-docs">http://github.com/boonebgorges/buddypress-docs</a>.</p>
<div style="clear: both"></div>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2011/05/buddypress-1-1-doc-history/' rel='bookmark' title='BuddyPress Docs 1.1: Doc History'>BuddyPress Docs 1.1: Doc History</a></li>
<li><a href='http://teleogistic.net/2009/09/new-buddypress-plugin-enhanced-buddypress-widgets/' rel='bookmark' title='New BuddyPress plugin: Enhanced BuddyPress Widgets'>New BuddyPress plugin: Enhanced BuddyPress Widgets</a></li>
<li><a href='http://teleogistic.net/2010/05/new-buddypress-plugin-buddypress-group-email-subscription/' rel='bookmark' title='New BuddyPress plugin: BuddyPress Group Email Subscription'>New BuddyPress plugin: BuddyPress Group Email Subscription</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/03/new-buddypress-plugin-buddypress-docs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Invite Anyone 0.8 and CloudSponge integration</title>
		<link>http://teleogistic.net/2011/02/invite-anyone-0-8-and-cloudsponge-integration/</link>
		<comments>http://teleogistic.net/2011/02/invite-anyone-0-8-and-cloudsponge-integration/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 14:39:48 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[cloudsponge]]></category>
		<category><![CDATA[invite anyone]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1114</guid>
		<description><![CDATA[Version 0.8 of my popular Invite Anyone plugin for BuddyPress has a brand new feature: optional integration with the CloudSponge service. CloudSponge is a service that acts as a front-end for a number of API address-book services (at the moment, Gmail, Yahoo Mail, Windows Live/Hotmail/MSN, AOL, Plaxo, the Mac Address Book, and Microsoft Outlook). With [...]]]></description>
			<content:encoded><![CDATA[<p>Version 0.8 of my popular <a href="http://wordpress.org/extend/plugins/invite-anyone/">Invite Anyone</a> plugin for BuddyPress has a brand new feature: optional integration with the CloudSponge service. <a href="http://www.cloudsponge.com/">CloudSponge</a> is a service that acts as a front-end for a number of API address-book services (at the moment, Gmail, Yahoo Mail, Windows Live/Hotmail/MSN, AOL, Plaxo, the Mac Address Book, and Microsoft Outlook). With CloudSponge turned on alongside Invite Anyone, members of your BuddyPress community can invite friends to join the site by dipping into their preferred address book and selecting the desired email addresses from an easy-to-use interface. This can be a powerful driver of membership and engagement. To sign up for CloudSponge and turn on IA integration, go to the Invite Anyone Dashboard panel (be sure to look in the Network Admin on 3.1 Multisite!).</p>
<p>CloudSponge is a paid service (though they have a free trial). If you decide to become a CloudSponge customer through Invite Anyone, I&#8217;ll receive a small portion of your membership fees as an affiliate bonus. You can think of this as a way to support future development on Invite Anyone, by making sure that I have money to purchase the beer and pizza that fuel so much of my code :)</p>
<p>Of course, CloudSponge is an optional add-on to Invite Anyone. The plugin itself, and all its existing features, will continue to be free. CloudSponge is a little something extra for those communities where a regular stream of new members is key to success.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2011/05/invite-anyone-0-9-admin-management-and-stats/' rel='bookmark' title='Invite Anyone 0.9: Admin management and stats'>Invite Anyone 0.9: Admin management and stats</a></li>
<li><a href='http://teleogistic.net/2009/12/new-buddypress-plugin-invite-anyone/' rel='bookmark' title='New BuddyPress plugin: Invite Anyone'>New BuddyPress plugin: Invite Anyone</a></li>
<li><a href='http://teleogistic.net/2010/04/big-new-version-of-invite-anyone-for-buddypress/' rel='bookmark' title='Big new version of Invite Anyone for BuddyPress'>Big new version of Invite Anyone for BuddyPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/02/invite-anyone-0-8-and-cloudsponge-integration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New WordPress plugin: Prezi WP</title>
		<link>http://teleogistic.net/2011/02/new-wordpress-plugin-prezi-wp/</link>
		<comments>http://teleogistic.net/2011/02/new-wordpress-plugin-prezi-wp/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 17:45:00 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[CUNY Academic Commons]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[prezi]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1100</guid>
		<description><![CDATA[I had a request to allow Prezis to be embedded on the CUNY Academic Commons, but the one plugin I tried for that purpose seemed to be broken and overengineered. So I took an hour and wrote my own: Prezi WP. In brief, it gives you a [prezi] shortcode for easy embedding of those Mind [...]]]></description>
			<content:encoded><![CDATA[<p>I had a request to allow Prezis to be embedded on the <a href="http://commons.gc.cuny.edu">CUNY Academic Commons</a>, but the one plugin I tried for that purpose seemed to be broken and overengineered. So I took an hour and wrote my own: <a href="http://teleogistic.net/code/wordpresswordpress-mu/prezi-wp/">Prezi WP</a>. In brief, it gives you a [prezi] shortcode for easy embedding of those Mind Blowing, Non-Linear bad boys.</p>
<p>It&#8217;ll be in the wordpress.org repository soon enough, but for now you can read more and download it <a href="http://teleogistic.net/code/wordpresswordpress-mu/prezi-wp/">here</a>.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2010/09/using-github-with-wordpress-org-plugin-svn/' rel='bookmark' title='Using Github with wordpress.org plugin SVN'>Using Github with wordpress.org plugin SVN</a></li>
<li><a href='http://teleogistic.net/2011/11/new-wordpress-plugin-add-user-autocomplete/' rel='bookmark' title='New WordPress plugin: Add User Autocomplete'>New WordPress plugin: Add User Autocomplete</a></li>
<li><a href='http://teleogistic.net/2010/08/introducing-anthologize-a-new-wordpress-plugin/' rel='bookmark' title='Introducing Anthologize, a new WordPress plugin'>Introducing Anthologize, a new WordPress plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/02/new-wordpress-plugin-prezi-wp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prezi WP</title>
		<link>http://teleogistic.net/code/wordpresswordpress-mu/prezi-wp/</link>
		<comments>http://teleogistic.net/code/wordpresswordpress-mu/prezi-wp/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 17:41:38 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[prezi]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/</guid>
		<description><![CDATA[Prezi WP is a simple plugin that adds a [prezi] shortcode to your WordPress installation. Use: The id attribute is required. The plugin should understand both the unique Prezi ids (the jumble of letters and numbers in the URL) and the entire URL of the presentation (eg http://prezi.com/hgjm18z36h75/why-should-you-move-beyond-slides/). [prezi id=&#039;http://prezi.com/hgjm18z36h75/why-should-you-move-beyond-slides/&#039;] [prezi id=&#039;hgjm18z36h75&#039;] The plugin also [...]]]></description>
			<content:encoded><![CDATA[<p>Prezi WP is a simple plugin that adds a [prezi] shortcode to your WordPress installation. Use:</p>
<ul>
<li>The <strong>id</strong> attribute is required. The plugin should understand both the unique Prezi ids (the jumble of letters and numbers in the URL) and the entire URL of the presentation (eg http://prezi.com/hgjm18z36h75/why-should-you-move-beyond-slides/).
<pre class="brush: php">
    [prezi id=&#039;http://prezi.com/hgjm18z36h75/why-should-you-move-beyond-slides/&#039;]
    [prezi id=&#039;hgjm18z36h75&#039;]
    </pre>
</li>
<li>The plugin also accepts optional width and height parameters:
<pre class="brush: php">
  [prezi id=&#039;hgjm18z36h75&#039; width=&#039;600&#039; height=&#039;450&#039;]
  </pre>
</li>
</ul>
<p>Prezi WP was developed for the <a href="http://commons.gc.cuny.edu">CUNY Academic Commons</a>.</p>
<p><a href="http://wordpress.org/extend/plugins/preziwp/">Download Prezi WP here.</a></p>
<p>Prezi WP has been downloaded <strong>847</strong> times. Are you using this plugin? Consider a <strong><a href="/donate">donation</a></strong>.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/code/wordpresswordpress-mu/prezi-wp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Group Announcements tab in BuddyPress</title>
		<link>http://teleogistic.net/2011/01/group-announcements-tab-in-buddypress/</link>
		<comments>http://teleogistic.net/2011/01/group-announcements-tab-in-buddypress/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 16:57:57 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[edtech]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1082</guid>
		<description><![CDATA[Cross-posted at the CUNY Academic Commons Development blog I had a request or two to explain how I built the Group Announcements feature on the CUNY Academic Commons. Here goes. Brief background: When the Commons was upgraded to BuddyPress 1.2, we got the benefit of interactive activity streams everywhere, including groups. This caused some confusion, [...]]]></description>
			<content:encoded><![CDATA[<p><em>Cross-posted at the <a href="http://dev.commons.gc.cuny.edu/2011/01/13/group-announcements-tab-in-buddypress/">CUNY Academic Commons Development blog</a></em></p>
<p>I had a request or two to explain how I built the Group Announcements feature on the <a href="http://commons.gc.cuny.edu">CUNY Academic Commons</a>. Here goes.</p>
<p>Brief background: When the Commons was upgraded to BuddyPress 1.2, we got the benefit of interactive activity streams everywhere, including groups. This caused some confusion, however, as users were uncertain where conversation best fit into the Commons&#8217;s architecture: in the Forums (where it had been traditionally), or in the activity stream. In some communities this kind of fracturing might be okay or even welcome, but in ours it was confusing. At the same time, we wanted a way for group admins and mods to send important notices to the members of their groups. By taking the group activity updates and repurposing it as a Group Announcements section, I was able to kill two birds with one stone: providing an announcement space for mods, while focusing extended discussion in the forums.</p>
<p><a href="http://teleogistic.net/wp-content/uploads/2011/01/cac-group-announcements.zip">You can download the CAC Group Announcements plugin here.</a></p>
<p>I&#8217;m not putting this in the repo at the moment because I don&#8217;t want to build a proper admin UI and support it :) For that reason, here is a primer on how the plugin works &#8211; if you want to customize or maintain it, you&#8217;re on your own, buster.</p>
<ol>
<li>The <code>CAC_Group_Announcements</code> class is an instance of the <a href="http://codex.buddypress.org/developer-docs/group-extension-api/">BuddyPress Group Extension API</a>. It is responsible for creating the Announcements tab markup and adding it to the nav. You&#8217;ll notice that the majority of the markup is created by including bp-default&#8217;s activity-loop.php and post-form.php templates. You could customize this more if you wanted.</li>
<li><code>bp_is_group_announcements()</code> is a little template tag that can be used to test whether you&#8217;re looking at a group announcements page. This is needed for the activity filter, in step 3.</li>
<li><code>cac_set_announcement_filter()</code> adds a filter to the bp_has_activities query string when you are looking at an announcements page, so that it only displays activity items of the type activity_update. In other words, when you are looking at the regular activity stream for the group, you see all of the associated group activity items (new members, forum posts, etc) but when you&#8217;re on the announcements page you only see activity updates (which, remember, have been repurposed as announcements).</li>
</ol>
<p>As I look at the code, I see that there are things I would definitely change if I were going to make this into a distributed plugin. If you want to make those changes, be my guest. You&#8217;re welcome to help each other in the comment section, but I won&#8217;t be formally supporting this, as it is a very basic hack that should happen at the theme level anyway. Good luck!</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2010/05/new-buddypress-plugin-buddypress-group-email-subscription/' rel='bookmark' title='New BuddyPress plugin: BuddyPress Group Email Subscription'>New BuddyPress plugin: BuddyPress Group Email Subscription</a></li>
<li><a href='http://teleogistic.net/2010/11/new-buddypress-plugin-bp-group-reviews/' rel='bookmark' title='New BuddyPress plugin: BP Group Reviews'>New BuddyPress plugin: BP Group Reviews</a></li>
<li><a href='http://teleogistic.net/2010/03/new-buddypress-plugin-bp-group-management/' rel='bookmark' title='New BuddyPress plugin: BP Group Management'>New BuddyPress plugin: BP Group Management</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2011/01/group-announcements-tab-in-buddypress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Extending Anthologize: Part 2</title>
		<link>http://teleogistic.net/2010/11/extending-anthologize-part-2/</link>
		<comments>http://teleogistic.net/2010/11/extending-anthologize-part-2/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 23:12:37 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[edtech]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[anthologize]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=1045</guid>
		<description><![CDATA[In my last post, I gave a brief overview of what happens when you click the Export Project button in Anthologize, with an eye toward demonstrating the role that third party plugins (written by people Just Like You!) can play in extending the software. In this post, I&#8217;ll flesh out some of those details. Step [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://teleogistic.net/2010/11/extending-anthologize-part-1/">last post</a>, I gave a brief overview of what happens when you click the Export Project button in <a href="http://anthologize.org">Anthologize</a>, with an eye toward demonstrating the role that third party plugins (written by people Just Like You!) can play in extending the software. In this post, I&#8217;ll flesh out some of those details.</p>
<h3>Step 1: Anthologize, meet my format</h3>
<p>Anthologize has what I like to think of as two internal APIs: the WordPress-facing API, and the theming API. The first step is to let Anthologize know that your format exists, which you&#8217;ll do by using the key function in the WP-facing API: <code>anthologize_register_format()</code>. (Check out how the WPAPI functions work in <a href="https://github.com/chnm/anthologize/blob/master/includes/class-format-api.php">the source</a>.) You should call <code>anthologize_register_format()</code> in a function hooked to <code>anthologize_init</code>, which ensures that it won&#8217;t fire before Anthologize is ready for it. Here&#8217;s a simple example:</p>
<pre class="brush: php">
function register_my_anthologize_format() {
	$name = &#039;example_format&#039;;
	$label = &#039;My Anthologize Format&#039;;
	$loader_file = dirname(__FILE__) . &#039;/base.php&#039;;

	anthologize_register_format( $name, $label, $loader_file );
}
add_action( &#039;anthologize_init&#039;, &#039;register_my_anthologize_format&#039; );
</pre>
</p>
<p><code>anthologize_register_format_option()</code> takes three arguments. The first is the name that Anthologize will use internally as a unique key for your format. The second is the name that users will see on the Export screen radio button and elsewhere in the interface. (It&#8217;s a good idea to set a textdomain for your strings so that they can be translated &#8211; eg <code>$label = __( 'My Anthologize Format', 'my-anthologize-plugin' );</code>.) The third argument is the absolute server path of your main translator file, the file that will be loaded at export time.</p>
<p>You can read a more in-depth example, embedded in a loader class, in <a href="https://github.com/boonebgorges/anthologize-example/blob/master/anthologize-example.php">this bare-bones plugin that I built for testing purposes</a>. And the definitive examples, of course, can be found in <a href="https://github.com/chnm/anthologize/blob/master/anthologize.php#L233">the way that Anthologize registers its native export formats</a> (yum, we love eating our own dog food!).</p>
<p>What does this give you? First, it makes your format available as a format option on the second screen of the export process:<br />
<br />
<a href="http://teleogistic.net/wp-content/uploads/2010/11/1.png" ><img style="border:1px solid #000" src="http://teleogistic.net/wp-content/uploads/2010/11/1.png" alt="" title="1" width="203" height="133" class="alignnone size-full wp-image-1049" /></a><br />
<br />
Second, it gives your format a Publishing Options page. Since we haven&#8217;t registered any options yet, we get the bare minimum, the shortcode toggle that all formats get:<br />
<br />
<a href="http://teleogistic.net/wp-content/uploads/2010/11/2.png"><img style="border:1px solid #000" src="http://teleogistic.net/wp-content/uploads/2010/11/2.png" alt="" title="2" width="407" height="411" class="alignnone size-full wp-image-1053" /></a><br />
<br />
Third &#8211; and this is the big thing &#8211; <code>anthologize_register_format()</code> tells Anthologize that, if the user has selected your format on the export screens, the TEI document containing the project data will be handed off to the translator file whose path you specified when you registered the format. That&#8217;s where the format translation itself happens.</p>
<h3>Step 2: Gimme some options</h3>
<p>One of the big thoughts behind the Anthologize plugin architecture is to model WordPress&#8217;s design philosophy, which is to provide relatively few options in the core product but to allow for arbitrarily extended functionality by plugins. That&#8217;s the purpose behind <code>anthologize_register_format_option()</code>, the second pillar of Anthologize&#8217;s WP-facing API. <code>anthologize_register_format_option()</code> gives a framework for plugins to register any kind of option associated with their custom format, provides all the integrated markup for presenting those options to users, and passes along the user&#8217;s choices to the Anthologize TEI document used for format translation.</p>
<p>Format options can also be loaded at <code>anthologize_init</code>, though you should be careful to load them after the format itself. I&#8217;ll do that by using an <code>add_action</code> priority:</p>
<pre class="brush: php">
function register_my_anthologize_format_options() {
	$website_name = &#039;website&#039;;
	$website_label = &#039;Website&#039;;
	$website_type = &#039;textbox&#039;;

	anthologize_register_format_option( &#039;example_format&#039;, $website_name, $website_label, $website_type );
}
add_action( &#039;anthologize_init&#039;, &#039;register_my_anthologize_format_options&#039;, 15 );
</pre>
<p>(Note that the first argument is the unique $name of the format I intend to associate the option with.) This registers a plain textbox with the label &#8216;Website&#8217;:<br />
<br />
<a href="http://teleogistic.net/wp-content/uploads/2010/11/3.png"><img style="border:1px solid #000" src="http://teleogistic.net/wp-content/uploads/2010/11/3.png" alt="" title="3" width="232" height="172" class="alignnone size-full wp-image-1055" /></a><br />
<br />
You can also register checkboxes, if you need a Boolean:</p>
<pre class="brush: php">
$option_name = &#039;include_dedication&#039;;
$option_label = &#039;Include Dedication?&#039;;
$option_type = &#039;checkbox&#039;;

anthologize_register_format_option( &#039;example_format&#039;, $option_name, $option_label, $option_type );
</pre>
<p>
<a href="http://teleogistic.net/wp-content/uploads/2010/11/5.png"><img style="border:1px solid #000" src="http://teleogistic.net/wp-content/uploads/2010/11/5.png" alt="" title="5" width="219" height="160" class="alignnone size-full wp-image-1056" /></a><br />
</p>
<p>Or you can register dropdowns:</p>
<pre class="brush: php">
$fontface_format_name = &#039;example_format&#039;;
$fontface_option_name = &#039;font-face&#039;;
$fontface_label = &#039;Font Face&#039;;
$fontface_type = &#039;dropdown&#039;;
$fontface_values = array(
	&#039;courier&#039; =&gt; &#039;Courier&#039;,
	&#039;georgia&#039; =&gt; &#039;Georgia&#039;,
	&#039;garamond&#039; =&gt; &#039;Garamond&#039;
);
$fontface_default = &#039;georgia&#039;;

anthologize_register_format_option( $fontface_format_name, $fontface_option_name, $fontface_label, $fontface_type, $fontface_values, $fontface_default );
</pre>
<p>This kind of option highlights some of the other possible arguments that <code>anthologize_register_format_option()</code> will take: an array of possible values, and a default selected value:<br />
<br />
<a href="http://teleogistic.net/wp-content/uploads/2010/11/6.png"><img src="http://teleogistic.net/wp-content/uploads/2010/11/6.png" alt="" title="6" width="240" height="174" class="alignnone size-full wp-image-1058" /></a><br />
</p>
<p>All the options you provide, and in particular the options selected by the user at export time, are handed to your main translator file at the very end of the Anthologize export process.
</p>
<p>So that&#8217;s how you get your format and its options registered on the WordPress side of things. Stay tuned for a discussion of how translators might be built.</p>
<p>Are you a potential plugin developer with ideas about how this API might evolve to better suit your purposes? Hop onto the <a href="http://groups.google.com/group/anthologize-dev">dev list</a>.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2010/11/extending-anthologize-part-1/' rel='bookmark' title='Extending Anthologize: Part 1'>Extending Anthologize: Part 1</a></li>
<li><a href='http://teleogistic.net/2010/08/anthologize-0-4-alpha-is-released/' rel='bookmark' title='Anthologize 0.4-alpha is released'>Anthologize 0.4-alpha is released</a></li>
<li><a href='http://teleogistic.net/2010/08/introducing-anthologize-a-new-wordpress-plugin/' rel='bookmark' title='Introducing Anthologize, a new WordPress plugin'>Introducing Anthologize, a new WordPress plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2010/11/extending-anthologize-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

