2013-05-11 2 views
0

플러그인을 만드는 새로운 방법. 기본적으로 내 플러그인 옵션 페이지에서 하나의 업데이트 버튼을 갖고 싶습니다.wordpress 플러그인 설정에서 함수를 호출하는 방법 wordpress 플러그인을 클릭하십시오.

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'); 

다른 두 함수에서 다음과 같이이

<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 &raquo; 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> 

내 플러그인 페이지에 몇 가지 기능이 포함되어 같은 플러그인 페이지는 ..

내 옵션 페이지가 보인다 내 플러그인 페이지. 업데이트 버튼을 클릭하면이 몇 가지 기능을 호출하려고합니다 .Plz 나를 도와주세요.

제가

<INPUT TYPE="button" onClick="history.go(0), myFunction();" VALUE="Update"> 

은 실행하지 PHP 코드를 이용하여 실제로 문제를 해결 한

답변

0

코드 라인을 실행하고, 사용자가이 페이지에 따라서 때 함수 update의 버튼 클릭을 수행 할 수 버튼 ..

내 문제는이 문제로 해결됩니다.

관련 문제