Skip to content

Commit

Permalink
Merge pull request #1150 from vektor-inc/fix/code-format
Browse files Browse the repository at this point in the history
comit 時、push 時にコードのフォーマットを実行
  • Loading branch information
kurudrive authored Dec 2, 2024
2 parents 437d997 + 6b2ccd3 commit b989644
Show file tree
Hide file tree
Showing 140 changed files with 2,600 additions and 2,149 deletions.
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
6 changes: 2 additions & 4 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress">
<exclude name="WordPress.VIP"/>
</rule>
<rule ref="WordPress"></rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
Expand All @@ -38,7 +36,7 @@
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="my-plugin"/>
<property name="text_domain" type="array" value="vk-all-in-one-expansion-unit"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
Expand Down
42 changes: 23 additions & 19 deletions admin/admin-active-setting-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,31 @@
foreach ( $vkExUnit_packages as $package ) :
$active = veu_package_is_enable( $package['name'] );

if ( ! empty( $package['section_title'] ) ){
if ( ! empty( $package['section_title'] ) ) {
echo '<tr><th colspan="3" class="section_title">' . $package['section_title'] . '</th></tr>';
} else {

?>
?>
<tr class="
<?php
echo ( $active ) ? 'active' : 'inactive';
if ( $package['hidden'] ) {
echo ' dev_object'; }
?>
?>
" >
<th scope='row' class='check-column'>
<label class='screen-reader-text' for='checkbox_active_<?php echo esc_attr( $package['name'] ); ?>' ><?php echo esc_html( $package['title'] ); ?></label>
<input type="checkbox" name="vkExUnit_common_options[active_<?php echo esc_attr( $package['name'] ); ?>]" id="checkbox_active_<?php echo esc_attr( $package['name'] ); ?>" value="true" <?php if(!$package['hidden']){echo 'class="vew-module-checkbox"';}; ?>
<input type="checkbox" name="vkExUnit_common_options[active_<?php echo esc_attr( $package['name'] ); ?>]" id="checkbox_active_<?php echo esc_attr( $package['name'] ); ?>" value="true"
<?php
if ( ! $package['hidden'] ) {
echo 'class="vew-module-checkbox"';
}
?>
<?php
if ( $active ) {
echo 'checked'; }
?>
/>
?>
/>
</th>
<td class='plugin-title'>
<label for='checkbox_active_<?php echo esc_attr( $package['name'] ); ?>'><strong><?php echo esc_html( $package['title'] ); ?></strong></label>
Expand All @@ -58,25 +63,24 @@
$i = 0;
if ( $count ) :
foreach ( $package['attr'] as $att ) :
if (
// パッケージが有効化されている
if ( // パッケージが有効化されている
$active ||
// 有効ではないが enable only が false のとき
empty( $att['enable_only'] ) ) :
?>
<?php echo ( $count > 1 && $i >= 1 ) ? ' | ' : ''; ?>
?>
<?php echo ( $count > 1 && $i >= 1 ) ? ' | ' : ''; ?>
<span>
<a href="<?php echo ( $att['url'] ) ? esc_url( $att['url'] ) : admin_url() . 'admin.php?page=vkExUnit_main_setting'; ?>"
<?php echo ( isset( $att['target'] ) && $att['target'] === '_blank' ) ? 'target="_blank"' : ''; ?>>
<?php echo esc_html( $att['name'] ); ?>
<?php echo ( isset( $att['target'] ) && $att['target'] === '_blank' ) ? 'target="_blank"' : ''; ?>>
<?php echo esc_html( $att['name'] ); ?>
</a>
</span>

<?php
<?php
endif;
$i++;
++$i;
endforeach;
endif; //if($count):
endif; // if($count):
?>
</td>
<td class='column-description desc'>
Expand All @@ -85,15 +89,15 @@
if ( is_array( $package['description'] ) ) :
foreach ( $package['description'] as $desk ) {
echo wp_kses_post( $desk ); } else :
?>
?>
<p><?php echo wp_kses_post( $package['description'] ); ?></p>
<?php endif; ?>
</div><!-- [ /.plugin-description ] -->
</td>
</tr>
<?php } ?>

<?php
<?php
endforeach;
?>
</tbody>
Expand All @@ -109,7 +113,7 @@
<br />

<?php
do_action( 'vew_admin_setting_block', $options);
do_action( 'vew_admin_setting_block', $options );
?>

<button onclick="javascript:jQuery('#vkEx_extention').toggle(); return false;" class="button"><?php _e( 'Extension Setting', 'vk-all-in-one-expansion-unit' ); ?></button>
Expand All @@ -123,7 +127,7 @@
if ( veu_content_filter_state() == 'loop_end' ) {
echo 'checked';}
?>
/><?php _e( 'set extension contents to loop_end hook', 'vk-all-in-one-expansion-unit' ); ?></label>
/><?php _e( 'set extension contents to loop_end hook', 'vk-all-in-one-expansion-unit' ); ?></label>
<?php do_action( 'vkExUnit_extention_contents_message' ); ?>
</td>
</tr>
Expand Down
30 changes: 13 additions & 17 deletions admin/admin-main-setting-page.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/*
Main Setting Page _ ExUnit > メイン設定 メニューを追加
Main Setting Page _ ページのフレーム( メニューとメインエリア両方 )
Main Setting Page _ メインエリアの中身
Main Setting Page _ ExUnit > メイン設定 メニューを追加
Main Setting Page _ ページのフレーム( メニューとメインエリア両方 )
Main Setting Page _ メインエリアの中身
/*
Main Setting Page _ ExUnit > メイン設定 メニューを追加
Main Setting Page _ ExUnit > メイン設定 メニューを追加
/*-------------------------------------------*/
use VektorInc\VK_Admin\VkAdmin;

Expand All @@ -18,7 +18,7 @@ function veu_add_main_setting() {
__( 'Main setting', 'vk-all-in-one-expansion-unit' ), // Name of page
__( 'Main setting', 'vk-all-in-one-expansion-unit' ), // Label in menu
'activate_plugins', // veu_get_capability_required()でないのは edit_theme_options権限を付与したユーザーにもアクセスさせないためにactivate_pluginsにしている。
// $capability_required, // Capability
// $capability_required, // Capability
'vkExUnit_main_setting', // ユニークなこのサブメニューページの識別子
'veu_render_main_frame' // メニューページのコンテンツを出力する関数
);
Expand All @@ -29,7 +29,7 @@ function veu_add_main_setting() {


/*
Main Setting Page _ ページのフレーム( メニューとメインエリア両方 )
Main Setting Page _ ページのフレーム( メニューとメインエリア両方 )
/*-------------------------------------------*/
function veu_render_main_frame() {

Expand Down Expand Up @@ -65,11 +65,10 @@ function veu_render_main_frame() {
}

VkAdmin::admin_page_frame( $get_page_title, 'vkExUnit_the_main_setting_body', $get_logo_html, $get_menu_html );

}

/*
Main Setting Page _ メインエリアの中身
Main Setting Page _ メインエリアの中身
/*-------------------------------------------*/
function vkExUnit_the_main_setting_body() {
global $vkExUnit_options;?>
Expand All @@ -79,7 +78,6 @@ function vkExUnit_the_main_setting_body() {
if ( is_array( $vkExUnit_options ) ) {
echo '<div>'; // jsでfirst-child取得用
foreach ( $vkExUnit_options as $vkoption ) {

if ( empty( $vkoption['render_page'] ) ) {
continue; }

Expand All @@ -90,19 +88,16 @@ function vkExUnit_the_main_setting_body() {
echo '</section>';
}
echo '</div>';

} else {

echo __( 'Activated Packages is noting. please activate some package.', 'vk-all-in-one-expansion-unit' );

echo __( 'Activated Packages is noting. please activate some package.', 'vk-all-in-one-expansion-unit' );
}
echo '</form>';
echo '</form>';
}

/*
Main Setting Page _ 値をアップデート
Main Setting Page で複数のoption値が送信される。
それらをループしながらサニタイズしながらアップデートする
Main Setting Page _ 値をアップデート
Main Setting Page で複数のoption値が送信される。
それらをループしながらサニタイズしながらアップデートする
/*-------------------------------------------*/
function veu_main_sanitaize_and_update( $_post ) {

Expand Down Expand Up @@ -141,6 +136,7 @@ function veu_main_sanitaize_and_update( $_post ) {
*/
/**
* [vkExUnit_register_setting description]
*
* @param string $tab_label 管理画面に表示される機能の名前
* @param string $option_name option保存値
* @param string $sanitize_callback 保存時のサニタイズ関数
Expand Down
7 changes: 3 additions & 4 deletions admin/admin-post-metabox.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php
/*
add page custom field
add page custom field
/*-------------------------------------------*/

require_once( dirname( __FILE__ ) . '/class-veu-metabox.php' );
require_once __DIR__ . '/class-veu-metabox.php';

function veu_add_parent_metabox() {

// parent metabox(統合metabox)を出力する

if ( veu_is_parent_metabox_display() ) {

$meta_box_name = veu_get_name();

/*
Expand Down Expand Up @@ -39,7 +38,7 @@ function veu_add_parent_metabox() {
*/
// 子ページリストやサイトマップなど「挿入アイテムの設定」を読み込むための子metaboxを読み込む
if ( veu_is_insert_item_metabox_display() ) {
require_once( dirname( __FILE__ ) . '/class-veu-metabox-insert-items.php' );
require_once __DIR__ . '/class-veu-metabox-insert-items.php';
}
}

Expand Down
Loading

0 comments on commit b989644

Please sign in to comment.