-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from brenoalvs/develop
Releasing 0.2.0
- Loading branch information
Showing
15 changed files
with
1,411 additions
and
180 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Show flags in Languages column on posts list. | ||
* | ||
* @since 0.1.0 | ||
* | ||
* @package Monk | ||
* @subpackage Monk/Widgets/Partials | ||
*/ | ||
|
||
// If this file is called directly, abort. | ||
if ( ! defined( 'WPINC' ) ) { | ||
die; | ||
} | ||
if ( ! $language ) : ?> | ||
<?php if ( monk_get_url_args( 'lang' ) ) : ?> | ||
<?php $language = monk_get_url_args( 'lang' ); ?> | ||
<?php elseif ( $_REQUEST['post_id'] && get_post_meta( $_REQUEST['post_id'], '_monk_post_language', true ) ) : ?> | ||
<?php $language = get_post_meta( $_REQUEST['post_id'], '_monk_post_language', true ); ?> | ||
<?php else : ?> | ||
<?php $language = get_option( 'monk_default_language', false ); ?> | ||
<?php endif; ?> | ||
<?php endif; ?> | ||
<div class="monk-language-field"> | ||
<span class="monk-language-name"><?php echo esc_html( $monk_languages[ $language ]['name'] ); ?></span> | ||
<span class="monk-selector-flag flag-icon <?php echo esc_attr( 'flag-icon-' . $monk_languages[ $language ]['slug'] ); ?>"></span> | ||
</div> | ||
<input type="hidden" name="<?php echo sprintf( 'attachments[%d][language]', $post_id ); ?>" id="<?php echo sprintf( 'attachments[%d][language]', $post_id ); ?>" value="<?php echo esc_attr( $language ); ?>"> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Show flags in Languages column on posts list. | ||
* | ||
* @since 0.1.0 | ||
* | ||
* @package Monk | ||
* @subpackage Monk/Widgets/Partials | ||
*/ | ||
|
||
// If this file is called directly, abort. | ||
if ( ! defined( 'WPINC' ) ) { | ||
die; | ||
} | ||
|
||
$attach = 'monk-attach'; | ||
if ( $available_languages ) : | ||
?> | ||
<select class="monk-lang"> | ||
<?php | ||
foreach ( $active_languages as $lang_code ) { | ||
if ( array_key_exists( $lang_code, $monk_languages ) && $language_code !== $lang_code && ! array_key_exists( $lang_code, $post_translations ) ) { | ||
if ( $lang_code === $language ) : | ||
?> | ||
<option value='<?php echo esc_attr( $lang_code ); ?>' selected="selected"> | ||
<?php echo esc_html( $monk_languages[ $lang_code ]['name'] ); ?> | ||
</option> | ||
<?php | ||
elseif ( ! $language && $lang_code === $default_language ) : | ||
?> | ||
<option value='<?php echo esc_attr( $lang_code ); ?>' selected="selected"> | ||
<?php echo esc_html( $monk_languages[ $lang_code ]['name'] ); ?> | ||
</option> | ||
<?php | ||
else : | ||
?> | ||
<option value="<?php echo esc_attr( $lang_code ); ?>"> | ||
<?php echo esc_html( $monk_languages[ $lang_code ]['name'] )?> | ||
</option>; | ||
<?php | ||
endif; | ||
} | ||
} | ||
?> | ||
</select> | ||
|
||
<input type="hidden" name="monk_id" class="monk-id" value="<?php echo esc_attr( $monk_id ); ?>"> | ||
<input type="hidden" class="current-post-id" value="<?php echo esc_attr( $post_id ); ?>"> | ||
<button class="button <?php echo esc_attr( $attach ); ?>"> | ||
<?php esc_html_e( 'Ok', 'monk' ); ?> | ||
</button> | ||
<?php else : ?> | ||
<div class="monk-language-field"> | ||
<span class="monk-language-name"><?php esc_html_e( 'No more languages available.', 'monk' ); ?></span> | ||
</div> | ||
<?php endif; ?> |
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
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
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
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
Oops, something went wrong.