Skip to content

Instantly share code, notes, and snippets.

@nashvillegeek
Created June 18, 2013 21:17
Show Gist options
  • Save nashvillegeek/5809475 to your computer and use it in GitHub Desktop.
Save nashvillegeek/5809475 to your computer and use it in GitHub Desktop.
Wordpress post-2-post function Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
//post 2 post connections for ${1:post_type_1}_to_${2:post_type_2}
function ${1:post_type_1}_to_${2:post_type_2}() {
p2p_register_connection_type( array(
'name' => '${1:post_type_1}-to-${2:post_type_2}',
'from' => '${1:post_type_1}',
'to' => '${2:post_type_2}'
) );
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>p2p-function</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment