Plugin Directory

Changeset 2423098


Ignore:
Timestamp:
11/22/2020 05:08:32 PM (5 years ago)
Author:
faaiq
Message:

fix jquery issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • custom-post-order-category/trunk/wp-customcategorypostorder.php

    r2423097 r2423098  
    239239            $html .= '<ul id="sortable" class="sortableul">';
    240240
    241            
    242             for($i = 0; $i < count( $order_result); ++$i) {
    243                 $post_id = $order_result[$i]->post_id;
    244                 $post = $temp_order[$post_id];
    245                
    246                 unset($temp_order[$post_id]);   
    247 
    248                 $total = $this->check_order_table($post->ID,$category);
    249                
    250                 $od = $order_result_incl[$post->ID];
    251 
    252                 if($od == 1) {
    253                     $edit = '<small><a href="javascript:void(0);" onclick="rempst('.$post->ID.',\''.$category.'\')">Remove</a></small>';
    254                 }else {
    255                     $edit = '<small><a href="javascript:void(0);" onclick="rempst('.$post->ID.',\''.$category.'\')">Add</a></small>';
    256                 }
    257 
    258                 if($checked == "checked") {
    259                     if($total > 0 ) {
     241            if($order_result) {
     242                for($i = 0; $i < count( $order_result); ++$i) {
     243                    $post_id = $order_result[$i]->post_id;
     244                    $post = $temp_order[$post_id];
     245                   
     246                    unset($temp_order[$post_id]);   
     247
     248                    $total = $this->check_order_table($post->ID,$category);
     249                   
     250                    $od = $order_result_incl[$post->ID];
     251
     252                    if($od == 1) {
     253                        $edit = '<small><a href="javascript:void(0);" onclick="rempst('.$post->ID.',\''.$category.'\')">Remove</a></small>';
     254                    }else {
     255                        $edit = '<small><a href="javascript:void(0);" onclick="rempst('.$post->ID.',\''.$category.'\')">Add</a></small>';
     256                    }
     257
     258                    if($checked == "checked") {
     259                        if($total > 0 ) {
     260                            $html .= '<li class="sortable" id="'.$post->ID.'" rel="'.$post->ID.'" post_title="'.$post->post_title.'">';
     261                            $html .= '<div id="post" class="drag_post">'.$post->post_title.'<div class="ar_link" id="id_'.$post->ID.'">'.$edit.'</div></div>';
     262                        }
     263                    }else {
    260264                        $html .= '<li class="sortable" id="'.$post->ID.'" rel="'.$post->ID.'" post_title="'.$post->post_title.'">';
    261                         $html .= '<div id="post" class="drag_post">'.$post->post_title.'<div class="ar_link" id="id_'.$post->ID.'">'.$edit.'</div></div>';
     265                        $html .= '<div id="post" class="drag_post">'.$post->post_title.'<div class="ar_link"   id="id_'.$post->ID.'">'.$edit.'</div></div>';
    262266                    }
    263                 }else {
    264                     $html .= '<li class="sortable" id="'.$post->ID.'" rel="'.$post->ID.'" post_title="'.$post->post_title.'">';
    265                     $html .= '<div id="post" class="drag_post">'.$post->post_title.'<div class="ar_link"   id="id_'.$post->ID.'">'.$edit.'</div></div>';
    266                 }
    267                 $html .= '</li>';
    268             }
     267                    $html .= '</li>';
     268                }
     269            }
    269270
    270271
Note: See TracChangeset for help on using the changeset viewer.