find_posts_div

函式
find_posts_div ( $found_action = '' )
引數
  • (string) $found_action
    Required:
    Default: (empty)
定義位置
相關方法
rewind_postswp_ajax_find_postsnext_posts_link_find_post_by_old_date_find_post_by_old_slug
引入
2.7.0
棄用
-

find_posts_div – 這個函式為文章或頁面內容容器的開頭和結尾div標籤搜尋一個字串。它接受要搜尋的字串作為其唯一的引數。

輸出用於將媒體附加到媒體列表螢幕中的文章或頁面的模式視窗。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function find_posts_div( $found_action = '' ) {
?>
<div id="find-posts" class="find-box" style="display: none;">
<div id="find-posts-head" class="find-box-head">
<?php _e( 'Attach to existing content' ); ?>
<button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></span></button>
</div>
<div class="find-box-inside">
<div class="find-box-search">
<?php if ( $found_action ) { ?>
<input type="hidden" name="found_action" value="<?php echo esc_attr( $found_action ); ?>" />
<?php } ?>
<input type="hidden" name="affected" id="affected" value="" />
<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
<input type="text" id="find-posts-input" name="ps" value="" />
<span class="spinner"></span>
<input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
<div class="clear"></div>
</div>
<div id="find-posts-response"></div>
</div>
<div class="find-box-buttons">
<?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?>
<div class="clear"></div>
</div>
</div>
<?php
}
function find_posts_div( $found_action = '' ) { ?> <div id="find-posts" class="find-box" style="display: none;"> <div id="find-posts-head" class="find-box-head"> <?php _e( 'Attach to existing content' ); ?> <button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></span></button> </div> <div class="find-box-inside"> <div class="find-box-search"> <?php if ( $found_action ) { ?> <input type="hidden" name="found_action" value="<?php echo esc_attr( $found_action ); ?>" /> <?php } ?> <input type="hidden" name="affected" id="affected" value="" /> <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?> <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label> <input type="text" id="find-posts-input" name="ps" value="" /> <span class="spinner"></span> <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /> <div class="clear"></div> </div> <div id="find-posts-response"></div> </div> <div class="find-box-buttons"> <?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?> <div class="clear"></div> </div> </div> <?php }
function find_posts_div( $found_action = '' ) {
	?>
	<div id="find-posts" class="find-box" style="display: none;">
		<div id="find-posts-head" class="find-box-head">
			<?php _e( 'Attach to existing content' ); ?>
			<button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></span></button>
		</div>
		<div class="find-box-inside">
			<div class="find-box-search">
				<?php if ( $found_action ) { ?>
					<input type="hidden" name="found_action" value="<?php echo esc_attr( $found_action ); ?>" />
				<?php } ?>
				<input type="hidden" name="affected" id="affected" value="" />
				<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
				<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
				<input type="text" id="find-posts-input" name="ps" value="" />
				<span class="spinner"></span>
				<input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
				<div class="clear"></div>
			</div>
			<div id="find-posts-response"></div>
		</div>
		<div class="find-box-buttons">
			<?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?>
			<div class="clear"></div>
		</div>
	</div>
	<?php
}

常見問題

FAQs
檢視更多 >