gipetto / wordpress.tmbundle Goto Github PK
View Code? Open in Web Editor NEWA WordPress focused TextMate bundle to rule all WordPress Textmate bundles.
Home Page: http://gipetto.github.com/wordpress.tmbundle/
A WordPress focused TextMate bundle to rule all WordPress Textmate bundles.
Home Page: http://gipetto.github.com/wordpress.tmbundle/
Time to break out the rolled up newspaper.
One useful feature of WordPress' Trac instance is browsing a nice, syntax highlighted copy of the code. I find it handy to link to things during IRC and IM conversations, and in emails. I've written a command which opens the current file and line number in Trac. For example, here's a link to the wp_update_post
function in Trac:
http://core.trac.wordpress.org/browser/trunk//wp-includes/post.php#L2651
The commit for the command is here:
Some questions, if you have a moment:
TM_PROJECT_DIRECTORY
is equivalent to WordPress' root dir โ is there any way I can read the Path to WordPress preference into my command?Cheers,
Simon
First of all, thank you for this awesome bundle! It makes learning WP theme development much easier.
I do have a slight problem; whenever I tab after typing bloginfo, I get something like this: /tmp/temp_textmate.6FAEts:6:in . The string changes every time I try it, the only part that remains the same is /tmp/temp_textmate.[changes]:6:in .
I tried to search for an solution, but couldn't find any. Some help will be appreciated and thanks in advance!
When I try to "Go to function" I'm getting the following error:
/tmp/temp_textmate.Inu6cY:in `require': no such file to load -- /Users/simon/Library/Application Support/TextMate/Bundles/WordPress.tmbundle/Support/common.rb (LoadError) from /tmp/temp_textmate.Inu6cY:2
Since this morning, when it was working, I've edited the plugin_head snippet and added my own plugin_base snippet.
If I delete and reinstall, it starts working. If I re-add the snippets, it starts working!
Any ideas?
Thanks in advance.
S
It gives a lengthy and nasty error message. Needs to be fixed.
Hi,
Here's a suggested change to the widget template, which adds PHPDoc comments.
S
/**
* new WordPress Widget format
* Wordpress 2.8 and above
* @see http://codex.wordpress.org/Widgets_API#Developing_Widgets
*/
class PREFIX_Name_Widget extends WP_Widget {
/**
* Constructor
*
* @return void
**/
function PREFIX_Name_Widget() {
$widget_ops = array(
'classname' => 'CSS class name',
'description' => 'Description'
);
$this->WP_Widget( 'CSS class name', 'Title', $widget_ops );
}
/**
* Outputs the HTML for this widget.
*
* @param array $args An array of standard parameters for widgets in this theme
* @param array $instance An array of settings for this widget instance
* @return void Echoes it's output
**/
function widget( $args, $instance ) {
extract( $args, EXTR_SKIP );
echo $before_widget;
echo $before_title;
echo 'Title'; // Can set this with a widget option, or omit altogether
echo $after_title;
//
// Widget display logic goes here
//
echo $after_widget;
}
/**
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
*
* @param array $new_instance An array of new settings as submitted by the admin
* @param array $old_instance An array of the previous settings
* @return array The validated and (if necessary) amended settings
**/
function update( $new_instance, $old_instance ) {
// update logic goes here
$updated_instance = $new_instance;
return $updated_instance;
}
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
* @param array $instance An array of the current settings for this widget
* @return void Echoes it's output
**/
function form( $instance ) {
// Set defaults for the widget
$instance = wp_parse_args( (array) $instance, array( array of option_name => value pairs ) );
// display field names here using:
// $this->get_field_id('option_name') - the CSS ID
// $this->get_field_name('option_name') - the HTML name
// $instance['option_name'] - the option value
}
}
add_action( 'widgets_init', create_function( '', "register_widget('PREFIX_Name_Widget');" ) );
Corrected publically_queryable
to publicly_queryable
and added localisation domains to __
function calls.
You can grab them from simonwheatley@f623e53 if you like.
Cheers,
Simon
The Cmd+Shift+Opt+H shortcut to look up WP functions is something I do all day, every day. Obviously needs updating for WP 3.2.
I have no idea how you build this. Anything I can do to help?
Wouldn't this be nice:
my text string
) and hit a key combo_e('my text string', '')
.This suggestion adds a GPL block thingy, and the Site Wide Only "tag" in the head:
/*
Plugin Name: ${1:Plugin Name}
Plugin URI: ${2:${TM_HOMEPAGE:http://example.com/}}
Description: ${3:Description}
${4:Site Wide Only: ${5:true}}
Version: ${6:0.1}
Author: ${7:${TM_NAME:Your Name}}
Author URI: ${8:${TM_HOMEPAGE:http://example.com/}}
*/
${9:/* Copyright ${10:2010} ${11:Your Name}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/}
$0
Add a meta_box shortcut to put in a skeleton snippet for adding a meta box to a post/page edit screen.
ie: get_($user_id);
Hitting tab next to get_ will start the function lookup, but the return will write a double set of parens. Either erase current parens or don't export a parens in this scenario.
Don't know which way to go yet.
How about a "Jump to action/filter" similar to the "jump to function" feature?
S
The const-> tab trigger doesn't seem to be working.
The __ tab trigger produces this:
__('', true);
but it should probably produce something like:
__(string text, string domain)
or
__('', 'domain')
with a stop inside the '' for the domain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.