Created
April 2, 2020 19:54
-
-
Save niamrox/ce3ff1e507666e0bbb99857538670cba to your computer and use it in GitHub Desktop.
WordPress Live Template For PhpStrom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<templateSet group="WordPress"> | |
<template name="act" value="add_action( '$HOOK$', array( $this, '$FUNCTION$' ) ); $END$" description="add_action OOP WordPress" toReformat="true" toShortenFQNames="true"> | |
<variable name="HOOK" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FUNCTION" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="actp" value="add_action( '$HOOK$', array( $this, '$FUNCTION$' ) ); $END$" description="add_action procedural WordPress" toReformat="true" toShortenFQNames="true"> | |
<variable name="HOOK" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FUNCTION" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="fil" value="add_filter( '$HOOK$', array( $this, '$FUNCTION$' ), 10 ); $END$" description="add_filter OOP WordPress" toReformat="true" toShortenFQNames="true"> | |
<variable name="HOOK" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FUNCTION" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="filp" value="add_filter( '$HOOK$', '$FUNCTION$', 10 ); $END$" description="add_filter procedural WordPress" toReformat="true" toShortenFQNames="true"> | |
<variable name="HOOK" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FUNCTION" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="php" value="<?php $END$ ?>" description="php tags with a new line" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="phpfor" value="<?php for ( $EXP1$; $EXP2$; $EXP3$ ) : ?> $END$ <?php endfor; ?> " description="<?php for...endfor; ?>" toReformat="true" toShortenFQNames="true"> | |
<variable name="EXP1" expression="phpVar" defaultValue=""$i=0"" alwaysStopAt="true" /> | |
<variable name="EXP2" expression="" defaultValue=""$i<10"" alwaysStopAt="true" /> | |
<variable name="EXP3" expression="" defaultValue=""$i++"" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="phpfore" value="<?php foreach ( $ITERABLE$ as $VAR_VALUE$ ) : ?> $END$ <?php endforeach; ?> " description="<?php foreach...endforeach; ?>" toReformat="true" toShortenFQNames="true"> | |
<variable name="ITERABLE" expression="phpVar" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VAR_VALUE" expression="phpSuggestVariableName()" defaultValue=""$item"" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="phpif" value="<?php if ( $COND$ ) : ?> $END$ <?php endif; ?> " description="<?php if... ?>" toReformat="true" toShortenFQNames="true"> | |
<variable name="COND" expression="phpSuggestVariableName()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="phpife" value="<?php if ( $COND$ ) : ?> $END$	 <?php else : ?> <?php endif; ?> " description="<?php if...endif; ?>" toReformat="true" toShortenFQNames="true"> | |
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="phpwil" value="<?php while( $COND$ ) : ?> $END$ <?php endwhile; ?> " description="<?php while...endwile; ?>" toReformat="true" toShortenFQNames="true"> | |
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="tt" value="__('$TEXT$','$TEXTDOMAIN$'); $END$" description="__('text','textdomain')" toReformat="true" toShortenFQNames="true"> | |
<variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="TEXTDOMAIN" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="tte" value="_e('$TEXT$','$TEXTDOMAIN$'); $END$ " description="_e('text','textdomain')" toReformat="true" toShortenFQNames="true"> | |
<variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="TEXTDOMAIN" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="wpcont" value="<?php the_content(); ?>" description="the_content with php tags" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="wpexce" value="<?php the_excerpt(); ?>" description="the_excerpt with php tags" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="wplink" value="<?php the_permalink(); ?>" description="the_permalink with php tags" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="wploop" value="<?php if(have_posts()) :?> 	<?php while(have_posts()) : the_post();?> 		$END$ 	<?php endwhile;?> <?php else :?> 	 <?php endif;?>" description="wodpress loop with php tags" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="wptitle" value="<?php the_title(); ?>" description="the_title with php tags" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="aa" value="add_action( '$hook$', '$callback$' ); $END$" description="add_action" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="aam" value="add_action( '$hook$', array( $class$, '$method$' ) );$END$" description="add_action > method" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression=""$this"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="method" expression="hook" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="afm" value="add_filter( '$hook$', array( $class$, '$method$' ) );$END$" description="add_filter > method" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression=""$this"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="method" expression="hook" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="ea" value="esc_attr( $SELECTION$ )" description="esc_attr" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="wpa" value="$$$args$ = wp_parse_args( $$$source$, array( 	$key$ => $value$, ) );" description="wp_parse_args" toReformat="true" toShortenFQNames="true"> | |
<variable name="args" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="source" expression="args" defaultValue="" alwaysStopAt="true" /> | |
<variable name="key" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="value" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="af" value="add_filter( '$hook$', '$callback$' ); $END$" description="add_filter" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="__" value="__( $SELECTION$, '$textdomain$' )" description="__" toReformat="false" toShortenFQNames="true"> | |
<variable name="textdomain" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="aafu" value="add_action( '$hook$', function () { 	$END$ } );" description="add_action > closure" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="rpt" value="register_post_type( '$SLUG$', array( 	'description' => '$DESCRIPTION$', 	'labels' => array( 		'name' => _x( '$PLURAL$', 'post type general name', '$DOMAIN$' ), 		'singular_name' => _x( '$SINGULAR$', 'post type singular name', '$DOMAIN$' ), 		'menu_name' => _x( '$PLURAL$', 'admin menu', '$DOMAIN$' ), 		'name_admin_bar' => _x( '$SINGULAR$', 'add new $SLUG$ on admin bar', '$DOMAIN$' ), 		'add_new' => _x( 'Add New', 'post_type', '$DOMAIN$' ), 		'add_new_item' => __( 'Add New $SINGULAR$', '$DOMAIN$' ), 		'edit_item' => __( 'Edit $SINGULAR$', '$DOMAIN$' ), 		'new_item' => __( 'New $SINGULAR$', '$DOMAIN$' ), 		'view_item' => __( 'View $SINGULAR$', '$DOMAIN$' ), 		'search_items' => __( 'Search $PLURAL$', '$DOMAIN$' ), 		'not_found' => __( 'No $PLURALLOWERCASE$ found.', '$DOMAIN$' ), 		'not_found_in_trash' => __( 'No $PLURALLOWERCASE$ found in Trash.', '$DOMAIN$' ), 		'parent_item_colon' => __( 'Parent $SINGULAR$:', '$DOMAIN$' ), 		'all_items' => __( 'All $PLURAL$', '$DOMAIN$' ), 	), 	'public' => $PUBLIC$, 	'hierarchical' => $HIERARCHICAL$, 	'exclude_from_search' => $NOSEARCH$, 	'publicly_queryable' => $QUERYABLE$, 	'show_ui' => $UI$, 	'show_in_menu' => $MENU$, 	'show_in_nav_menus' => $NAVMENU$, 	'show_in_admin_bar' => $ADMINBAR$, 	'menu_position' => $MENUPOS$, 	'menu_icon' => $ICON$, 	'capability_type' => '$CAPABILITY$', 	'capabilities' => array(), 	'map_meta_cap' => null, 	'supports' => array( 'title', 'editor' ), 	'register_meta_box_cb' => $METABOX$, 	'taxonomies' => array(), 	'has_archive' => $ARCHIVE$, 	'rewrite' => array( 		'slug' => '$SLUG$', 		'with_front' => $WITHFRONT$, 		'feeds' => $FEEDS$, 		'pages' => $PAGES$, 	), 	'query_var' => $QUERYVAR$, 	'can_export' => $EXPORT$, ) ); $END$" description="register_post_type" toReformat="true" toShortenFQNames="true"> | |
<variable name="SLUG" expression="" defaultValue=""post-type"" alwaysStopAt="true" /> | |
<variable name="DESCRIPTION" expression="" defaultValue="""" alwaysStopAt="true" /> | |
<variable name="PLURAL" expression="" defaultValue=""Posts"" alwaysStopAt="true" /> | |
<variable name="SINGULAR" expression="" defaultValue=""Post"" alwaysStopAt="true" /> | |
<variable name="DOMAIN" expression="" defaultValue=""text-domain"" alwaysStopAt="true" /> | |
<variable name="PLURALLOWERCASE" expression="decapitalize(PLURAL)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="PUBLIC" expression="enum("false", "true")" defaultValue=""false"" alwaysStopAt="true" /> | |
<variable name="HIERARCHICAL" expression="enum("false", "true")" defaultValue=""false"" alwaysStopAt="true" /> | |
<variable name="NOSEARCH" expression="enum("true","false")" defaultValue=""true"" alwaysStopAt="true" /> | |
<variable name="QUERYABLE" expression="" defaultValue="PUBLIC" alwaysStopAt="false" /> | |
<variable name="UI" expression="" defaultValue="PUBLIC" alwaysStopAt="false" /> | |
<variable name="MENU" expression="" defaultValue="UI" alwaysStopAt="false" /> | |
<variable name="NAVMENU" expression="" defaultValue="PUBLIC" alwaysStopAt="false" /> | |
<variable name="ADMINBAR" expression="" defaultValue="MENU" alwaysStopAt="false" /> | |
<variable name="MENUPOS" expression="enum("null","5","10","15","20","25","60","65","70","75","80","100")" defaultValue="null" alwaysStopAt="true" /> | |
<variable name="ICON" expression="" defaultValue=""null"" alwaysStopAt="true" /> | |
<variable name="CAPABILITY" expression="" defaultValue=""post"" alwaysStopAt="true" /> | |
<variable name="METABOX" expression="" defaultValue=""null"" alwaysStopAt="true" /> | |
<variable name="ARCHIVE" expression="" defaultValue=""false"" alwaysStopAt="true" /> | |
<variable name="WITHFRONT" expression="enum("true","false")" defaultValue=""true"" alwaysStopAt="true" /> | |
<variable name="FEEDS" expression="" defaultValue="ARCHIVE" alwaysStopAt="false" /> | |
<variable name="PAGES" expression="enum("true","false")" defaultValue=""true"" alwaysStopAt="true" /> | |
<variable name="QUERYVAR" expression="" defaultValue=""true"" alwaysStopAt="true" /> | |
<variable name="EXPORT" expression="enum("true","false")" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="rt" value="register_taxonomy( '$SLUG$', array($OBJECT$), array( 	'description' => '$DESCRIPTION$', 	'labels' => array( 		'name' => _x( '$PLURAL$', 'taxonomy general name', '$DOMAIN$' ), 		'singular_name' => _x( '$SINGULAR$', 'taxonomy singular name', '$DOMAIN$' ), 		'search_items' => __( 'Search $PLURAL$', '$DOMAIN$' ), 		'popular_items' => __( 'Popular $PLURAL$', '$DOMAIN$' ), 		'all_items' => __( 'All $PLURAL$', '$DOMAIN$' ), 		'parent_item' => __( 'Parent $SINGULAR$', '$DOMAIN$' ), 		'parent_item_colon' => __( 'Parent $SINGULAR$:', '$DOMAIN$' ), 		'edit_item' => __( 'Edit $SINGULAR$', '$DOMAIN$' ), 		'view_item' => __( 'View $SINGULAR$', '$DOMAIN$' ), 		'update_item' => __( 'Update $SINGULAR$', '$DOMAIN$' ), 		'add_new_item' => __( 'Add New $SINGULAR$', '$DOMAIN$' ), 		'new_item_name' => __( 'New $SINGULAR$ Name', '$DOMAIN$' ), 		'separate_items_with_commas' => __( 'Separate $PLURALLOWERCASE$ with commas', '$DOMAIN$' ), 		'add_or_remove_items' => __( 'Add or remove $PLURALLOWERCASE$', '$DOMAIN$' ), 		'choose_from_most_used' => __( 'Choose from the most used $PLURALLOWERCASE$', '$DOMAIN$' ), 		'not_found' => __( 'No $PLURALLOWERCASE$ found.', '$DOMAIN$' ), 	), 	'public' => $PUBLIC$, 	'show_ui' => $UI$, 	'show_in_nav_menus' => $MENU$, 	'show_tagcloud' => $TAGCLOUD$, 	'meta_box_cb' => $METABOX$, 	'show_admin_column' => $ADMINCOLUMN$, 	'hierarchical' => $HIERARCHICAL$, 	'query_var' => '$QUERYVAR$', 	'rewrite' => array( 		'slug' => '$REWRITESLUG$', 		'with_front' => $REWRITEFRONT$, 		'hierarchical' => $REWRITEHIERARCHICAL$, 	), 	'capabilities' => array(), ) );" description="register_taxonomy" toReformat="true" toShortenFQNames="true"> | |
<variable name="SLUG" expression="" defaultValue=""taxonomy"" alwaysStopAt="true" /> | |
<variable name="OBJECT" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="DESCRIPTION" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="PLURAL" expression="" defaultValue=""Tags"" alwaysStopAt="true" /> | |
<variable name="SINGULAR" expression="" defaultValue=""Tag"" alwaysStopAt="true" /> | |
<variable name="DOMAIN" expression="" defaultValue=""text-domain"" alwaysStopAt="true" /> | |
<variable name="PLURALLOWERCASE" expression="decapitalize(PLURAL)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="PUBLIC" expression="enum("true","false")" defaultValue=""true"" alwaysStopAt="true" /> | |
<variable name="UI" expression="" defaultValue="PUBLIC" alwaysStopAt="false" /> | |
<variable name="MENU" expression="" defaultValue="PUBLIC" alwaysStopAt="false" /> | |
<variable name="TAGCLOUD" expression="" defaultValue="UI" alwaysStopAt="false" /> | |
<variable name="METABOX" expression="" defaultValue=""null"" alwaysStopAt="true" /> | |
<variable name="ADMINCOLUMN" expression="enum("false","true")" defaultValue="false" alwaysStopAt="true" /> | |
<variable name="HIERARCHICAL" expression="enum("false","true")" defaultValue="false" alwaysStopAt="true" /> | |
<variable name="QUERYVAR" expression="" defaultValue="SLUG" alwaysStopAt="true" /> | |
<variable name="REWRITESLUG" expression="" defaultValue="SLUG" alwaysStopAt="true" /> | |
<variable name="REWRITEFRONT" expression="enum("true","false")" defaultValue="true" alwaysStopAt="true" /> | |
<variable name="REWRITEHIERARCHICAL" expression="enum("true","false")" defaultValue="true" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="aaf" value="function $method$( $$$var$ ) { 	$END$ } add_action( '$hook$', '$method$' );" description="add_action > function" toReformat="true" toShortenFQNames="true"> | |
<variable name="method" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="var" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="eh" value="esc_html( $SELECTION$ )" description="esc_html" toReformat="false" toShortenFQNames="true" /> | |
<template name="gp" value="get_posts( array( 'post_type' => '$posttype$', 'posts_per_page' => $number$ ));" description="get_posts" toReformat="true" toShortenFQNames="true"> | |
<variable name="posttype" expression="" defaultValue=""post"" alwaysStopAt="true" /> | |
<variable name="number" expression="" defaultValue=""-1"" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="loop" value="if ( have_posts() ) { 	while ( have_posts() ) { 		the_post(); 		$END$ 	} }" description="The Loop" toReformat="false" toShortenFQNames="true" /> | |
<template name="wq" value="$query = new WP_Query( array( )); while ( $query->have_posts() ) { 	$query1->the_post(); 	echo '<li>' . get_the_title() . '</li>'; }" description="WP_Query" toReformat="false" toShortenFQNames="true" /> | |
</templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go to preference > Tools > Settings Repository and click add then add https://gist.github.com/niamrox/ce3ff1e507666e0bbb99857538670cba and click auto sync