PHP Snippet updated successfully.     Dismiss
= XYZ_IPS_INSERTION_METHOD['AUTOMATIC'] && $xyz_ips_insertionMethod <= XYZ_IPS_INSERTION_METHOD['EXECUTE_ON_DEMAND']) ? $xyz_ips_insertionMethod : XYZ_IPS_INSERTION_METHOD['AUTOMATIC']; $xyz_ips_insertionLocation = intval($_POST['xyz_ips_insertionLocation']); if ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_HEADER'] || $xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_FOOTER']) { $xyz_ips_insertionLocationType = XYZ_IPS_INSERTION_LOCATION_TYPE['ADMIN']; } else if($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_HEADER'] || $xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_FOOTER']){ $xyz_ips_insertionLocationType = XYZ_IPS_INSERTION_LOCATION_TYPE['FRONT_END']; } else{ $xyz_ips_insertionLocationType = 0; } if(get_option('xyz_ips_auto_insert')==1){ $xyz_ips_content_start=''; if (stripos($xyz_ips_content, '') !== false) $tag_end_position=stripos($xyz_ips_content,'?>'); else $tag_end_position="-1"; if(stripos($xyz_ips_content, '') === false) { $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; } else if(stripos($xyz_ips_content, '=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position) { $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; } } else if(stripos($xyz_ips_content, '') !== false) { $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; } } } if($xyz_ips_title != "" && $xyz_ips_content != ""){ if(ctype_alnum($temp_xyz_ips_title)){ $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id!=%d AND title=%s LIMIT 0,1',$xyz_ips_snippetId,$xyz_ips_title)) ; if($snippet_count == 0){ $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]'; $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'insertionMethod' => $xyz_ips_insertionMethod, 'insertionLocation' => $xyz_ips_insertionLocation, 'insertionLocationType' => $xyz_ips_insertionLocationType,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId)); header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$xyz_ips_snippetId.'&xyz_ips_msg=1'.'&goback='.$goback)); } else{ ?>
PHP Snippet already exists.     Dismiss
PHP Snippet title can have only alphabets,numbers or hyphen.     Dismiss
Fill all mandatory fields.     Dismiss
get_results($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ; $snippetDetails = $snippetDetails[0]; $xyz_ips_insertionMethod = $snippetDetails->insertionMethod; $xyz_ips_insertionLocation = $snippetDetails->insertionLocation; ?>
Edit PHP Snippet
>


   Placement Methods   *   
   Insertion Location   *   
Select Insertion Location
  • Run on header
  • Run on footer
  • Run on header
  • Run on footer
   Tracking Name  *  : 
   PHP code    PHP code (without <?php ?>)  *  :