{"id":71,"date":"2005-09-15T14:17:42","date_gmt":"2005-09-15T05:17:42","guid":{"rendered":"https:\/\/regex.info\/blog\/other-writings\/wordpress-file-based-posts-plugin"},"modified":"2006-05-08T22:50:49","modified_gmt":"2006-05-08T13:50:49","slug":"wordpress-file-based-posts-plugin","status":"publish","type":"page","link":"https:\/\/regex.info\/blog\/other-writings\/wordpress-file-based-posts-plugin","title":{"rendered":"WordPress &#8220;File-based Posts&#8221; Plugin (v1.04)"},"content":{"rendered":"\n\n\n\n\n<table border=\"1\" style=\"border: 1px solid blue\" cellspacing=\"0\"\ncellpadding=\"5\"><tr valign=\"baseline\"><td align=\"center\">Current Version: <b>1.04<\/b>\n<br\/><small>(<a href=\"#h\">version history<\/a>)<\/small><\/td><td>Download:\n<a\nhref=\"\/code\/file-based-posts.php\">file-based-posts.php<\/a><\/td><\/tr><\/table>\n<p>\n\nI much prefer to compose and edit text with <a\nhref=\"http:\/\/www.gnu.org\/software\/emacs\/emacs.html\" style=\"text-decoration:\nnone;\">my favorite text editor<\/a>, rather than in a\n<tt>&lt;textarea&gt;<\/tt> box on <span class='nobr'>a web<\/span> page. Thus, <span class='nobr'>I created<\/span> the <a\nhref=\"\/code\/file-based-posts.php\">'file-based posts' plugin<\/a>\nfor <a href=\"http:\/\/wordpress.org\">WordPress<\/a>, which allows you to\nmaintain the body of <span class='nobr'>a post<\/span> in <span class='nobr'>a file<\/span> on the local web-server host. Changes\nto the file are reflected immediately on the blog site.\n\n<\/p>\n\n<h3>Executive Summary<\/h3>\n<style type=\"text\/css\">\nli { margin-bottom: 10px }\n<\/style>\n<ol>\n\n  <li> Install this plugin (download <a\n       href=\"\/file-based-posts.php\">here<\/a> and install as\n       &#8220;<b>file-based-posts.php<\/b>&#8221; in your <b>wp-content\/plugins<\/b>\n       directory).<\/li>\n\n  <li> On the newly-available &#8220;File-Based Posts&#8221; tab of the &#8220;Options&#8221; blog\n       admin page, configure the directory in which post files will go.\n       (Be sure the web server can read files in that directory.)<\/li>\n\n  <li> In that directory, create <span class='nobr'>a file<\/span> containing the body content of your next post, say\n       &#8220;<b>my-next-post.html<\/b>&#8221;. (The filename must end with\n       <b>.html<\/b>, and may not contain whitespace.)<\/li>\n\n  <li> With WordPress's &#8220;Write Post&#8221; browser-based interface, enter the post's\n       title, date, draft\/public, etc., as you normally would. However, instead of putting\n       the full body content in the big <tt>&lt;textarea&gt;<\/tt> box, simply put\n       <span class='nobr'>&#8220;<b>FILE: my-next-post.html<\/b>&#8221;<\/span> in that box.<\/li>\n\n  <li> That's it. <span class='nobr'>You may edit<\/span> the &#8220;my-next-post.html&#8221; file any\n       time; changes are pulled in the next time the post is viewed.<\/li>\n       <\/ol>\n<p> Start over from step #3 for your next post or page (using <span class='nobr'>a unique<\/span> filename, of course).<\/p>\n\n\n<h3>More Details<\/h3>\n\n\n<p> After first installing this plugin (see step one above), visit the\nOptions admin page (&#8220;File-Based Posts&#8221; tab) to configure this plugin's\nbase-directory parameter (the directory in which you'll create and maintain\npost-related files). From then on, as you create content with WordPress's\n&#8220;Write Post&#8221; and &#8220;Write Page&#8221; browser-based interface, you have the option\nof typing the full content in the <tt>&lt;textarea&gt;<\/tt> box as before,\nor, you can simply refer to the file which contains the content (the file\nhaving been previously created by you with your favorite text editor).\n\n<\/p><p>\n\nFor example, you can create <span class='nobr'>a file<\/span> &#8220;<b>my-next-post.html<\/b>&#8221;\n(the filename must end with &#8220;<b>.html<\/b>&#8221;), and enter the body\ncontent of your post. <span class='nobr'>You then use<\/span> the normal WordPress mechanism to create\n<span class='nobr'>a post,<\/span> but instead of typing the post body content in the big\n<tt>&lt;textarea&gt;<\/tt> box, you need enter only\n&#8220;<b>FILE:<\/b>&#8221; followed by the filename\n(&#8220;<b>my-next-post.html<\/b>&#8221;). For example,<\/p>\n\n<div style=\"border: 1px blue solid; width: 50%; margin-left: 4em; margin-top: 10px\">\n<tt>FILE: my-next-post.html<\/tt>\n<p>&nbsp;<\/p>\n<\/div>\n\n<p>Be sure to fill in the title, date, visibility, etc., on the normal\nWordPress &#8220;Write Post&#8221; page. Only the body content is in the file.\n\n<\/p>\n\n<h4>Updating <span class='nobr'>A Post<\/span><\/h4>\n\n<p>You may update the file at any time; any changes are reflected online\nthe next time the post is viewed. <span class='nobr'>If you wish<\/span> to update the post's title,\ndate, categories, custom fields, etc. (anything <i>except<\/i> the body), do\nso as with any WordPress post or page, via the browser-based admin\ninterface.<\/p>\n\n<h4>The Post's &#8220;edit&#8221; Page<\/h4>\n\n<p>If you view the post's &#8220;edit&#8221; page in WordPress, you'll see something like:<\/p>\n\n<div style=\"border: 1px blue solid; margin-left: 4em; margin-top: 10px\">\nFILE: file-based-posts.html\n<br\/>\n<br\/>&lt;!--\n<br\/>**********************************************************************\n<br\/>***\n<br\/>***&nbsp;&nbsp;E&nbsp;d&nbsp;i&nbsp;t&nbsp;&nbsp;&nbsp;t&nbsp;h&nbsp;i&nbsp;s&nbsp;&nbsp;&nbsp;p&nbsp;o&nbsp;s&nbsp;t&nbsp;'&nbsp;s&nbsp;&nbsp;&nbsp;b&nbsp;o&nbsp;d&nbsp;y&nbsp;&nbsp;&nbsp;i&nbsp;n&nbsp;&nbsp;&nbsp;t&nbsp;h&nbsp;e&nbsp;&nbsp;&nbsp;a&nbsp;b&nbsp;o&nbsp;v&nbsp;e&nbsp;-&nbsp;n&nbsp;a&nbsp;m&nbsp;e&nbsp;d\n<br\/>***&nbsp;&nbsp;f&nbsp;i&nbsp;l&nbsp;e&nbsp;,&nbsp;&nbsp;&nbsp;n&nbsp;o&nbsp;t&nbsp;&nbsp;&nbsp;h&nbsp;e&nbsp;r&nbsp;e&nbsp;&nbsp;&nbsp;i&nbsp;n&nbsp;&nbsp;&nbsp;W&nbsp;o&nbsp;r&nbsp;d&nbsp;P&nbsp;r&nbsp;e&nbsp;s&nbsp;s&nbsp;.\n<br\/>***\n<br\/>***&nbsp;&nbsp;A&nbsp;n&nbsp;y&nbsp;&nbsp;&nbsp;c&nbsp;h&nbsp;a&nbsp;n&nbsp;g&nbsp;e&nbsp;&nbsp;&nbsp;m&nbsp;a&nbsp;d&nbsp;e&nbsp;&nbsp;&nbsp;h&nbsp;e&nbsp;r&nbsp;e&nbsp;&nbsp;&nbsp;w&nbsp;i&nbsp;l&nbsp;l&nbsp;&nbsp;&nbsp;n&nbsp;o&nbsp;t&nbsp;&nbsp;&nbsp;b&nbsp;e&nbsp;&nbsp;&nbsp;s&nbsp;a&nbsp;v&nbsp;e&nbsp;d&nbsp;.\n<br\/>***\n<br\/>***&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;-&nbsp;&nbsp;&nbsp;t&nbsp;h&nbsp;e&nbsp;&nbsp;&nbsp;'&nbsp;f&nbsp;i&nbsp;l&nbsp;e&nbsp;-&nbsp;b&nbsp;a&nbsp;s&nbsp;e&nbsp;d&nbsp;&nbsp;&nbsp;p&nbsp;o&nbsp;s&nbsp;t&nbsp;s&nbsp;'&nbsp;&nbsp;&nbsp;p&nbsp;l&nbsp;u&nbsp;g&nbsp;i&nbsp;n\n<br\/>**********************************************************************\n<br\/>--&gt;\n<br\/>\n&lt;p&gt;This is my next post blah blah blah....\n<p>&nbsp;<\/p>\n<\/div>\n\n<p>The first line is the &#8220;FILE:&#8221; line you entered when the post was\ncreated, followed by <span class='nobr'>a warning<\/span> (inserted by this plugin) that any changes\nto the body content via this interface will be lost, since the body content\nis refreshed from the file, if needed, each time the post is viewed.<\/p>\n\n\n<p>Following the warning, the body content most-recently-pulled from the file\nis shown.<\/p>\n\n<h4>Reverting <span class='nobr'>A Post<\/span> From File-Based Back To Normal<\/h4>\n\n<p>If you wish to move control of <span class='nobr'>a post's<\/span> body content from the file back\nto WordPress's database, simply view the post's &#8220;edit&#8221; page and remove the\n&#8220;FILE:&#8221; line (and the warning that this plugin added). What's left is the\npost content most recently pulled from the file, and that's what will stay\nin the database. <span class='nobr'>The lack of<\/span> <span class='nobr'>a leading<\/span> &#8220;FILE:&#8221; line means that this post\nhas now been disassociated from this plugin and associated files. <span class='nobr'>You can then<\/span> safely go ahead and delete the file, if you wish, as it will no longer\nbe used.<\/p>\n\n\n<h4>Backdoor Testing<\/h4>\n\n<p>\nAny content of the file within<\/p>\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;nopost&gt;&nbsp;&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;.&nbsp;&nbsp; &lt;\/nopost&gt;<\/p>\n\n<p>tags is removed before what remains is used for the post. This can be\nuseful for &#8220;backdoor&#8221; testing of <span class='nobr'>a page<\/span> prior to posting.<\/p>\n\n<p>If you choose to make your base directory one that's part of your web\nserver's document tree, you can view files you've written (or are in the\nprocess of writing) as normal static web pages. <span class='nobr'>I like to<\/span> do this to\npreview <span class='nobr'>a post<\/span> before <span class='nobr'>I bother<\/span> to integrate it with WordPress. However, in\norder to get <span class='nobr'>a more<\/span> true rendition of what it'll look like once in my blog, <span class='nobr'>I need to<\/span> include the style sheet link. <span class='nobr'>I include<\/span> that link within\n<b>&lt;nopost&gt;<\/b> ... <b>&lt;\/nopost&gt;<\/b> tags so that the extra\nlink doesn't actually become part of the post once <span class='nobr'>I do<\/span> integrate it with\nWordPress. (<span class='nobr'>I don't<\/span> want to just remove the link prior to posting, since\nI'd like to keep it there for when <span class='nobr'>I test<\/span> later edits.)\n\n<\/p>\n\n<h3>File Includes<\/h3>\n\n<p>[ <b>This documentation is correct and up to date, but the documentation has expanded\n    more quickly than my ability to organize it well, so my apologies for\n    the disorganized presentation<\/b> ]<\/p>\n\n<p>\nYou can include the contents of other files in your post file with the<\/p>\n\n<pre>\n   &lt;fbp_include: <i>filename<\/i>&gt;\n<\/pre>\n\n<p>directive. (The file is read from the same directory as other\nfile-based-post files)\n\n<\/p><p>\n\n\nAs a guard against an infinitely-recursive include, there is <span class='nobr'>a limit<\/span> to how\ndeep the include nesting can go (currently 8), which is wildly larger than\nwill ever be needed, <span class='nobr'>I think.<\/span>\n\n<\/p>\n\n<h4>&#8220;Include-once&#8221; Directive<\/h4>\n<p>\n\nI also use the include feature to include advertisements by Yahoo!. This is\nwhat <span class='nobr'>I put<\/span> in the post where <span class='nobr'>I want<\/span> the ads to appear:<\/p>\n\n<pre>\n   &lt;fbp_include <b>once<\/b>: ADS.html&gt;\n<\/pre>\n\n<p>Note the location of the colon -- it's easy to get in the wrong spot.<\/p>\n\n<p>The <b>ADS.html<\/b> file contains the call to Yahoo! to insert the ads. <span class='nobr'>I have only<\/span> one such call per post, but some pages (such as the blog home\npage) can display multiple posts. Since <span class='nobr'>I don't<\/span> want multiple ad calls, <span class='nobr'>I use the<\/span> <b>once<\/b> attribute to have only the first include actually\nhappen.\n\n<\/p><p>\n\nThe &#8220;abort if already included&#8221 check happens only with a\n&lt;fbp_include&gt; that has the <b>once<\/b> attribute. Even after\nincluding the file this way, <span class='nobr'>a subsequent<\/span> include without the <b>once<\/b>\nattribute does actually include the file, since it wasn't told to check.\n\n<\/p>\n<h4>Including one from among <span class='nobr'>a group<\/span> of files<\/h4>\n<p>\n\nLet's say that some posts want ads on the right (via Ads-Right.html), on\nthe left (Ads-Left.html), or as <span class='nobr'>a banner<\/span> (Ads-Top.html). Even if these\nfiles are included into each post with the <b>once<\/b> attribute, you'll\nstill get multiple includes when these includes are mixed and matched on\none page, since the filenames being included are distinct.\n\n<\/p><p>\n\nTo solve this problem, you must tell each &lt;fbp_include&gt; that the file\nbeing included is part of <span class='nobr'>a group.<\/span> This is done with the <b>radio<\/b>\nattribute (think &lt;input type='radio'&gt). Here's how the three includes\nmight appear:<\/p>\n\n<pre>\n  &lt;fbp_include once radio=ads: Ads-Left.html&gt;\n  &lt;fbp_include once radio=ads: Ads-Right.html&gt;\n  &lt;fbp_include once radio=ads: Ads-Top.html&gt;\n<\/pre>\n\n<p>The <b>radio=ads<\/b> tells the plugin to consider the name, for counting\npurposes, to be &#8220;ads&#8221;. Thus, only the first of the three will\nactually be included.\n\n<\/p><p>\n\nThe order of attributes (in this case <b>radio=ads<\/b> and <b>once<\/b>) is\nnot relevant.\n\n<\/p>\n<h4>Passing along variables with the include<\/h4>\n<p>\n\nAn included file may contain references such as<\/p>\n\n<pre>\n    &lt;fbp_var: <i>name<\/i>&gt;\n<\/pre>\n<p>or<\/p>\n<pre>\n    &lt;fbp_var default='<i>value<\/i>': <i>name<\/i>&gt;\n<\/pre>\n\n<p>These insert the value of the named variable, which itself had been set via\nsomething like:<\/p>\n\n<pre>\n   &lt;fbp_include once <b>set background = 'white'<\/b>: ADS.html&gt;\n<\/pre>\n\n\n<p>Note that no variables exist until you create them in a\n<b>&lt;fbp_include&gt;<\/b> directive.<\/p>\n\n<p>\nHere's a snippet from <b>ADS.html<\/b>:<\/p>\n\n<div style=\"border: 1px blue solid; width: 80%; margin-left: 4em; margin-top: 10px\">\n<pre>\n&lt;script language=\"JavaScript\"&gt;&lt;!--\n   :\n   :\nctxt_ad_bg = '<b>&lt;fbp_var default='CDCDCD': background&gt;<\/b>';\n   :\n   :\n\/\/ --&gt;&lt;\/script&gt;\n<\/pre>\n<\/div>\n\n<p>\n\nThe &lt;fbp_var&gt; directive is replaced by the value of the\n<b>background<\/b> variable, which was set to &#8220;white&#8221; in the\nabove &lt;fbp_include&gt; example. <span class='nobr'>If that variable<\/span> hadn't been set (such\nas by the simple call <b>&lt;fbp_include&nbsp;once:&nbsp;ADS.html&gt;<\/b>),\nthe default value <b>CDCDCD<\/b> is used. The <i>default<\/i> default is an\nempty string.\n\n<\/p><p>\n\nYou can also indicate that if <span class='nobr'>a variable<\/span> hasn't been set, use the value of\nanother variable (or the first from among <span class='nobr'>a list<\/span> of variables which has <span class='nobr'>a\nvalue<\/span>). This is done with the <b>fallback<\/b> attribute, which contains <span class='nobr'>a\ncomma<\/span>-separated list of variable names. <span class='nobr'>As a simple<\/span> (contrived) example,\nconsider an include to display an image. <span class='nobr'>It expects<\/span> that the <b>url<\/b> and\n<b>caption<\/b> variables be set, and, optionally, an <b>alt<\/b> variable\n(for the alt text):<\/p>\n\n<style type=\"text\/css\">\n  .var { background: #DCDCDC; color: black }\n<\/style>\n\n<pre>\n  &lt;img src<span>=<\/span>\"<span class='var'>&lt;fbp_var: url&gt;<\/span>\" alt=\"<span class='var'>&lt;fbp_var <b>fallback='caption,url'<\/b>: alt&gt;<\/span>\"&gt;\n  &lt;br\/&gt;\n  <span class='var'>&lt;fbp_var: caption&gt;<\/span>\n<\/pre>\n\n<p>In the request of for the <b>alt<\/b> variable, the\n<b>fallback='caption,url'<\/b> indicates that if <b>alt<\/b> has not been\ngiven <span class='nobr'>a value,<\/span> use the <b>caption<\/b> variable (if it has <span class='nobr'>a value<\/span>), or the\n<b>url<\/b> variable (if it has one).\n\n<\/p><p>\n\nIf the requested variable has no value, and none of the fallback variables\nhas <span class='nobr'>a value,<\/span> the default (via the <b>default<\/b> attribute) is used, or if\nno default, an empty string.\n\n<\/p><p>\n\nRegardless of how the value is derived, you can use the <b>doublequoted<\/b>\nattribute to cause any double quotes in the value to be replaced by\n&amp;quot;, which allows the value to be used within <span class='nobr'>a doublequoted<\/span> HTML\nattribute or JavaScript string. (The <b>alt<\/b> variable reference in the\nexample above really should use this. <span class='nobr'>You can use<\/span> <b>singlequoted<\/b>\nto have all single quotes replaced by &amp;#39;.\n\n<\/p><p>\n\nSee <a href=\"\/blog\/2005-10-30\/93\">this post<\/a> for an\nexample which uses <span class='nobr'>a lot<\/span> of this stuff (the incorporation of <a\nhref=\"http:\/\/yq.search.yahoo.com\/publisher\/index.html\">Y!Q<\/a> into my blog\nprose).\n\n<\/p><p>\n\nYou may have multiple <b>set<\/b> components to an include:<\/p>\n\n<pre>\n   &lt;fbp_include once <b>set background = 'white', set foreground = \"red\"<\/b>: ADS.html&gt;\n<\/pre>\n\n<p>Don't forget to repeat the &#8220;<b>set<\/b>&#8221; keyword for each\nvariable. <span class='nobr'>The comma<\/span> between the settings is optional, but helps make it\nread more easily.\n\n<\/p><p>\n\nCurrently, there's no way to set <span class='nobr'>a variable<\/span> outside of an\n&lt;fbp_include&gt; directive, nor <span class='nobr'>a way<\/span> to clear variables. <span class='nobr'>I can add<\/span>\nthese features if there's <span class='nobr'>a need<\/span> for them.\n\n<\/p>\n<h4>Other Include Options<\/h4>\n<p>\n\nIf you use the <b>raw<\/b> attribute with an include, the read file is\ninjected directly, without any parsing. (&lt;nopost&gt;, other includes,\nand variable references, for example, are not recognized.)\n\n<\/p><p>\n\nThe <b>cooked<\/b> include attribute is similar to <b>raw<\/b>, except that\nthe text is cooked for html ('&amp;' is replaced by '&amp;amp;', etc.).\n\n<\/p><p>\n\nThe <b>uncounted<\/b> include attribute indicates that the file is\nunconditionally included, but not counted as having been included (so that\n<span class='nobr'>a subsequent<\/span> include of the same file with the <b>once<\/b> attribute does\nsucceed). The <b>uncounted<\/b> attribute is particularly useful with\n<b>cooked<\/b>. (See <a href=\"\/blog\/2005-10-30\/93\">this\npost<\/a> for an example.)\n\n<\/p>\n<h3>Debugging<\/h3>\n<p>\n\nThere's a simple debugging mechanism built into this plugin. <span class='nobr'>On the options<\/span>\npage for this plugin (where the posts directory is configured), you can set\nthe ID of the post you wish to debug. When that number is set and you view\nthe post while logged in as someone allowed to edit the post, you'll see at\nthe top various messages.\n\n<\/p><p>\n\nFor example, consider my post on <a\nhref=\"\/blog\/2005-10-22\/88\">raising <span class='nobr'>a bilingual<\/span> child<\/a>,\nwhich is post #88 of my blog, after having entered\n&#8220;<tt>88<\/tt>&#8221; as the ID on the options page, <span class='nobr'>I see the<\/span>\nfollowing:\n\n<\/p>\n\n<div style=\"margin-left: 4em; margin-top: 10px\">\n\n  <div class=\"post_container\" style=\"width: 95%\">\n      <div class=\"post_header\">\n        <div class=\"post_title\">How To Raise <span class='nobr'>a Bilingual<\/span> Child<\/div>\n\n        <div class=\"post_timestamp\">\n          <span class=\"post_date\">October 22nd, 2005<\/span>\n          <span class=\"post_time\">5:38pm<\/span>\n          <span class=\"post_tz\">JST<\/span>\n        <\/div>\n      <\/div><div class=\"post_guts\">\n     <p>\n     <small>\n\n    [file-based-posts: about to inspect post #88 data in WordPress database]\n    <br\/>[file-based-posts: data begins:  <span style='background-color: #C0C0FF; color:black'><tt>FILE:<font color='red'>&middot;<\/font>bilingual.html<font color='red'>\\n<\/font><font color='red'>\\n<\/font>&lt;!--<font color='red'>\\n<\/font>***********************<\/tt><\/span>\n    <br\/>[file-based-posts: fbp_process_one_file(level is 1, file is &#8220;\/jfriedl\/blog\/posts\/bilingual.html&#8221;)]\n    <br\/>[file-based-posts: read 8972 bytes]\n    <br\/>[file-based-posts: include of 'ADS.html', option string 'once']\n    <br\/>[file-based-posts: include of ADS.html, option '<b>once<\/b>' has value '<b>1<\/b>']\n    <br\/>[file-based-posts: fbp_process_one_file(level is 2, file is &#8220;\/jfriedl\/blog\/posts\/ADS.html&#8221;)]\n    <br\/>[file-based-posts: read 409 bytes]\n    <br\/>[file-based-posts: new content for level 2 is 409 bytes]\n    <br\/>[file-based-posts: new content for level 1 is 9100 bytes]\n    <br\/>[file-based-posts: content has not changed; leaving WordPress database as is]\n    <\/small>\n    <\/p>\n    <hr\/>\n    <div class=\"img_right\"><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/asmile.jpg\" width=\"93\" height=\"132\"\nid=\"iasmile\"\/><\/div>\n\n    <p>\n\n    <a href=\"http:\/\/pic.regex.info\/anthony\">Anthony<\/a> turns three years old\n    tomorrow. He&#8217;s been talking up <span class='nobr'>a storm<\/span> for quite some time, but he&#8217;s behind\n    other kids his age. It&#8217;s not something we&#8217;re concerned about because, if\n    he&#8217;s got, say, 70% of the language skills as his peers, he&#8217;s really got\n    140% of the skills (70% English + 70% Japanese). <span class='nobr'>I know of<\/span> other kids who\n    have three or four languages &#8212; <span class='nobr'>a kid<\/span>&#8217;s brain is just amazing.\n    <\/p><p>\n    <i>blah blah blah.....<\/i>\n    <\/p>\n    <br clear=\"all\"\/>\n    <\/div><\/div>\n<\/div>\n\n<p>\n\nIf you set the debug ID to <tt>-1<\/tt> (minus one), debugging is turned on\nfor all posts.\n\n<\/p>\n\n<h3>Issues To Be Aware Of<\/h3>\n\n<ul>\n  <li><p>When configuring the directory for post-related files, be sure that\n       such files are editable by you, and readable by the web server.<\/p><\/li>\n\n  <li> <p>File updates are incorporated when the blog content is viewed (such\n       as by <span class='nobr'>a user<\/span> with <span class='nobr'>a browser,<\/span> or via <span class='nobr'>a full<\/span>-content RSS feed being pulled).\n       This provides for one small &#8220;gotcha&#8221; which you should be aware of: edits to\n       <span class='nobr'>a post<\/span> file do not become visible to WordPress's &#8220;Blog Search&#8221; feature\n       until the related post has been viewed. <span class='nobr'>In practice<\/span> this is <span class='nobr'>a minor<\/span> nit, as\n       you'll normally immediately view the post yourself to confirm that the\n       changes look okay.<\/p><\/li>\n\n  <li> <p>The &#8220;<b>FILE: my-next-post.html<\/b>&#8221; used to refer to each\n       post's filename becomes part of the post's content with respect to\n       WordPress's &#8220;Search&#8221; feature. Thus, for example, <span class='nobr'>a user<\/span> searching\n       for &#8220;file html&#8221; would see <b>all<\/b> your file-based posts and not\n       understand why.<\/p><\/li>\n\n  <li><p> If the &#8220;FILE:&#8221; line suddenly appears at the top of <span class='nobr'>a post<\/span> (when\n       viewing your blog as <span class='nobr'>a reader<\/span> would), it means that the post's file\n       was not accessible (either because it's been moved or removed, or\n       perhaps due to changed permissions). <span class='nobr'>In such cases<\/span>, the content that\n       had been most recently read from the file (and hence most-recently\n       saved in WordPress's database) is displayed, albeit along with the\n       &#8220;FILE:&#8221; line. (There is <span class='nobr'>a good<\/span> argument to be made that the &#8220;FILE:&#8221;\n       line should not be shown in this failure mode, but <span class='nobr'>I choose<\/span> to show\n       it simply as an easily-seen indication that there <i>is<\/i> <span class='nobr'>a\n       failure.<\/span>)<\/p>\n\n       <p>To help debug why you see the &#8220;FILE:&#8221;, see the <b>debugging<\/b> section above.<\/p><\/li>\n\n  <li><p> The <a href=\"\/blog\">author<\/a> is not particularly familiar\n       with WordPress's (convoluted and under-documented) internals.<\/p><\/li>\n\n<\/ul>\n\n<h3><a name=\"h\">Version History<\/a><\/h3>\n\n<table cellpadding=\"5\" cellspacing=\"0\" border=\"1\">\n\n<tr><th>Version<\/th><th>Release Date<\/th><th>Changes<\/th><\/tr>\n\n<tr valign=\"baseline\"><td>1.04<\/td><td>11-Nov-2005<\/td><td>Changed uses of &amp;apos; to &amp;#39;, since it seems\nthat IE doesn't support &amp;apos. Sighh.<\/td><\/tr>\n\n<tr valign=\"baseline\"><td>1.03<\/td><td>30-Oct-2005<\/td><td>Added the <b>radio<\/b>, <b>raw<\/b>, <b>cooked<\/b>, and <b>uncounted<\/b> attributes to &lt;fbp_include&gt;\n<br\/>\nAdded the <b>fallback<\/b>, <b>singlequoted<\/b>, and <b>doublequoted<\/b> attributes to &lt;fbp_var&gt;.\n\n<\/td><\/tr>\n\n<tr valign=\"baseline\"><td>1.02<\/td><td>29-Oct-2005<\/td><td>Added &lt;fbp_include&gt; and &lt;fbp_var&gt; directives.\n<br\/>\nAllowed a debugging id of <tt>-1<\/tt> to mean &#8220;debug all posts&#8221;\n<\/td><\/tr>\n\n<tr valign=\"baseline\"><td>1.01<\/td><td>24-Sep-2005<\/td><td>Made debugging messages invisible except to logged-in users who are allowed to edit the post. That way, random readers don't see your debugging cruft.\n<\/td><\/tr>\n\n<tr valign=\"baseline\"><td>1.00<\/td><td>15-Sep-2005<\/td><td>Initial release<\/td><\/tr>\n<\/table>\n\n\n\n\n<p>Feedback appreciated, via a comment below, or via <a href=\"mailto:jfriedl@yahoo.com\">email<\/a>.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p> I much prefer to compose and edit text with my favorite text editor, rather than in a &lt;textarea&gt; box on a web page. Thus, I created the 'file-based posts' plugin for WordPress, which allows you to maintain the body of a post in a file on the local web-server host. Changes to the file are reflected immediately on the blog site. <\/p> Executive Summary Install this plugin (download here and install as \"<b>file-based-posts.php<\/b>\" in your <b>wp-content\/plugins<\/b> directory). On the newly-available \"File-Based Posts\" tab of the \"Options\" blog admin page, configure the directory in which post files will go. (Be [...]","protected":false},"author":1,"featured_media":0,"parent":51,"menu_order":2,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/71"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/71\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/51"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}