芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/rigato2.ycreate.site/wp-content/themes/swell/lib/post_meta/meta_ad.php
ID; // メタ情報 $ad_type = get_post_meta( $the_id, 'ad_type', true ) ?: 'normal'; $meta_border = get_post_meta( $the_id, 'ad_border', true ) ?: 'off'; $meta_rank = get_post_meta( $the_id, 'ad_rank', true ) ?: 'rank0'; $meta_name = get_post_meta( $the_id, 'ad_name', true ); $meta_price = get_post_meta( $the_id, 'ad_price', true ); $meta_price = get_post_meta( $the_id, 'ad_price', true ); $meta_desc = get_post_meta( $the_id, 'ad_desc', true ); $meta_star = get_post_meta( $the_id, 'ad_star', true ); $meta_btn1_text = get_post_meta( $the_id, 'ad_btn1_text', true ) ?: __( '詳しくみる', 'swell' ); $meta_btn2_text = get_post_meta( $the_id, 'ad_btn2_text', true ) ?: __( '購入する', 'swell' ); $meta_btn1_url = get_post_meta( $the_id, 'ad_btn1_url', true ); $meta_btn2_url = get_post_meta( $the_id, 'ad_btn2_url', true ); $btn1_hidden = $meta_btn1_url ? '' : ' u-none'; $btn2_hidden = $meta_btn2_url ? '' : ' u-none'; $ad_title = $meta_name ?: get_the_title( $the_id ); // if ( empty( $meta_border ) ) $meta_border = 'off'; SWELL::set_nonce_field( '_meta_ad' ); ?>
=esc_html( $ad_title )?>
=esc_html__( '広告', 'swell' )?>
=esc_html( $ad_title )?>
=wp_kses_post( \SWELL_PARTS::review_stars( $meta_star ) )?>
=esc_html( $meta_price )?>
=wp_kses_post( $meta_desc )?>
=esc_html( $meta_btn1_text )?>
=esc_html( $meta_btn2_text )?>
=esc_html( $meta_btn1_text )?>
=esc_html( $meta_btn2_text )?>
=esc_html__( '広告タイプ', 'swell' )?>
=esc_html__( '(レイアウトが変化します)', 'swell' )?>
__( 'テキスト型', 'swell' ), 'normal' => __( 'バナー型', 'swell' ), 'affiliate' => __( 'アフィリエイト型', 'swell' ), 'amazon' => __( 'Amazon型', 'swell' ), 'ranking' => __( 'ランキング型', 'swell' ), ]; Field::meta_radiobox( 'ad_type', $choices, $ad_type, false ); ?>
=wp_kses_post( __( '※「テキスト型」は広告タグブロックで呼び出すことはできませんが、
ショートコードで文中に呼び出すことができます。', 'swell' ) )?>
=esc_html__( '広告ボックスの枠', 'swell' )?>
__( 'なし', 'swell' ), 'on' => __( 'あり', 'swell' ), ]; Field::meta_radiobox( 'ad_border', $choices, $meta_border, false ); ?>
=esc_html__( '広告タグ', 'swell' )?>
=esc_textarea( $meta_val )?></textarea>
=esc_html__( '順位', 'swell' )?>
__( '1位', 'swell' ), 'rank2' => __( '2位', 'swell' ), 'rank3' => __( '3位', 'swell' ), 'rank0' => __( '順位なし', 'swell' ), ]; Field::meta_radiobox( 'ad_rank', $choices, $meta_rank, false ); ?>
=esc_html__( '評価', 'swell' )?>
__( '星', 'swell' ) . ' : 0.5', '1' => __( '星', 'swell' ) . ' : 1', '1.5' => __( '星', 'swell' ) . ' : 1.5', '2' => __( '星', 'swell' ) . ' : 2', '2.5' => __( '星', 'swell' ) . ' : 2.5', '3' => __( '星', 'swell' ) . ' : 3', '3.5' => __( '星', 'swell' ) . ' : 3.5', '4' => __( '星', 'swell' ) . ' : 4', '4.5' => __( '星', 'swell' ) . ' : 4.5', '5' => __( '星', 'swell' ) . ' : 5', ]; Field::meta_select( 'ad_star', $stars, $meta_star, __( '評価を選択', 'swell' ) ); ?>
=esc_html__( '表示名', 'swell' )?>
=esc_html__( '(空の場合はタイトルが出力されます)', 'swell' )?>
=esc_html__( '価格', 'swell' )?>
=esc_html__( '説明文', 'swell' )?>
=wp_kses_post( $meta_desc )?></textarea>
=esc_html__( 'ボタン1リンク先', 'swell' )?>
=esc_html__( 'ボタン1テキスト', 'swell' )?>
=esc_html__( 'ボタン2リンク先', 'swell' )?>
=esc_html__( 'ボタン2テキスト', 'swell' )?>
'str', 'ad_rank' => 'str', 'ad_img' => 'code', 'ad_border' => 'str', 'ad_name' => 'html', 'ad_star' => 'str', 'ad_desc' => 'html', 'ad_price' => 'str', 'ad_btn1_url' => 'url', 'ad_btn1_text' => 'str', 'ad_btn2_url' => 'url', 'ad_btn2_text' => 'str', ]); // $METAKEYS = [ // 'ad_type', // 'ad_rank', // 'ad_img', // 'ad_border', // 'ad_name', // 'ad_star', // 'ad_desc', // 'ad_price', // 'ad_btn1_url', // 'ad_btn1_text', // 'ad_btn2_url', // 'ad_btn2_text', // ]; //
aaa
// foreach ( $METAKEYS as $key ) { // // 保存したい情報が渡ってきていれば更新作業に入る // if ( isset( $_POST[ $key ] ) ) { // $meta_val = $_POST[ $key ]; // // scriptも通すので、ad はサニタイズなし // // DBアップデート // update_post_meta( $the_id, $key, $meta_val ); // } // } }