Beispiel #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)
 {
     $arr = array('css_files' => '', 'css_custom' => '');
     if (isset($post_id)) {
         $arr['css_files'] = WR_Pb_Helper_Functions::custom_css($post_id, 'css_files');
         $arr['css_custom'] = WR_Pb_Helper_Functions::custom_css($post_id, 'css_custom');
     }
     return $arr;
 }
Beispiel #2
0
 /**
  * Save custom CSS information: files, code
  *
  * @return void
  */
 function save_css_custom()
 {
     if (!isset($_POST[WR_NONCE]) || !wp_verify_nonce($_POST[WR_NONCE], WR_NONCE)) {
         return;
     }
     $post_id = esc_sql($_POST['post_id']);
     // save custom css code & files
     WR_Pb_Helper_Functions::custom_css($post_id, 'css_files', 'put', esc_sql($_POST['css_files']));
     WR_Pb_Helper_Functions::custom_css($post_id, 'css_custom', 'put', esc_textarea($_POST['custom_css']));
     exit;
 }