Skip to content

Commit

Permalink
Grunt, POT.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrice committed Sep 29, 2015
1 parent 0eb4227 commit 0096d99
Show file tree
Hide file tree
Showing 10 changed files with 725 additions and 134 deletions.
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Default behavior
* text=auto

# Text files
*.php text
*.css text
*.js text
*.md text

# Binary files
*.png binary
*.jpg binary
*.gif binary
*.ico binary
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
Thumbs.db
.svn
node_modules/
5 changes: 5 additions & 0 deletions .svnignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
.gitattributes
.svnignore
node_modules
96 changes: 96 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
'use strict';

module.exports = function(grunt) {

// Load tasks
require('load-grunt-tasks')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),


// Dependencies

// PHP

// Lint .php files for syntax errors
phplint: {
all: [ '*.php', 'lib/**/*.php' ]
},


// I18n

// Add text domain as last argument of i18n functions
addtextdomain: {
php: {
files: {
src: [
'*.php',
'lib/**/*.php'
]
}
}
},

// Check text domain is last argument of i18n functions
checktextdomain: {
options: {
text_domain: '<%= pkg.name %>',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d',
'esc_attr__:1,2d',
'esc_html__:1,2d',
'esc_attr_e:1,2d',
'esc_html_e:1,2d',
'esc_attr_x:1,2c,3d',
'esc_html_x:1,2c,3d'
]
},
files: {
expand: true,
src: [
'*.php',
'lib/**/*.php'
]
}
},


// Build language .pot file
makepot: {
plugin: {
options: {
domainPath: '/languages',
processPot: function( pot ) {
pot.headers['report-msgid-bugs-to'] = 'StudioPress <[email protected]>';
pot.headers['last-translator'] = 'StudioPress <[email protected]>';
pot.headers['language-team'] = 'English <[email protected]>';
pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;';
pot.headers['x-generator'] = 'grunt-wp-i18n 0.4.4';
pot.headers['x-poedit-basepath'] = '.';
pot.headers['x-poedit-language'] = 'English';
pot.headers['x-poedit-country'] = 'UNITED STATES';
pot.headers['x-poedit-sourcecharset'] = 'utf-8';
pot.headers['x-poedit-keywordslist'] = '__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;';
pot.headers['x-poedit-bookmarks'] = '';
pot.headers['x-poedit-searchpath-0'] = '.';
pot.headers['x-textdomain-support'] = 'yes';
return pot;
},
type: 'wp-plugin'
}
}
},


});

};
172 changes: 86 additions & 86 deletions admin.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function simplehooks_form_generate( $args = array() ) {

?>

<h4><code><?php echo $args['hook']; ?></code> <?php _e( 'Hook', 'simplehooks' ); ?></h4>
<h4><code><?php echo $args['hook']; ?></code> <?php _e( 'Hook', 'genesis-simple-hooks' ); ?></h4>
<p><span class="description"><?php echo $args['desc']; ?></span></p>

<?php
Expand All @@ -51,7 +51,7 @@ function simplehooks_form_generate( $args = array() ) {
foreach ( (array) $args['unhook'] as $function ) {
?>

<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" value="<?php echo $function; ?>" <?php if ( in_array( $function, (array) simplehooks_get_option( $args['hook'], 'unhook' ) ) ) echo 'checked'; ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]"><?php printf( __( 'Unhook <code>%s()</code> function from this hook?', 'simplehooks' ), $function ); ?></label><br />
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" value="<?php echo $function; ?>" <?php if ( in_array( $function, (array) simplehooks_get_option( $args['hook'], 'unhook' ) ) ) echo 'checked'; ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]"><?php printf( __( 'Unhook <code>%s()</code> function from this hook?', 'genesis-simple-hooks' ), $function ); ?></label><br />

<?php
}
Expand All @@ -62,8 +62,8 @@ function simplehooks_form_generate( $args = array() ) {
<p><textarea name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][content]" cols="70" rows="5"><?php echo htmlentities( simplehooks_get_option( $args['hook'], 'content' ), ENT_QUOTES, 'UTF-8' ); ?></textarea></p>

<p>
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'shortcodes' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]"><?php _e( 'Execute Shortcodes on this hook?', 'simplehooks' ); ?></label><br />
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'php' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]"><?php _e( 'Execute PHP on this hook?', 'simplehooks' ); ?></label>
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'shortcodes' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]"><?php _e( 'Execute Shortcodes on this hook?', 'genesis-simple-hooks' ); ?></label><br />
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'php' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]"><?php _e( 'Execute PHP on this hook?', 'genesis-simple-hooks' ); ?></label>
</p>

<hr class="div" />
Expand Down
Loading

0 comments on commit 0096d99

Please sign in to comment.