Home Download Buy Blog Forum Support

PHP AutoComplete Workflow ins ST2

PHP AutoComplete Workflow ins ST2

Postby protechig on Thu May 23, 2013 12:35 am

I'm a WordPress developer who is trying to use Sublime Text 2 to speed up my workflow. There are a few packages that allow me to autocomplete WordPress functions. A typical file is structured like this:

Code: Select all
<?php
/**
* The custom portfolio post type archive template
*/

/** Force full width content layout */
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

/** Remove the breadcrumb navigation */
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

/** Remove the post info function */
remove_action( 'genesis_before_post_title', 'genesis_post_info' );

/** Remove the post content */
remove_action( 'genesis_post_content', 'genesis_do_post_content' );

/** Remove the post image */
remove_action( 'genesis_post_content', 'genesis_do_post_image' );

/** Add the featured image after post title */
add_action( 'genesis_post_title', 'executive_portfolio_grid' );
function executive_portfolio_grid() {
   if ( has_post_thumbnail() ){
      echo '<div class="portfolio-featured-image">';
      echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
      echo get_the_post_thumbnail($thumbnail->ID, 'portfolio' );
      echo '</a>';
      echo '</div>';
   }
}

/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );

genesis();


For the autocomplete to work there needs to be a closing PHP bracket
Code: Select all
?>
in order for the autocomplete to work properly, yet it isn't considered a best practice in WordPress or in PHP coding in general. Is there any way to work around this yet still get autocomplete?

Thanks
Zach
protechig
 
Posts: 2
Joined: Thu May 23, 2013 12:31 am

Re: PHP AutoComplete Workflow ins ST2

Postby Fed03 on Thu May 23, 2013 10:07 am

protechig wrote:......
For the autocomplete to work there needs to be a closing PHP bracket
Code: Select all
?>
in order for the autocomplete to work properly, yet it isn't considered a best practice in WordPress or in PHP coding in general. Is there any way to work around this yet still get autocomplete?

Thanks
Zach


u're right, hope in an answer from jon^
Fed03
 
Posts: 79
Joined: Sun Oct 16, 2011 6:38 pm

Re: PHP AutoComplete Workflow ins ST2

Postby protechig on Fri May 24, 2013 4:01 am

Anyone else have an idea?
protechig
 
Posts: 2
Joined: Thu May 23, 2013 12:31 am

Re: PHP AutoComplete Workflow ins ST2

Postby BomBin on Sat Sep 21, 2013 6:44 pm

Add the following line to your settings file:
Code: Select all
"auto_complete_selector": "source, text",
BomBin
 
Posts: 18
Joined: Sat Dec 24, 2011 8:12 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 17 guests