Using a .NET assembly (DLL) with Test Complete 7.52
There are two steps to adding and using a .NET dll to your automated suite. First you must add a reference that tells your script where to find the dll and second you need to call the method in your .NET dll. Read on or download the PDF at the bottom of this post. It is real simple!
Wordpress 3.0 and add_action
It seems as though, with Wordpress 3.0, the add_action function (in some cases) has become a little more strict. Tag Grouping has a call to save_post that worked perfectly in Wordpress 2.9 and up but broke completely once Wordpress 3.0 came out. After some research I found that you needed to pass in an array instead of just your function. The array I used consisted of a reference to the class containing the function I was going to use along with the function name, see below:
add_action ( 'save_post', Array(&$update, 'update_group_posts') );
Prior to Wordpress 3.0 this same call looked like:
add_action ( 'save_post', 'update_group_posts' );
What I had to do in order to make this Wordpress 3.0 compatible was wrap the functions I needed in a class. Instantiate that class inside the Main function of my plugin and then pass that instantiated name along with the function name to the save_post action.
Wordpress Admin Page without a link on the sidebar.
Recently I wanted to create some pages that I could link to from within the administration page of a new plug-in I am creating...without them showing up on the sidebar pane. You see, I have a new item I want to place in the Posts Admin section that requires multiple pages. It would look real ugly if all of the pages were listed in the sidebar. I could create my own area and list all of the pages underneath the area heading but that seemed like a little much. This plug-in fits in the Posts section and really not in it's own area.
I had some difficulty figuring out how to create pages that did not show up in the sidebar. The answer was so simple that I was somewhat disappointed it took me so long to come to it. In case any of you are struggling to do the same maybe this will help.
Update to Tag Grouping for Wordpress 3.0
Just a note to everyone that I have corrected the issue in Tag Grouping that caused an error while saving posts using Wordpress 3.0. Please also note that I have not built support for the new multi-site functionality in this version.
You can get the latest version at Wordpress.org/Tag Grouping.
Thanks again for all the feedback!
Increase your VMWare Virtual Hard Drive’s Disk Space
So, today, I had to create a new VM image of Windows 7 at work because nobody had gotten around to it yet. No problem, its a quick thing to do. Only, I forgot to size the HD large enough and ended up with a 16 GB HD instead of a 100 GB HD. Big difference. At first, I thought I could just change the HD size through the VM settings on VMWare. No luck, that must be Virtual PC or some other virtualization software I have used in the past. Nope, I'd have to do it a different way. Google, here I come.
Adding AJAX to your Wordpress plug-in
AJAX is a great way to add some ease of use functionality to your plugin by updating part of a page based on user input. I use it for updating a list of checkboxes in the example below when a user changes the value of a dropdown.
Firstly, you will need to add an action handler that will launch/fire your AJAX. Below is an example taken from my plug-in, Tag Grouping.
add_action ( 'wp_ajax_my-special-action', 'displayDivwithExistingTags' );First parameter: An internal tag that you will use to reference this action.
- "wp_ajax_" is appended to the front of your tag.Second parameter: The name of the function that the action will call when it is called.
(see WordPress's official add_action page for more details.)
Tag Grouping V1.2 & v1.3!
Sorry for the lack of posting lately but I have been busily searching for a new job as my current employer is in the process of going belly up.
Over the week and this weekend, I made a couple of minor changes to the "Tag Grouping" that, in many ways, will end up being rather large. Mainly because this was my first 2 experiences using AJAX and i am in love. I will rely heavily on AJAX for version 2 of the plugin when it comes time to create the management interface.
Anyway, back on topic. For version 1.2 and version 1.3 I have added functionality to the "Edit Groups" page that will list out tags that are already selected for a group as they are picked from the dropdown. Version 1.3 expands on that and checks the checkboxes for the list of tags already selected. This way there will be no more re-enabling each tag when you are editting a group.
Next on my plan:
Create a mechanism that will allow a user to click anywhere in the row of a tag to enable/disable a checkbox. This should make it easier for users to modify their lists.
For the most recent "Tag Grouping" plugin, click the Download link.
Messaging for your Wordpress Plugin.
Ever wonder how the yellow Completed and red Error messages are generated in Wordpress? Well, it's really quite simple.
For Informational messages, just add:
The id of message and the class of updated fade will land the message in the appropriate spot on the page, which is typically right below the heading of the page.
For error messages, just add:
The id and class of error will land the message in the appropriate spot on the page, which is typically right below the heading of the page.
Just enclose your text inside of the div and pass it through when the proper events have occurred. Simple.
Add JavaScript to your Wordpress plugin.
Instead of putting your javascript in-line with the rest of your html, it is recommended that you use the WordPress API to add the scripts in a managed way. I experienced this recently while developing the Tag Grouping plug-in. Before this, I had the same JavaScript in 3 different places in my plug-in and after employing the steps below I was able to move it into 1 file that all dependant files could access.
Tag Grouping v1.1 – Beta out!
I just posted the new version of Tag Grouping to WordPress that includes the function that a few of you were asking for...the ability to paste a string of tags into the group creation and group edit screens. This should make adding tags much easier than previous versions where you were forced to click checkboxes.
As always, please send me your feedback and suggestions!
For the most recent "Tag Grouping" plugin, click the Download link.
Pages
Categories
- Automation
- C#
- Code Sample
- Excel/VBA Script
- HTML
- Java
- MS-SQL
- MySQL
- PHP
- Silk Performer
- Tag Group Plug-in
- Test Complete
- Uncategorized
- Virtualization
- VMWare
- Wordpress