Exemplo n.º 1
0
 /**
  * Get custom css data: Css files, Css code of a post
  *
  * @global type $post
  *
  * @param type  $post_id
  *
  * @return type
  */
 static function custom_css_data($post_id)
 {
     global $post;
     $arr = array('css_files' => '', 'css_custom' => '');
     if (isset($post_id)) {
         $arr['css_files'] = IG_Pb_Helper_Functions::custom_css($post_id, 'css_files');
         $arr['css_custom'] = IG_Pb_Helper_Functions::custom_css($post_id, 'css_custom');
     }
     return $arr;
 }
Exemplo n.º 2
0
 /**
  * Save custom CSS information: files, code
  *
  * @return void
  */
 function save_css_custom()
 {
     if (!isset($_POST[IGNONCE]) || !wp_verify_nonce($_POST[IGNONCE], IGNONCE)) {
         return;
     }
     $post_id = esc_sql($_POST['post_id']);
     // save custom css code & files
     IG_Pb_Helper_Functions::custom_css($post_id, 'css_files', 'put', esc_sql($_POST['css_files']));
     IG_Pb_Helper_Functions::custom_css($post_id, 'css_custom', 'put', esc_textarea($_POST['custom_css']));
     exit;
 }