-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWP-Functions-Completions.sublime-completions
35 lines (35 loc) · 3.49 KB
/
WP-Functions-Completions.sublime-completions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
"scope": "source.php - variable.other.php",
"comment": "WP Functions",
"completions":
[
{"trigger": "carbon_get_theme_option", "contents": "carbon_get_theme_option( 'crb_${1:}' );"},
{"trigger": "carbon_get_the_post_meta", "contents": "carbon_get_the_post_meta( 'crb_${1:}' );"},
{"trigger": "carbon_get_post_meta", "contents": "carbon_get_post_meta( ${1:\\$post_id}, 'crb_${2:}' );"},
{"trigger": "carbon_get_term_meta", "contents": "carbon_get_term_meta( ${1:\\$term_id}, 'crb_${2:}' )"},
{"trigger": "carbon_get_user_meta", "contents": "carbon_get_user_meta( ${1:\\$user_id}, 'crb_${2:}' )"},
{"trigger": "carbon_get_comment_meta", "contents": "carbon_get_comment_meta( ${1:\\$comment_id}, 'crb_${2:}' )"},
{"trigger": "Field", "contents": "Field::make( 'text', 'title', __( 'Title', 'crb' ) ),"},
{"trigger": "FieldC", "contents": "Field::make( 'rich_text', 'content', __( 'Content', 'crb' ) ),"},
{"trigger": "FieldI", "contents": "Field::make( 'image', '${1:image}', __( '${1:Image}', 'crb' ) )\n\t->help_text( crb_get_attachment_help( '${2:crb_image_size}' ) ),"},
{"trigger": "FieldN", "contents": "Field::make( 'text', '${1:number}', __( '${2:Number}', 'crb' ) )\n\t->set_attribute( 'type', 'number' )\n\t->set_attribute( 'min', '1' )\n\t->set_attribute( 'max', '100' )\n\t->set_attribute( 'step', '1' )\n\t->set_attribute( 'pattern', '[0-9]*' )\n\t->set_default_value( '3' ),"},
{"trigger": "help_text", "contents": "help_text( __( '${1:You can use the shortcode [year] to display the current year.}', 'crb' ) )"},
{"trigger": "help_text_year", "contents": "help_text( __( '${1:You can use the shortcode [year] to display the current year.}', 'crb' ) )"},
{"trigger": "help_text_attachment", "contents": "help_text( crb_get_attachment_help( '${1:crb_image_size}' ) )"},
{"trigger": "help_text_video", "contents": "help_text( __( '${1:You can use any YouTube or Vimeo video URL, for example: https://www.youtube.com/watch?v=OCWj5xgu5Ng or http://vimeo.com/87110435}', 'crb' ) )"},
{"trigger": "help_text_integer", "contents": "help_text( __( '${1:Please, use only integer numbers}', 'crb' ) )"},
{"trigger": "help_text_map", "contents": "help_text( sprintf( __( '${1:You can get your google api key by clicking the button \"<strong>Get a key</strong>\" on the following <a href=\"%s\" target=\"_blank\">link</a>.}', 'crb' ), 'https://developers.google.com/maps/documentation/javascript/get-api-key' ) )"},
{"trigger": "set_default_value", "contents": "set_default_value( '${1:text}' )"},
{"trigger": "set_required", "contents": "set_required( true )"},
{"trigger": "show_on_template", "contents": "show_on_template( '${2:templates/${1:homepage}.php}' )"},
{"trigger": "show_on_post_type", "contents": "show_on_post_type( '${1:page}' )"},
{"trigger": "set_header_template", "contents": "set_header_template( '${1:{{ title \\}\\}}' )"},
{"trigger": "set_width", "contents": "set_width(${1:40})"},
{"trigger": "set_layout", "contents": "set_layout( '${1:tabbed-horizontal}' )"},
{"trigger": "set_value_type", "contents": "set_value_type( 'url' )"},
{"trigger": "add_fields", "contents": "add_fields( '${1:Services}', __( '${1:Services}', 'crb' ), array(\n\t${2:Field::make( 'text', 'title', __( 'Title', 'crb' ) ),}\n) )"},
{"trigger": "crb_get_page_context", "contents": "crb_get_page_context()"},
{"trigger": "crb_image", "contents": "crb_wp_get_attachment_image( ${1:\\$image_id}, ${2:'crb_image_size'} )"},
{"trigger": "crb_image_src", "contents": "crb_wp_get_attachment_image_src( ${1:\\$image_id}, ${2:'crb_image_size'} )"}
]
}