Plugin Directory

Changeset 1591181


Ignore:
Timestamp:
02/07/2017 04:39:15 PM (9 years ago)
Author:
ionutmorariu
Message:

ADD: extra check when post-id is not set

Location:
scale-lite-tools/trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • scale-lite-tools/trunk/inc/sl-google-maps/render-cpt.php

    r1589302 r1591181  
    9393
    9494function scale_lite_google_maps_shortcode($atts = array(), $content = null, $tag = ''){
     95  // normalize attribute keys, lowercase
     96  $sl_attrs = array_change_key_case((array)$atts, CASE_LOWER);
     97  if(!array_key_exists("post-id",$sl_attrs) || $sl_attrs['post-id'] == null) {
     98    return;
     99  }
     100
    95101  // output buffer start
    96102  ob_start();
    97 
    98   // normalize attribute keys, lowercase
    99   $sl_attrs = array_change_key_case((array)$atts, CASE_LOWER);
    100   if ($sl_attrs['post-id'] == null) {
    101     return ;
    102   }
    103103
    104104  $args = array(
  • scale-lite-tools/trunk/inc/sl-html-block/cpt.php

    r1589302 r1591181  
    100100 */
    101101function scale_lite_html_block_shortcode($atts = array(), $content = null, $tag = ''){
    102   // output buffer start
    103   ob_start();
    104102  // normalize attribute keys, lowercase
    105103  $sl_attrs = array_change_key_case((array)$atts, CASE_LOWER);
     104  if(!array_key_exists("post-id",$sl_attrs) || $sl_attrs['post-id'] == null) {
     105    return;
     106  }
    106107  if(!array_key_exists("class",$sl_attrs)) {
    107108    $sl_attrs['class']='';
    108109  }
    109   if ($sl_attrs['post-id'] == null) {
    110     return ;
    111   }
     110
     111  // output buffer start
     112  ob_start();
    112113
    113114  $args = array(
Note: See TracChangeset for help on using the changeset viewer.