プラグインを作成するのは初めてです..基本的に、プラグインオプションページに、プラグインページからいくつかの機能を呼び出す更新ボタンを1つ付けたい..
私のオプションページはこんな感じ
<div class="wrap">
<?php screen_icon(); ?>
<form action="options.php" method="post" id="<?php echo $plugin_id; ?>_options_form" name="<?php echo $plugin_id; ?>_options_form">
<?php settings_fields($plugin_id.'_options'); ?>
<h2>Plugin Options » Settings</h2>
<table class="widefat">
<thead>
<tr>
<th><input type="submit" name="submit" value="Save Settings" class="button-primary" style="padding:8px;" /></th>
</tr>
</thead>
<tfoot>
<tr>
</table>
</form>
</div>
私のプラグインページには、次のような機能がほとんど含まれていません
function get_images(){
global $post;
global $wpdb;
$query_images_args = array(
'post_type' => 'attachment' , 'post_mime_type' =>'image','post_status' => 'published', 'posts_per_page' => -1,'numberposts' => 1
);
$query_images = new WP_Query( $query_images_args );
$images = array();
$abc=($images);
$count = count($images);
for ($i = 0; $i < $count; $i++)
{
$final[]= $images[$i];
}
if(count($abc)>1){
$_SESSION['arrayImg']=$abc;
}
$noofpics= count($image);
}
register_activation_hook(__FILE__, 'get_images');
私のプラグインページの別の2つの機能。したがって、更新ボタンをクリックすると、このいくつかの関数を呼び出したい..Plzが助けてくれます。