XenWord 2.0 is a major rewrite of the backend of the plugin. The original intent was to use the WordPress Plugin Boilerplate as the foundation. However, I was reading about different option frameworks and watched a video of the Redux Framework. I became intrigued and within hours the new release included the admin portion of the Redux Framework to enhance the backend options and settings panel. The speed of producing an options setting panel impressed me so much that I continued working on it this evening.
As a backdrop, most of the morning was spent learning the configuration file, installing the admin portion into the XenWord plugin, and getting a general feel for the framework. Tonight I was able to connect the xf_rel_path option and get the local site loading properly.
Here is a screenshot of the new ‘relative path’ text box for XenWord 2.0.
I particularly love that examples are much clearer in this layout. The framework includes setting up help areas but I have not looked at that code. Help blocks might help too.
The code is actually straight forward. Here is a sample of the section for the relative path.
[code] $this->sections[] = array(‘icon’ => ‘el-icon-website’,
‘title’ => __(‘Relative Path’, ‘xf_options’),
‘desc’ => ‘XenForo and WordPress must be on the same physical server as well as use the same domain name.’ ,
‘fields’ => array(
array(
‘id’ => ‘xf_rel_path’,
‘type’ => ‘text’,
‘title’ => __(‘Enter the location of the XenForo installation’, ‘xf_options’),
‘desc’ => __(‘This location must be relative to the WordPress installation.
<p><h3>Example 1:</h3>
WordPress in root and XenForo in domain.com/community<br />
Enter /community<br />
</p>
<p><h3>Example 2:</h3>
WordPress in directory /blog and XenForo in domain.com/community<br />
Enter ../community<br />
</p>
‘, ‘xf_options’),
‘default’ => ‘/community’,
),
)
);
[/code]