Skip to content

Commit

Permalink
Loading text domain
Browse files Browse the repository at this point in the history
  • Loading branch information
patilvikasj committed Sep 21, 2019
1 parent b8444e3 commit 5eff9fa
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 50 deletions.
4 changes: 2 additions & 2 deletions cf7-gist-ext.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Plugin Name: Contact Form 7 Gist (Formerly ConvertFox) Extension
* Plugin Name: Gist (Formerly ConvertFox) Extension for Contact Form 7
* Description: Integrate Contact Form 7 with Gist.
* Author: patilvikasj
* Author URI: https://patilvikasj.wordpress.com/
* Text Domain: contact-form-7-gist
* Domain Path: /languages/
* Version: 1.0.0
* Version: 1.0.1
*
* @package cf7-gist
*/
Expand Down
16 changes: 13 additions & 3 deletions classes/class-cf7-gist-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'add_gist_tracking_script' ) );
add_filter( 'wpcf7_editor_panels', __CLASS__ . '::render_options_metabox' );
add_action( 'wpcf7_after_save', array( $this, 'save_gist_settings' ) );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
}

/**
Expand Down Expand Up @@ -76,7 +77,7 @@ function cf7_inactive_notice() {
*/
function define_constants() {

define( 'CF7_GIST_VERSION', '1.0.0' );
define( 'CF7_GIST_VERSION', '1.0.1' );
define( 'CF7_GIST_PLUGIN_NAME', trim( dirname( CF7_GIST_PLUGIN_BASENAME ), '/' ) );
}

Expand Down Expand Up @@ -108,7 +109,7 @@ function add_gist_tracking_script() {

$is_gist_enabled = get_option( 'cf7_gist_' . $id, false );

if( $is_gist_enabled ) {
if ( $is_gist_enabled ) {
$form_data[ $id ] = $is_gist_enabled;
}
}
Expand Down Expand Up @@ -162,7 +163,7 @@ function gist_settings( $args ) {

<div class="cf7_gist_fields">
<p class="enable_gist_sync">
<input type="checkbox" id="cf7-gist-enabled" name="cf7-gist[enabled]" value="1"<?php echo ( isset( $cf7_gist ) && '1' == $cf7_gist ) ? ' checked="checked"' : ''; ?> />
<input type="checkbox" id="cf7-gist-enabled" name="cf7-gist[enabled]" value="1"<?php echo ( isset( $cf7_gist ) && 1 === $cf7_gist ) ? ' checked="checked"' : ''; ?> />
<label for="cf7-gist-enabled">
<?php echo esc_html( __( 'Sync form data to GIST.', 'contact-form-7-gist' ) ); ?>
</label>
Expand All @@ -187,6 +188,15 @@ function save_gist_settings( $args ) {
delete_option( 'cf7_gist_' . $args->id() );
}
}

/**
* Load plugin textdomain.
*
* @since 1.0.1
*/
function load_textdomain() {
load_plugin_textdomain( 'contact-form-7-gist', false, CF7_GIST_PLUGIN_DIR . '/languages' );
}
}

Cf7_Gist_Loader::get_instance();
Expand Down
Loading

0 comments on commit 5eff9fa

Please sign in to comment.